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

ERROR: ld.so: object 'ldlogger.so` from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored #3858

Closed
dilyanpalauzov opened this issue Mar 13, 2023 · 6 comments
Labels
analyzer 📈 Related to the analyze commands (analysis driver) bug 🐛 config ⚙️ dev env ⛑️ Development environment

Comments

@dilyanpalauzov
Copy link
Contributor

I compile the code with clang++ -m32. I have installed CodeChecher from source, as described at https://codechecker.readthedocs.io/en/latest/#linux (make venv && make package). I use python 3.11.2 on Fedora (Windows with WSL2).

Running CodeChecker log -o x -b make prints a lot of ERROR: ld.so: object 'ldlogger.so from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored`.

The ldlogger.so library is in the analyzer/tools/build-logger/build/lib/ i386, i486, i586, i686 , x86_64 directories and in the build/CodeChecker/ld_logger/lib i386, i486, i586, i686 and x64_84 directories.

The the -o file contains just [].

How can I debug why ld_logger.so cannot be loaded?

The same happens when CodeChecker is on PATH, and virtenv is not executed, and when CodeChecker loaded, after the virtenv is activated.

@whisperity whisperity added bug 🐛 dev env ⛑️ Development environment analyzer 📈 Related to the analyze commands (analysis driver) config ⚙️ labels Mar 14, 2023
@dilyanpalauzov
Copy link
Contributor Author

Today the problem was gone. No idea why.

@dilyanpalauzov
Copy link
Contributor Author

This happens again. I download the code from git in /git/codechecker, then do

cd /git/codechecker
make venv
. venv/bin/activate
make
… wait, wait, wait …

Without quiting the virtual environment I change to directory U with these files:

Makefile:

x:
        gcc -o x x.c

clean:
        rm x

and x.c:

#include <stdio.h>

int main() {
  printf("Hello World!\n");
}

Then I call /git/codechecker/build/CodeChecker/bin/CodeChecker log -b make -o j. The output is

[INFO 2023-05-25 15:55] - Starting build...
[INFO 2023-05-25 15:55] - Using CodeChecker ld-logger.
ERROR: ld.so: object 'ldlogger.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'ldlogger.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
gcc -o x x.c
ERROR: ld.so: object 'ldlogger.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'ldlogger.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'ldlogger.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'ldlogger.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'ldlogger.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
[INFO 2023-05-25 15:55] - Build finished successfully.

The output of calling strace -fs2048 /git/codechecker/build/CodeChecker/bin/CodeChecker log -b make -o j is attached: cc-strace.txt.

As can be seen on lines 9704-9735 the system tries to load ld_logger.so from /git/codechecker/build/CodeChecker/ld_logger/lib/{,i386,i486,i586,i686,x86_64}/ldlogger.so and eventually finds it. The same logic is applied also on lines 9776-9806.

On lines 10179-10209 the logic to find ldlogger.so is different:

  • /git/codechecker/build/CodeChecker/ld_logger/lib/glibc-hwcaps/x86-64-v3/ldlogger.so
  • /git/codechecker/build/CodeChecker/ld_logger/lib/glibc-hwcaps/x86-64-v2/ldlogger.so
  • /git/codechecker/build/CodeChecker/ld_logger/lib/ger.so
  • /lib64/glibc-hwcaps/x86-64-v3/ldlogger.so
  • /lib64/glibc-hwcaps/x86-64-v2/ldlogger.so
  • /lib64/ldlogger.so
  • /usr/lib64/glibc-hwcaps/x86-64-v3/ldlogger.so
  • /usr/lib64/glibc-hwcaps/x86-64-v2/ldlogger.so
  • /usr/lib64/ldlogger.so

Since /git/codechecker/build/CodeChecker/ld_logger/lib/{i386,i486,i586,i686,x86_64}/ldlogger.so are not inspected, the search fails an the system logs ERROR: ld.so: object 'ldlogger.so' from LD_PRELOAD cannot be preloaded (cann ot open shared object file): ignored.

So why does the system not search for ldlogger.so where it is supposed to search?

@timskovjacobsen
Copy link

I'm experiencing the same problem.

@bruntib
Copy link
Contributor

bruntib commented Jun 19, 2023

A related pull request has been merged today: #3919. Could you check, if this solves the issue? Thank you!

@timskovjacobsen
Copy link

A related pull request has been merged today: #3919. Could you check, if this solves the issue? Thank you!

This merge seems to have fixed the problem. Thanks.

@bruntib
Copy link
Contributor

bruntib commented Jun 21, 2023

Thanks, in this case I close this ticket. Fixed by #3919.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer 📈 Related to the analyze commands (analysis driver) bug 🐛 config ⚙️ dev env ⛑️ Development environment
Projects
None yet
Development

No branches or pull requests

4 participants