1

I noticed that when I set LD_PRELOAD env. variable to libclang_rt.asan-x86_64.so pgrep hangs.

Why is this happening and how to avoid this?

senx:/$ time pgrep anything

real    0m0,022s
user    0m0,001s
sys     0m0,020s
senx:/$ export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.4
senx:/$ time pgrep anything

real    0m0,076s
user    0m0,033s
sys     0m0,027s
senx:/$ export LD_PRELOAD=/usr/lib/llvm-10/lib/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.so 
senx:/$ time pgrep anything
^C

real    0m33,077s
user    0m0,010s
sys     0m0,010s
1
  • Probably because libclang_rt.asan-x86_64.so is replacing a function used by pgrep, and that replaced function is doing something which breaks pgrep. Weird things happen when using LD_PRELOAD. That's kind of its purpose. It's up to the user (you) to only preload libs that are compatible with the programs you want to run with it. Commented Jun 1, 2021 at 11:11

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.