Bug 513131 - Failure to attach to a process
Summary: Failure to attach to a process
Status: REPORTED
Alias: None
Product: Heaptrack
Classification: Applications
Component: general (other bugs)
Version First Reported In: 1.2.0
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Milian Wolff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-09 16:40 UTC by dev
Modified: 2025-12-09 16:40 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dev 2025-12-09 16:40:19 UTC
I'm unable to attach to a Rust process using `sudo heaptrack -p <PID>` with the following error:
```
heaptrack output will be written to "/home/<user>/heaptrack.<executable>.<pid>.zst"
injecting heaptrack into application via GDB, this might take some time...
syntax error in expression, near `__libc_dlopen_mode("/usr/lib/heaptrack/libheaptrack_inject.so", 0x80000000 | 0x002)'.
syntax error in expression, near `heaptrack_inject("/tmp/heaptrack_fifo<pid>")'.
injection finished
```
However after "injection finished", the heaptrack file is created, but remains empty forever.
I have tried attaching to an instance of vim and that did produce a non-empty trace.
I am running Debian 11 (bullseye) with heaptrack 1.2.0 from the debian repository.
Since the error appears to fail when using GDB to invoke a glibc function, I checked using ldd that the binary in question is linking libc.so.6 and that libc.so.6 includes symbol __libc_dlopen_mode@@GLIBC_PRIVATE.

Unfortunately the only mention of this error I found online is https://kirshatrov.com/posts/finding-memory-leak-in-cgo where the author gave up on using heaptrack after encountering the error.