这是indexloc提供的服务,不要输入任何密码
Skip to content

Parsing concurrently loaded libraries on Linux is error-prone #1125

@apangin

Description

@apangin

Describe the bug

The bug was originally noticed when testing nativemem with GraalVM.
Sometimes, when two shared libraries are opened concurrently in different threads, async-profiler sees unadjusted offset (instead of a relocated address) when parsing relocation entries in parseDynamicSection().

Expected vs. actual behavior

JVM may crash when profiler is started with nativemem option.

Reproduction Steps

while true; do
  java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCIProduct -Djava.library.path=build/test/lib -agentpath:build/lib/libasyncProfiler.so=start,nativemem=1,total,file=out.jfr -cp build/test test.nativemem.CallsAllNoLeak once
done

Additional Information/Context

No response

Async-profiler version

master

Environment details

  • Linux aarch64, glibc
  • OpenJDK Runtime Environment GraalVM CE 21.0.5-dev+14.1 (build 21.0.5+14-LTS)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions