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

Unable to run drmemory v2.5.0 on RHEL 8.2 #2453

Open
shahsb opened this issue May 31, 2022 · 2 comments
Open

Unable to run drmemory v2.5.0 on RHEL 8.2 #2453

shahsb opened this issue May 31, 2022 · 2 comments

Comments

@shahsb
Copy link

shahsb commented May 31, 2022

I downloaded Dr. Memory v2.5..0 from https://github.com/DynamoRIO/drmemory/releases/download/release_2.5.0/DrMemory-Linux-2.5.0.tar.gz

Extracted & set the environment variables properly.

When I tried to run my app using command: "drmemory -- myapp myapp_args"

I got this error: "drmemory: No such file or directory"

so I tried to do ldd & got this error:
ldd drmemory
not a dynamic executable

Next, I tried running readelf and got below output:

readelf -d drmemory

Dynamic section at offset 0xafd3c contains 31 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libdynamorio.so]
0x00000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x00000001 (NEEDED) Shared library: [libc.so.6]
0x0000001d (RUNPATH) Library runpath: [$ORIGIN/../dynamorio/lib32/release:$ORIGIN/../dynamorio/lib32]
0x0000000c (INIT) 0x1a000
0x0000000d (FINI) 0x4c0b8
0x00000019 (INIT_ARRAY) 0x76b78
0x0000001b (INIT_ARRAYSZ) 4 (bytes)
0x0000001a (FINI_ARRAY) 0x76b7c
0x0000001c (FINI_ARRAYSZ) 4 (bytes)
0x00000004 (HASH) 0x1ec
0x6ffffef5 (GNU_HASH) 0xd34
0x00000005 (STRTAB) 0x34b8
0x00000006 (SYMTAB) 0x1828
0x0000000a (STRSZ) 8119 (bytes)
0x0000000b (SYMENT) 16 (bytes)
0x00000015 (DEBUG) 0x0
0x00000003 (PLTGOT) 0xb0e54
0x00000002 (PLTRELSZ) 624 (bytes)
0x00000014 (PLTREL) REL
0x00000017 (JMPREL) 0x1943c
0x00000011 (REL) 0x58a4
0x00000012 (RELSZ) 80792 (bytes)
0x00000013 (RELENT) 8 (bytes)
0x0000001e (FLAGS) BIND_NOW
0x6ffffffb (FLAGS_1) Flags: NOW PIE
0x6ffffffe (VERNEED) 0x5804
0x6fffffff (VERNEEDNUM) 2
0x6ffffff0 (VERSYM) 0x5470
0x6ffffffa (RELCOUNT) 10093
0x00000000 (NULL) 0x0

The same drmemory v2.5.0 is working fine on windows platform.

So wondering: Is Dr. Memory ever tested on Red Hat platform?

Any workaround or solution to this would help.
Thanks in advance.

@paulfloyd
Copy link

Maybe the bin64 version works better.
I just tried on RHEL 7.6 and a) failed to find libunwind and b) when I set LD_LIBRARY_PATH to point to a fairly recent libunwind, it hangs fairly quickly

set_tid_address(0x7ffdf7c529d0)         = 20622
set_robust_list(0x7ffdf7c529e0, 24)     = 0
rt_sigaction(SIGRTMIN, {0x7ffdf6f5a790, [], SA_RESTORER|SA_SIGINFO, 0x7ffdf6f635d0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x7ffdf6f5a820, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7ffdf6f635d0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
gettid()                                = 20622
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---

Looks like the stack is hosed.

@paulfloyd
Copy link

RHEL 8.2 is a bit better

bin64/drmemory -- pwd
<Application /usr/bin/pwd (1538859). Unable to load client library: libunwind.so.8
	Unable to locate library! Try adding path to LD_LIBRARY_PATH.>
<Application /usr/bin/pwd (1538859).  DynamoRIO internal crash at PC 0x000000007381f5f0.  Please report this at http://dynamorio.org/issues/.  Program aborted.
Received SIGSEGV at unknown pc 0x000000007381f5f0 in thread 1538859
Base: 0x00007ffff7de5000
Registers:eax=0x000000007381f5f0 ebx=0x00007ffde3c555d8 ecx=0x0000000000000008 edx=0x00007fffffffcff8
	esi=0x00007fffffffbde0 edi=0x0000000000000001 esp=0x00007fffffffbdc8 ebp=0x0000000000000000
	r8 =0x0000000000000000 r9 =0x0000000000000000 r10=0x00007fffffffa990 r11=0x0000000000000246
	r12=0x00007fffffffbdda r13=0x00007ffde3c54080 r14=0x00007ffff7f29110 r15=0x00007fffffffef8d
	eflags=0x0000000000010206
version 8.0.18915, custom build
-no_dynamic_options -logdir '.../Downloads/DrMemory-Linux-2.5.0/drmemory/logs/dynamorio' -client_lib '.../Downloads/DrMemory-Linux-2.5.0/bin64/release/libdrmemorylib.so;0;-logdir `.../Downloads/DrMemory-Linux-2.5.0/drmemory/logs` -symcache_dir `.../Downloads/DrMemory-Linux-2.5.0/dr
0x00007ffde3c54080 0x0000000000000000>

and it works OK with LD_LIBRARY_PATH pointing to libunwind.so

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