You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/03/11 05:05:57 UTC

[GitHub] [incubator-brpc] tabokie opened a new issue #1059: SIGSEGV with static build

tabokie opened a new issue #1059: SIGSEGV with static build
URL: https://github.com/apache/incubator-brpc/issues/1059
 
 
   **Describe the bug (描述bug)**
   Program gets SIGSEGV when statically built.
   CMakeList snippet:
   ```
   add_library(TxService STATIC ${TXSERVICE_SRC})
   target_link_libraries(TxService PUBLIC "-static"
                                   ssl Folly::folly fmt::fmt FugueRedis
                                   brpc-static cassandra_static
                                   protobuf::libprotobuf
                                   leveldb::leveldb glog::glog)
   # hacky way to include brpc headers (and proto)
   target_include_directories(TxService PUBLIC ${TXSERVICE_INCLUDE_DIR} ${RAPIDJSON_INCLUDE_DIRS} ${PROTOBUF_INCLUDE_DIRS} ${brpc_BINARY_DIR} ${brpc_SOURCE_DIR}/src)
   ```
   Works fine when not explicitly use "-static" directive.
   
   **To Reproduce (复现方法)**
   
   
   **Expected behavior (期望行为)**
   
   
   **Versions (各种版本)**
   OS: Ubuntu 7.4.0-1ubuntu1~18.04.1
   Compiler: g++ 7.4.0
   brpc: https://github.com/apache/incubator-brpc/tree/f8c188a7a5186c2d43a20735ad175a32b39788a3
   protobuf: 3.11.3
   glibc: Ubuntu GLIBC 2.27-3ubuntu1
   
   **Additional context/screenshots (更多上下文/截图)**
   bt:
   ```
   #0  0x0000000000dd5bff in fatal_error ()
   #1  0x0000000000dd5d3a in _dl_signal_error ()
   #2  0x0000000000dd4e6d in _dl_sym ()
   #3  0x000000000063c98d in bthread::init_sys_mutex_lock ()
       at /home/tabokie/TxService/dep/incubator-brpc/src/bthread/mutex.cpp:411
   #4  0x0000000000c472f7 in __pthread_once_slow (
       once_control=0x162dfa0 <bthread::init_sys_mutex_lock_once>, init_routine=0x63c96f <bthread::init_sys_mutex_lock()>)
       at pthread_once.c:116
   #5  0x0000000000c473b5 in __pthread_once (
       once_control=once_control@entry=0x162dfa0 <bthread::init_sys_mutex_lock_once>, 
       init_routine=init_routine@entry=0x63c96f <bthread::init_sys_mutex_lock()>) at pthread_once.c:143
   #6  0x000000000063c930 in bthread::first_sys_pthread_mutex_lock (mutex=0x1f61da0 <object_mutex>)
       at /home/tabokie/TxService/dep/incubator-brpc/src/bthread/mutex.cpp:424
   #7  0x000000000063ceff in bthread::pthread_mutex_lock_impl (
       mutex=0x1f61da0 <object_mutex>)
       at /home/tabokie/TxService/dep/incubator-brpc/src/bthread/mutex.cpp:526
   #8  pthread_mutex_lock (__mutex=0x1f61da0 <object_mutex>)
       at /home/tabokie/TxService/dep/incubator-brpc/src/bthread/mutex.cpp:812
   #9  0x0000000000d02935 in __register_frame_info_bases.part.6
       ()
   #10 0x0000000000401a9d in frame_dummy ()
   #11 0x0000000000000001 in ?? ()
   #12 0x0000000000d03c1c in __libc_csu_init ()
   #13 0x0000000000d03377 in __libc_start_main ()
   #14 0x00000000004019ba in _start ()
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] tabokie commented on issue #1059: SIGSEGV with static build

Posted by GitBox <gi...@apache.org>.
tabokie commented on issue #1059:
URL: https://github.com/apache/incubator-brpc/issues/1059#issuecomment-672462256


   @sky91 As I remember, we got rid of `-static` by explicit specifying all the library in their static versions. I don't currently have access to the code right now, will post the detail some time later.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] sky91 commented on issue #1059: SIGSEGV with static build

Posted by GitBox <gi...@apache.org>.
sky91 commented on issue #1059:
URL: https://github.com/apache/incubator-brpc/issues/1059#issuecomment-671956726


   Same problem. Any solution?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] tabokie edited a comment on issue #1059: SIGSEGV with static build

Posted by GitBox <gi...@apache.org>.
tabokie edited a comment on issue #1059:
URL: https://github.com/apache/incubator-brpc/issues/1059#issuecomment-672462256


   @sky91 As I remember, we got rid of `-static` by explicitly specifying all the libraries in their static versions. I don't currently have access to the code right now, will post the detail some time later.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org