rizsotto / Bear

Bear is a tool that generates a compilation database for clang tooling.
GNU General Public License v3.0
4.76k stars 312 forks source link

libexec.so: Executor.cc; session is not initialized #423

Closed psych3r closed 2 years ago

psych3r commented 2 years ago

I was getting this error: ERROR: ld.so: object '/xxx/$LIB/bear/libexec.so' from LD_PRELOAD cannot be preloaded: ignored.

So I added the path to libexec.so to LD_PRELOAD

Running bear then gave this error:


libexec.so: Executor.cc; session is not initialized
libexec.so: Executor.cc; session is not initialized
bear: Running intercept failed: System call "posix_spawnp" failed for /bin/sh: Input/output error
bear: failed with: System call "posix_spawnp" failed for /bin/sh: Input/output error
rizsotto commented 2 years ago

Please read the troubleshooting page on the wiki.

psych3r commented 2 years ago

I read the troubleshooting page before posting. I thought I already pointed to libexec.so correctly and 'session is not initialized' is an issue with the library or something. Is that not the case? Did I miss something in the troubleshooting page?

rizsotto commented 2 years ago

I'm not sure at this point if that is a real issue with the libexec.so. Can you answer the issue template questions? I really need to know more about your setup in order to help you.

What smells in your usage is that you just set LD_PRELOAD variable from outside. (If I understand your description correctly.) It's better to leave this job to Bear.

If Bear knows the libexec.so file location wrong, it could be because the installation was not done properly. (The troubleshooting wiki and the INSTALL.md both explains this in details.) But if you just want to use it without fixing the installation, use bear --library <path to libexec.so> ... -- make to use the libexec.so from wherever it is installed.