Closed GeekerFeng closed 1 year ago
Can you send backtrace (from the core file) @GeekerFeng ?
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
Program received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt
(gdb) Quit (gdb) q A debugging session is active.
Inferior 1 [process 65424] will be killed.
Quit anyway? (y or n) n
Looks like the problem is in the initialization part
Thanks @GeekerFeng for the stack trace! Does it also crash when you just call bear --help
or bear -- make
?
(Sorry for these questions, but I could not reproduce this crash.)
It's okay, we can look at the problem together. phenomenon in the above picture
Thanks. This is confusing, because you wrote that the version you have is 3.1.1
(compiled from sources), but this output does not look like a 3.1.x
output. Are you sure that you have only one version installed on your machine?
Sorry, I posted the wrong picture, it's this one
The previous picture is version 3.0.20 and has the same problem
How do you manage multiple versions on the same host?
I compiled two versions and used make install to switch versions. For example, if you want to use 3.1.1, run make install under 3.1.1。 I used 3.1.1 first. After having problems, I tried again with 3.0.20
My compile command is like this cmake -DENABLE_UNIT_TESTS=OFF -DENABLE_FUNC_TESTS=OFF -DENABLE_MULTILIB=ON ..
Do you need mulilib for your project? (The flag -DENABLE_MULTILIB=ON
might be the one which causing it.)
Yes. I use TI's TDA4 chip with multi-core heterogeneous architecture code.
Your report said that x86_64
is the architecture you've been built Bear. Is any of the build tools (compiler or linker) is not a 64 bit intel executable? (Your target still can be anything, you need multilib from Bear only if your tools are mixing 64 or 32 bit executables.)
Anyway, bad::alloc
from the standard library comes, when there is not enough memory available. Or there is a library mismatch (compiled against something, and running with something else). Could you look at if any of these are the case?
Wait a minute, I can try to write a simple makefile using x86_64 gcc
Well, I am not sure then what it cause it. I can't reproduce it on my machine.
Please create a PR if you found a solution that fixes this error.
Describe the bug std::bad_alloc
To Reproduce 100%
Environment:
Additional context
linux:tiovx$/usr/local/./bin/bear --verbose -- make [14:42:07.526254, br, 23349] bear: 3.1.1 [14:42:07.526374, br, 23349] arguments: ["/usr/local/./bin/bear", "--verbose", "--", "make"] [14:42:07.526406, br, 23349] environment: ["LC_MEASUREMENT=zh_CN.UTF-8", "SSH_CONNECTION=10.179.6.136 14077 10.179.5.238 22", "LC_PAPER=zh_CN.UTF-8", "LC_MONETARY=zh_CN.UTF-8", "LANG=en_US.UTF-8", "OLDPWD=/home/samba/shoufeng.chen/Project/memdisk/DCU_ProcessorSDK_Rtos_08_05_00_11_FAW", "S_COLORS=auto", "LC_NAME=zh_CN.UTF-8", "XDG_SESSION_ID=39376", "USER=shoufeng.chen", "PWD=/home/samba/shoufeng.chen/Project/memdisk/DCU_ProcessorSDK_Rtos_08_05_00_11_FAW/tiovx", "HOME=/home/samba/shoufeng.chen", "SSH_CLIENT=10.179.6.136 14077 22", "XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop", "LC_ADDRESS=zh_CN.UTF-8", "LC_NUMERIC=zh_CN.UTF-8", "SSH_TTY=/dev/pts/1", "MAIL=/var/mail/shoufeng.chen", "TERM=xterm", "SHELL=/bin/bash", "SHLVL=1", "LANGUAGE=en_US:en", "LC_TELEPHONE=zh_CN.UTF-8", "LOGNAME=shoufeng.chen", "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1019/bus", "XDG_RUNTIME_DIR=/run/user/1019", "PATH=/home/samba/shoufeng.chen/localbin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/samba/shoufeng.chen/Shell:/usr/local/ffmpeg/bin", "LC_IDENTIFICATION=zh_CN.UTF-8", "PS1=\u:\W$", "LC_TIME=zhCN.UTF-8", "=/usr/local/./bin/bear"] [14:42:07.526418, br, 23349] sysname: Linux [14:42:07.526422, br, 23349] release: 4.15.0-192-generic [14:42:07.526440, br, 23349] version: #203-Ubuntu SMP Wed Aug 10 17:40:03 UTC 2022 [14:42:07.526443, br, 23349] machine: x86_64 [14:42:07.526466, br, 23349] arguments parsed: {program: /usr/local/./bin/bear, arguments: [{--: [make]}, {--bear-path: [/usr/local/bin/bear]}, {--library: [/usr/local/lib/bear/libexec.so]}, {--output: [compile_commands.json]}, {--verbose: []}, {--wrapper: [/usr/local/lib/bear/wrapper]}, {--wrapper-dir: [/usr/local/lib/bear/wrapper.d]}]} terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped)