Allenhe123 / cyberRT-x86

将Apollo cyberRT移植到docker外面
Apache License 2.0
11 stars 9 forks source link

Segmentation fault for running examples/talker #2

Closed hezhiye closed 2 years ago

hezhiye commented 2 years ago

Hi: when i use cyberRT-x86 to build examples, i meet Segmentation fault for running examples/talker. do you encounter such problems?

$ gdb talker GNU gdb (Ubuntu 10.2-0ubuntu1~20.04~1) 10.2 Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: https://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/.

For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from talker... (gdb) r Starting program: /home/zhiye/cyberRT-x86/build/talker warning: the debug information found in "/lib64/ld-2.31.so" does not match "/lib64/ld-linux-x86-64.so.2" (CRC mismatch).

[Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault. 0x00007ffff6af2c44 in std::__cxx11::basic_string<char, std::char_traits, std::allocator >::empty() const () from /lib/x86_64-linux-gnu/libstdc++.so.6 (gdb) bt

0 0x00007ffff6af2c44 in std::__cxx11::basic_string<char, std::char_traits, std::allocator >::empty() const ()

from /lib/x86_64-linux-gnu/libstdc++.so.6

1 0x00007ffff7ed7f02 in google::LogMessage::Init(char const, int, int, void (google::LogMessage::)()) ()

from /home/zhiye/cyberRT-x86/build/libcyber.so

2 0x00007ffff7ed774b in google::LogMessage::LogMessage(char const*, int, int) () from /home/zhiye/cyberRT-x86/build/libcyber.so

3 0x00007ffff7c2f185 in apollo::cyber::class_loader::utility::RegisterClass<Circle, Base> (class_name="Circle", base_class_name="Base")

at /home/zhiye/cyberRT-x86/cyber/class_loader/utility/class_loader_utility.h:80

4 0x00007ffff7c2e9f7 in (anonymous namespace)::ProxyType0::ProxyType0 (this=0x7ffff7fb23c3 <(anonymous namespace)::g_register_class_0>)

at /home/zhiye/cyberRT-x86/cyber/class_loader/test/plugin1.cc:42

5 0x00007ffff7c2ee37 in static_initialization_and_destruction_0 (initialize_p=1, __priority=65535)

at /home/zhiye/cyberRT-x86/cyber/class_loader/test/plugin1.cc
hezhiye commented 2 years ago

fix this problem by adding -DBUILD_SHARED_LIBS=ON in cmake cmd for both glog and gflag. But i do not know why.