-
Notifications
You must be signed in to change notification settings - Fork 879
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
基于 braft的程序一启动就core,麻烦帮看看 从哪里找找原因 #20
Comments
os和编译器分别是什么 |
centos 7 x86_64 |
centos 7应该是支持的,检查下mutex的生命周期是否正确吧 |
debug试了下,进入main之前就core了,好奇怪,难道是编译的问题。。 |
贴一下完整的栈吧,编译brpc的时候也把debug_symbol打开. |
centos 7 x86_64, gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) |
我重新编译了一次,现在执行报这个错误 需要增加哪些编译选项 |
看上去是编译的时候同时链接了静态库和动态库,这个是你的程序编译出错还是braft的demo出错? |
@wind-zhang 可以考虑用bazel.build来编译,非常方便。 |
非常感谢各位的回复,我这边编译的时候是连接了动态库的,运行的时候报的,后面改为静态连接 运行就没问题了。 |
@wind-zhang 并不是动态链接不行,而是你同时链接了动态和静态链接库,全局变量是一套但会初始化两次,这个错误行为被gflags侦测到了(因为所有gflags都是全局变量,必须检查这点) |
@jamesge 好的,我整理一下。 |
warning: core file may not match specified executable file.
[New LWP 12604]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `./demo_server.bin'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f1d2ae23c16 in pthread_mutex_lock_impl (mutex=0x11dfdc0) at src/bthread/mutex.cpp:545
545 return sys_pthread_mutex_lock(mutex);
Missing separate debuginfos, use: debuginfo-install bzip2-libs-1.0.6-13.el7.x86_64 gflags-2.1.1-6.el7.x86_64 glibc-2.17-196.el7_4.2.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.13.2-12.el7_2.x86_64 leveldb-1.12.0-11.el7.x86_64 libcom_err-1.42.9-7.el7.x86_64 libgcc-4.8.5-4.el7.x86_64 libselinux-2.2.2-6.el7.x86_64 libstdc++-4.8.5-4.el7.x86_64 libuuid-2.23.2-26.el7_2.2.x86_64 openssl-libs-1.0.1e-51.el7_2.7.x86_64 pcre-8.32-15.el7_2.1.x86_64 protobuf-2.5.0-8.el7.x86_64 protobuf-compiler-2.5.0-8.el7.x86_64 snappy-1.1.0-3.el7.x86_64 xz-libs-5.1.2-12alpha.el7.x86_64 zlib-1.2.7-15.el7.x86_64
(gdb) where
#0 0x00007f1d2ae23c16 in pthread_mutex_lock_impl (mutex=0x11dfdc0) at src/bthread/mutex.cpp:545
#1 pthread_mutex_lock (__mutex=0x11dfdc0) at src/bthread/mutex.cpp:803
The text was updated successfully, but these errors were encountered: