rizsotto / Bear

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

ERROR: ld.so: object '/usr/local/lib/x86_64-linux-gnu/bear/libexec.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored #510

Closed MrRobbin closed 1 year ago

MrRobbin commented 1 year ago

Describe the bug I build the bear through the cmake config cmake -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu ... ... But it intall the library to the /usr/local/./lib/x86_64-linux-gnu/bear dir.

And when I run bear -- make, the log ERROR: ld.so: object '/usr/local/lib/x86_64-linux-gnu/bear/libexec.so' from LD_PRELOAD cannot be preloaded appeared.

Environment:

rizsotto commented 1 year ago

Thanks for the report @MrRobbin !

Could you send the output of the following commands: ls -l /usr/local/lib/x86_64-linux-gnu/bear and bear --help

MrRobbin commented 1 year ago

@rizsotto

➜  [/home/binluo] ls -l /usr/local/lib/x86_64-linux-gnu/bear
total 13784
-rwxrwxrwx 1 root root    37976  2月 14 13:32 libexec.so
-rwxr-xr-x 1 root root 14067240  2月 14 13:32 wrapper
drwxr-xr-x 2 root root     4096  2月 14 13:33 wrapper.d
➜  [/home/binluo] bear --help
Usage: bear <command> [--output <arg>] [--verbose] -- ...

commands
  intercept
  citnames

  --output <arg>       path of the result file (default: compile_commands.json)
  --verbose            run in verbose mode
  -- ...               command to execute

advanced options
  --append             append result to an existing output file
  --config <arg>       path of the config file
  --force-preload      force to use library preload
  --force-wrapper      force to use compiler wrappers

developer options
  --bear-path <arg>    path to the bear executable (default: /usr/local/bin/bear)
  --library <arg>      path to the preload library (default: /usr/local/lib/x86_64-linux-gnu/bear/libexec.so)
  --wrapper <arg>      path to the wrapper executable (default: /usr/local/lib/x86_64-linux-gnu/bear/wrapper)
  --wrapper-dir <arg>  path to the wrapper directory (default: /usr/local/lib/x86_64-linux-gnu/bear/wrapper.d)

query options
  --help               print help and exit
  --version            print version and exit
➜  [/home/binluo]
rizsotto commented 1 year ago

Thanks, this looks good. (Although I would expect the --library specified as /usr/local/$LIB/bear/libexec.so.)

Could you also send the output of the make --verbose -- make command too?

MrRobbin commented 1 year ago

@rizsotto Thanks for your quick response : )

➜  [/home/binluo] make --verbose -- make
make: unrecognized option '--verbose'
Usage: make [options] [target] ...
Options:
  -b, -m                      Ignored for compatibility.
  -C DIRECTORY, --directory=DIRECTORY
                              Change to DIRECTORY before doing anything.
  -d                          Print lots of debugging information.
  --debug[=FLAGS]             Print various types of debugging information.
  -e, --environment-overrides
                              Environment variables override makefiles.
  -f FILE, --file=FILE, --makefile=FILE
                              Read FILE as a makefile.
  -h, --help                  Print this message and exit.
  -i, --ignore-errors         Ignore errors from commands.
  -I DIRECTORY, --include-dir=DIRECTORY
                              Search DIRECTORY for included makefiles.
  -j [N], --jobs[=N]          Allow N jobs at once; infinite jobs with no arg.
  -k, --keep-going            Keep going when some targets can't be made.
  -l [N], --load-average[=N], --max-load[=N]
                              Don't start multiple jobs unless load is below N.
  -n, --just-print, --dry-run, --recon
                              Don't actually run any commands; just print them.
  -o FILE, --old-file=FILE, --assume-old=FILE
                              Consider FILE to be very old and don't remake it.
  -p, --print-data-base       Print make's internal database.
  -q, --question              Run no commands; exit status says if up to date.
  -r, --no-builtin-rules      Disable the built-in implicit rules.
  -R, --no-builtin-variables  Disable the built-in variable settings.
  -s, --silent, --quiet       Don't echo commands.
  -S, --no-keep-going, --stop
                              Turns off -k.
  -t, --touch                 Touch targets instead of remaking them.
  -v, --version               Print the version number of make and exit.
  -w, --print-directory       Print the current directory.
  --no-print-directory        Turn off -w, even if it was turned on implicitly.
  -W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
                              Consider FILE to be infinitely new.
  --warn-undefined-variables  Warn when an undefined variable is referenced.

Report bugs to <bug-make@gnu.org>.
rizsotto commented 1 year ago

Sorry @MrRobbin , I've meant bear --verbose -- make. :smile:

MrRobbin commented 1 year ago

@rizsotto

➜  [/home/binluo] bear --verbose -- make
[17:16:46.659978, br, 4080391] bear: 3.1.0
[17:16:46.660037, br, 4080391] arguments: ["bear", "--verbose", "--", "make"]
[17:16:46.660085, br, 4080391] environment: ["USER=binluo12", "LOGNAME=binluo12", "HOME=/home/binluo12", "PATH=/home/binluo12/dk_lnx/depot/dk/lnx/bin:/opt/p4v/p4v-2022.3.2370885/bin/:/home/binluo12/Documents/drivers/drivers/xgl/icd/imported/llvm-project/llvm/build/bin/:~/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin", "SHELL=/bin/zsh", "TERM=xterm", "DISPLAY=:0", "XDG_SESSION_ID=49", "XDG_RUNTIME_DIR=/run/user/1000", "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus", "XDG_SESSION_TYPE=tty", "XDG_SESSION_CLASS=user", "MOTD_SHOWN=pam", "LANG=en_US.UTF-8", "LC_NUMERIC=zh_CN.UTF-8", "LC_TIME=zh_CN.UTF-8", "LC_MONETARY=zh_CN.UTF-8", "LC_PAPER=zh_CN.UTF-8", "LC_NAME=zh_CN.UTF-8", "LC_ADDRESS=zh_CN.UTF-8", "LC_TELEPHONE=zh_CN.UTF-8", "LC_MEASUREMENT=zh_CN.UTF-8", "LC_IDENTIFICATION=zh_CN.UTF-8", "SSH_CLIENT=10.65.158.1 60806 22", "SSH_CONNECTION=10.65.158.1 60806 10.69.43.201 22", "SSH_TTY=/dev/pts/0", "SHLVL=1", "PWD=/home/binluo12", "OLDPWD=/home/binluo12/Downloads/Bear/build", "ZSH=/home/binluo12/.oh-my-zsh", "PAGER=less", "LESS=-R", "LSCOLORS=Gxfxcxdxbxegedabagacad", "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:", "VULKAN_SDK_PATH=/home/binluo12/Downloads/1.3.239.0", "_=/usr/local/bin/bear"]
[17:16:46.660101, br, 4080391] sysname: Linux
[17:16:46.660104, br, 4080391] release: 5.15.0-47-generic
[17:16:46.660107, br, 4080391] version: #51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022
[17:16:46.660112, br, 4080391] machine: x86_64
[17:16:46.660124, br, 4080391] arguments parsed: {program: bear, arguments: [{--: [make]}, {--bear-path: [/usr/local/bin/bear]}, {--library: [/usr/local/lib/x86_64-linux-gnu/bear/libexec.so]}, {--output: [compile_commands.json]}, {--verbose: []}, {--wrapper: [/usr/local/lib/x86_64-linux-gnu/bear/wrapper]}, {--wrapper-dir: [/usr/local/lib/x86_64-linux-gnu/bear/wrapper.d]}]}
[17:16:46.660477, br, 4080391] Process spawned. [pid: 4080392, command: ["/usr/local/bin/bear", "intercept", "--library", "/usr/local/lib/x86_64-linux-gnu/bear/libexec.so", "--wrapper", "/usr/local/lib/x86_64-linux-gnu/bear/wrapper", "--wrapper-dir", "/usr/local/lib/x86_64-linux-gnu/bear/wrapper.d", "--output", "compile_commands.events.json", "--verbose", "--", "make"]]
[17:16:46.660498, br, 4080391] Process wait requested. [pid: 4080392]
[17:16:46.662154, br, 4080392] bear: 3.1.0
[17:16:46.662206, br, 4080392] arguments: ["/usr/local/bin/bear", "intercept", "--library", "/usr/local/lib/x86_64-linux-gnu/bear/libexec.so", "--wrapper", "/usr/local/lib/x86_64-linux-gnu/bear/wrapper", "--wrapper-dir", "/usr/local/lib/x86_64-linux-gnu/bear/wrapper.d", "--output", "compile_commands.events.json", "--verbose", "--", "make"]
[17:16:46.662251, br, 4080392] environment: ["DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus", "DISPLAY=:0", "HOME=/home/binluo12", "LANG=en_US.UTF-8", "LC_ADDRESS=zh_CN.UTF-8", "LC_IDENTIFICATION=zh_CN.UTF-8", "LC_MEASUREMENT=zh_CN.UTF-8", "LC_MONETARY=zh_CN.UTF-8", "LC_NAME=zh_CN.UTF-8", "LC_NUMERIC=zh_CN.UTF-8", "LC_PAPER=zh_CN.UTF-8", "LC_TELEPHONE=zh_CN.UTF-8", "LC_TIME=zh_CN.UTF-8", "LESS=-R", "LOGNAME=binluo12", "LSCOLORS=Gxfxcxdxbxegedabagacad", "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:", "MOTD_SHOWN=pam", "OLDPWD=/home/binluo12/Downloads/Bear/build", "PAGER=less", "PATH=/home/binluo12/dk_lnx/depot/dk/lnx/bin:/opt/p4v/p4v-2022.3.2370885/bin/:/home/binluo12/Documents/drivers/drivers/xgl/icd/imported/llvm-project/llvm/build/bin/:~/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin", "PWD=/home/binluo12", "SHELL=/bin/zsh", "SHLVL=1", "SSH_CLIENT=10.65.158.1 60806 22", "SSH_CONNECTION=10.65.158.1 60806 10.69.43.201 22", "SSH_TTY=/dev/pts/0", "TERM=xterm", "USER=binluo12", "VULKAN_SDK_PATH=/home/binluo12/Downloads/1.3.239.0", "XDG_RUNTIME_DIR=/run/user/1000", "XDG_SESSION_CLASS=user", "XDG_SESSION_ID=49", "XDG_SESSION_TYPE=tty", "ZSH=/home/binluo12/.oh-my-zsh", "_=/usr/local/bin/bear"]
[17:16:46.662266, br, 4080392] sysname: Linux
[17:16:46.662270, br, 4080392] release: 5.15.0-47-generic
[17:16:46.662273, br, 4080392] version: #51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022
[17:16:46.662275, br, 4080392] machine: x86_64
[17:16:46.662285, br, 4080392] arguments parsed: {program: intercept, arguments: [{--: [make]}, {--library: [/usr/local/lib/x86_64-linux-gnu/bear/libexec.so]}, {--output: [compile_commands.events.json]}, {--verbose: []}, {--wrapper: [/usr/local/lib/x86_64-linux-gnu/bear/wrapper]}, {--wrapper-dir: [/usr/local/lib/x86_64-linux-gnu/bear/wrapper.d]}, {command: [intercept]}]}
[17:16:46.662342, br, 4080392] Created library preload session. [library=/usr/local/lib/x86_64-linux-gnu/bear/libexec.so, executor=/usr/local/lib/x86_64-linux-gnu/bear/wrapper]
[17:16:46.663098, br, 4080392] Running gRPC server. dns:///localhost:43517
[17:16:46.663257, br, 4080392] Process spawned. [pid: 4080397, command: ["/usr/local/lib/x86_64-linux-gnu/bear/wrapper", "--destination", "dns:///localhost:43517", "--verbose", "--execute", "/home/binluo12/dk_lnx/depot/dk/lnx/bin/make", "--", "make"]]
[17:16:46.663276, br, 4080392] Process wait requested. [pid: 4080397]
[17:16:46.664301, el, 4080397] lib.cc; on_load
[17:16:46.664644, wr, 4080397, ppid: 4080392] wrapper: 3.1.0
[17:16:46.664654, wr, 4080397, ppid: 4080392] arguments: ["/usr/local/lib/x86_64-linux-gnu/bear/wrapper", "--destination", "dns:///localhost:43517", "--verbose", "--execute", "/home/binluo12/dk_lnx/depot/dk/lnx/bin/make", "--", "make"]
[17:16:46.664688, wr, 4080397, ppid: 4080392] environment: ["DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus", "DISPLAY=:0", "HOME=/home/binluo12", "INTERCEPT_REPORT_COMMAND=/usr/local/lib/x86_64-linux-gnu/bear/wrapper", "INTERCEPT_REPORT_DESTINATION=dns:///localhost:43517", "INTERCEPT_VERBOSE=true", "LANG=en_US.UTF-8", "LC_ADDRESS=zh_CN.UTF-8", "LC_IDENTIFICATION=zh_CN.UTF-8", "LC_MEASUREMENT=zh_CN.UTF-8", "LC_MONETARY=zh_CN.UTF-8", "LC_NAME=zh_CN.UTF-8", "LC_NUMERIC=zh_CN.UTF-8", "LC_PAPER=zh_CN.UTF-8", "LC_TELEPHONE=zh_CN.UTF-8", "LC_TIME=zh_CN.UTF-8", "LD_PRELOAD=/usr/local/lib/x86_64-linux-gnu/bear/libexec.so", "LESS=-R", "LOGNAME=binluo12", "LSCOLORS=Gxfxcxdxbxegedabagacad", "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:", "MOTD_SHOWN=pam", "OLDPWD=/home/binluo12/Downloads/Bear/build", "PAGER=less", "PATH=/home/binluo12/dk_lnx/depot/dk/lnx/bin:/opt/p4v/p4v-2022.3.2370885/bin/:/home/binluo12/Documents/drivers/drivers/xgl/icd/imported/llvm-project/llvm/build/bin/:~/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin", "PWD=/home/binluo12", "SHELL=/bin/zsh", "SHLVL=1", "SSH_CLIENT=10.65.158.1 60806 22", "SSH_CONNECTION=10.65.158.1 60806 10.69.43.201 22", "SSH_TTY=/dev/pts/0", "TERM=xterm", "USER=binluo12", "VULKAN_SDK_PATH=/home/binluo12/Downloads/1.3.239.0", "XDG_RUNTIME_DIR=/run/user/1000", "XDG_SESSION_CLASS=user", "XDG_SESSION_ID=49", "XDG_SESSION_TYPE=tty", "ZSH=/home/binluo12/.oh-my-zsh", "_=/usr/local/bin/bear"]
[17:16:46.664715, wr, 4080397, ppid: 4080392] arguments parsed: {program: /usr/local/lib/x86_64-linux-gnu/bear/wrapper, arguments: [{--: [make]}, {--destination: [dns:///localhost:43517]}, {--execute: [/home/binluo12/dk_lnx/depot/dk/lnx/bin/make]}, {--verbose: []}]}
[17:16:46.665097, wr, 4080397, ppid: 4080392] gRPC call requested: supervise::Supervisor::Resolve
[17:16:46.666799, br, 4080392] trying to resolve for library: /home/binluo12/dk_lnx/depot/dk/lnx/bin/make
[17:16:46.666939, wr, 4080397, ppid: 4080392] gRPC call [Resolve] finished: true
[17:16:46.667102, wr, 4080397, ppid: 4080392] Process spawned. [pid: 4080405, command: ["make"]]
[17:16:46.667115, wr, 4080397, ppid: 4080392] gRPC call requested: supervise::Interceptor::Register
ERROR: ld.so: object '/usr/local/lib/x86_64-linux-gnu/bear/libexec.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
make: *** No targets specified and no makefile found.  Stop.
[17:16:46.668391, wr, 4080397, ppid: 4080392] gRPC call [Register] finished: true
[17:16:46.668417, wr, 4080397, ppid: 4080392] Process wait requested. [pid: 4080405]
[17:16:46.668423, wr, 4080397, ppid: 4080392] Process wait request: done. [pid: 4080405]
[17:16:46.668425, wr, 4080397, ppid: 4080392] gRPC call requested: supervise::Interceptor::Register
[17:16:46.668571, wr, 4080397, ppid: 4080392] gRPC call [Register] finished: true
[17:16:46.668667, wr, 4080397, ppid: 4080392] succeeded with: 2
[17:16:46.668688, el, 4080397] lib.cc; on_unload
[17:16:46.669003, br, 4080392] Process wait request: done. [pid: 4080397]
[17:16:46.669023, br, 4080392] Running command. [Exited with 2]
[17:16:46.669030, br, 4080392] Stopping gRPC server.
[17:16:46.669220, br, 4080392] succeeded with: 2
[17:16:46.669625, br, 4080391] Process wait request: done. [pid: 4080392]
[17:16:46.669638, br, 4080391] Running intercept finished. [Exited with 2]
[17:16:46.669737, br, 4080391] Process spawned. [pid: 4080406, command: ["/usr/local/bin/bear", "citnames", "--input", "compile_commands.events.json", "--output", "compile_commands.json", "--run-checks", "--verbose"]]
[17:16:46.669749, br, 4080391] Process wait requested. [pid: 4080406]
[17:16:46.670860, br, 4080406] bear: 3.1.0
[17:16:46.670890, br, 4080406] arguments: ["/usr/local/bin/bear", "citnames", "--input", "compile_commands.events.json", "--output", "compile_commands.json", "--run-checks", "--verbose"]
[17:16:46.670935, br, 4080406] environment: ["DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus", "DISPLAY=:0", "HOME=/home/binluo12", "LANG=en_US.UTF-8", "LC_ADDRESS=zh_CN.UTF-8", "LC_IDENTIFICATION=zh_CN.UTF-8", "LC_MEASUREMENT=zh_CN.UTF-8", "LC_MONETARY=zh_CN.UTF-8", "LC_NAME=zh_CN.UTF-8", "LC_NUMERIC=zh_CN.UTF-8", "LC_PAPER=zh_CN.UTF-8", "LC_TELEPHONE=zh_CN.UTF-8", "LC_TIME=zh_CN.UTF-8", "LESS=-R", "LOGNAME=binluo12", "LSCOLORS=Gxfxcxdxbxegedabagacad", "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:", "MOTD_SHOWN=pam", "OLDPWD=/home/binluo12/Downloads/Bear/build", "PAGER=less", "PATH=/home/binluo12/dk_lnx/depot/dk/lnx/bin:/opt/p4v/p4v-2022.3.2370885/bin/:/home/binluo12/Documents/drivers/drivers/xgl/icd/imported/llvm-project/llvm/build/bin/:~/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin", "PWD=/home/binluo12", "SHELL=/bin/zsh", "SHLVL=1", "SSH_CLIENT=10.65.158.1 60806 22", "SSH_CONNECTION=10.65.158.1 60806 10.69.43.201 22", "SSH_TTY=/dev/pts/0", "TERM=xterm", "USER=binluo12", "VULKAN_SDK_PATH=/home/binluo12/Downloads/1.3.239.0", "XDG_RUNTIME_DIR=/run/user/1000", "XDG_SESSION_CLASS=user", "XDG_SESSION_ID=49", "XDG_SESSION_TYPE=tty", "ZSH=/home/binluo12/.oh-my-zsh", "_=/usr/local/bin/bear"]
[17:16:46.670949, br, 4080406] sysname: Linux
[17:16:46.670951, br, 4080406] release: 5.15.0-47-generic
[17:16:46.670952, br, 4080406] version: #51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022
[17:16:46.670953, br, 4080406] machine: x86_64
[17:16:46.670960, br, 4080406] arguments parsed: {program: citnames, arguments: [{--input: [compile_commands.events.json]}, {--output: [compile_commands.json]}, {--run-checks: []}, {--verbose: []}, {command: [citnames]}]}
[17:16:46.671014, br, 4080406] Configuration: {"compilation":null,"output":{"content":{"duplicate_filter_fields":"file_output","include_only_existing_source":true},"format":{"command_as_array":true,"drop_output_field":false}}}
[17:16:46.671525, br, 4080406] [pid: 4080405] execution: {"executable":"/home/binluo12/dk_lnx/depot/dk/lnx/bin/make","arguments":["make"],"workingDir":"/home/binluo12","environment":{"SSH_CLIENT":"10.65.158.1 60806 22","LC_MEASUREMENT":"zh_CN.UTF-8","LC_IDENTIFICATION":"zh_CN.UTF-8","SSH_CONNECTION":"10.65.158.1 60806 10.69.43.201 22","LC_NUMERIC":"zh_CN.UTF-8","_":"/usr/local/bin/bear","HOME":"/home/binluo12","SHELL":"/bin/zsh","PATH":"/home/binluo12/dk_lnx/depot/dk/lnx/bin:/opt/p4v/p4v-2022.3.2370885/bin/:/home/binluo12/Documents/drivers/drivers/xgl/icd/imported/llvm-project/llvm/build/bin/:~/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin","LESS":"-R","LSCOLORS":"Gxfxcxdxbxegedabagacad","USER":"binluo12","LOGNAME":"binluo12","SHLVL":"1","LANG":"en_US.UTF-8","INTERCEPT_VERBOSE":"true","XDG_SESSION_TYPE":"tty","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1000/bus","DISPLAY":":0","LC_TIME":"zh_CN.UTF-8","LC_ADDRESS":"zh_CN.UTF-8","XDG_SESSION_ID":"49","LC_NAME":"zh_CN.UTF-8","INTERCEPT_REPORT_DESTINATION":"dns:///localhost:43517","INTERCEPT_REPORT_COMMAND":"/usr/local/lib/x86_64-linux-gnu/bear/wrapper","MOTD_SHOWN":"pam","XDG_RUNTIME_DIR":"/run/user/1000","LC_PAPER":"zh_CN.UTF-8","PWD":"/home/binluo12","LC_MONETARY":"zh_CN.UTF-8","LS_COLORS":"rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:","TERM":"xterm","PAGER":"less","LC_TELEPHONE":"zh_CN.UTF-8","ZSH":"/home/binluo12/.oh-my-zsh","VULKAN_SDK_PATH":"/home/binluo12/Downloads/1.3.239.0","XDG_SESSION_CLASS":"user","OLDPWD":"/home/binluo12/Downloads/Bear/build","SSH_TTY":"/dev/pts/0","LD_PRELOAD":"/usr/local/lib/x86_64-linux-gnu/bear/libexec.so"}}
[17:16:46.671770, br, 4080406] [pid: 4080405] recognition failed: No tools recognize this execution.
[17:16:46.671807, br, 4080406] compilation entries created. [size: 0]
[17:16:46.671812, br, 4080406] compilation entries to output. [size: 0]
[17:16:46.671880, br, 4080406] compilation entries written. [size: 0]
[17:16:46.671886, br, 4080406] succeeded with: 0
[17:16:46.672039, br, 4080391] Process wait request: done. [pid: 4080406]
[17:16:46.672049, br, 4080391] Running citnames finished. [Exited with 0]
[17:16:46.672304, br, 4080391] succeeded with: 2
rizsotto commented 1 year ago

Is there any chance that the program make is a 32 bit executable? (Can check with file $(which make).)

MrRobbin commented 1 year ago

@rizsotto Yes, it is a 32 bit make. I recently use my company's build tools. And found this problem.

make: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.5, not stripped
rizsotto commented 1 year ago

Ok then. The error message comes from the fact that we want to preload a 64 bit library into a 32 bit process memory.

In theory Bear can work with multilib, but I don't test against this scenario. (Documented here, but latest feedback was that it's not really working.)

If your project is not using a 32 bit compiler, then using a 64 bit make won't change much of the result, but will fix this problem for Bear.