Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash when use LD_PRELOAD to dynamic link so file #176

Closed
calvin1978 opened this issue Nov 13, 2018 · 1 comment
Closed

crash when use LD_PRELOAD to dynamic link so file #176

calvin1978 opened this issue Nov 13, 2018 · 1 comment

Comments

@calvin1978
Copy link

calvin1978 commented Nov 13, 2018

---------------  T H R E A D  ---------------

Current thread (0x00007fd5e80347e0):  JavaThread "WK-VRE-431" [_thread_in_vm, id=15749, stack(0x00007fd39a6e0000,0x00007fd39a7e1000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000000

Stack: [0x00007fd39a6e0000,0x00007fd39a7e1000],  sp=0x00007fd39a7ded60,  free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)

C  [libc.so.6+0x9c90d]  time+0xd

C  [libc.so.6+0xaedf5]  __sysconf+0x345

V  [libjvm.so+0x7140dc]  JVM_ActiveProcessorCount+0xac

J 7183  java.lang.Runtime.availableProcessors()I (0 bytes) 

J 8925 C2 java.util.concurrent.CompletableFuture.waitingGet(Z)Ljava/lang/Object; (184 bytes) 

In Docker, we hack the sysconf system call to return the right cpu cores for java.lang.Runtime.availableProcessors(), use below sentence to link it.

export LD_PRELOAD="/usr/local/lib/libsysconfcpus.so:

then crash....

@apangin
Copy link
Member

apangin commented Nov 13, 2018

How is this related to async-profiler?

BTW, a better way to patch Runtime.availableProcessors in Docker is to use bind mount to override /sys/devices/system/cpu/online file in the container or to use JDK 8u191+ which has buit-in support for this feature.

@apangin apangin closed this as completed Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants