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 on any malloc call in instrumented application #210

Closed
derchr opened this issue Mar 10, 2022 · 2 comments · Fixed by #211
Closed

Crash on any malloc call in instrumented application #210

derchr opened this issue Mar 10, 2022 · 2 comments · Fixed by #211

Comments

@derchr
Copy link

derchr commented Mar 10, 2022

Bug description
Running QBDIPreload on applications that eventually call malloc results in a crash. As virtually any application calls malloc once on execution time, I cannot instrument any application that is more complex than hello world. After adding a single malloc call in a hello world example, this crash also occurs.

Bug log
Crash message:

malloc(): unaligned tcache chunk detected
[1]    2888922 IOT instruction (core dumped)  LD_BIND_NOW=1 LD_PRELOAD=./libtracer_preload_c.so grep

Minimal code to reproduce the bug
Run the official QBDIPreload c example with for example grep or something similar:
LD_BIND_NOW=1 LD_PRELOAD=./libtracer_preload_c.so grep

Specific command to reproduce the bug
LD_BIND_NOW=1 LD_PRELOAD=./libtracer_preload_c.so grep

Version (please complete the following information):

  • OS: Manjaro Linux (derivative of Arch Linux)
  • Architecture: x64
  • QBDI version: current dev-next (48bae1d) and also the official binary at version 0.8.0

Additional context
I have a very similar problem when trying to instrument an application with DynamoRIO. There almost all applications crash with a SEGV even in the most trivial examples.
After some testing I found out that this could have been a result of the recent update of the Arch Linux glibc package from version glibc-2.33-5 to glibc-2.35-2.
So it could be that this issue is reproducible on any recent Arch Linux installs.

@nsurbay
Copy link
Member

nsurbay commented Mar 10, 2022

Hello,

I think it may be the name of the libc. Before, the realname of the libc is libc-2.xx.so but it's now libc.so.6.
QBDI should not instrument the libc, as malloc isn't reentrant. We will update QBDIPreload to blacklist the new name.

Thank for the issue.

@derchr
Copy link
Author

derchr commented Mar 10, 2022

Just tested the fix and now everything works.

Thank you so much for the quick fix!

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

Successfully merging a pull request may close this issue.

2 participants