Ubuntu 18中的服务崩溃问题

问题描述 投票:0回答:1

我有一个静态库,当我尝试从servicemain中的静态库创建类的对象时,服务启动时崩溃。当我禁用调用静态库类时,服务可以正常工作。

我正在使用Poco库作为服务处理程序,在崩溃转储中,我们仅获得Poco库的调用堆栈,而不是静态库的单个跟踪,因此无法找到根本原因。代码在Ubuntu 16和14上运行良好。

下面是堆栈跟踪。

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007f799927f801 in __GI_abort () at abort.c:79
#2  0x00007f799e7cc755 in Poco::SignalHandler::handleSignal(int) ()
   from /lib/libPocoFoundation.so.60
#3  <signal handler called>
#4  0x00007f799bb09b40 in std::string::clear() () from /lib/libstdc++.so.6
#5  0x0000563554610794 in Poco::Path::clear (this=0x7fffabfdd3e0) at src/Path.cpp:597
#6  0x00007f799e7bc5e1 in Poco::Path::parseUnix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /lib/libPocoFoundation.so.60
#7  0x00007f799e7bc889 in Poco::Path::assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /lib/libPocoFoundation.so.60
#8  0x00007f799e7bc916 in Poco::Path::Path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /lib/libPocoFoundation.so.60
#9  0x00007f799e483e56 in Poco::Util::Application::getApplicationPath(Poco::Path&) const ()
   from /lib/libPocoUtil.so.60
#10 0x00007f799e48565c in Poco::Util::Application::init() () from /lib/libPocoUtil.so.60
#11 0x00007f799e49708c in Poco::Util::ServerApplication::run(int, char**) ()
   from /lib/libPocoUtil.so.60
#12 0x0000563554107544 in main (argc=2, argv=0x7fffabfdd958) at ../../../src/servicemain/main.cpp:22
(gdb)

请提出建议。

linux crash gdb static-libraries ubuntu-18.04
1个回答
0
投票

不是静态库的单条痕迹

您的堆栈跟踪是可疑的:为什么(几乎)每个除外帧#5来自/lib/libPocoUtil.so.60,而帧#5来自src/Path.cpp:597编译为主可执行文件?

我怀疑您的静态库出于某种原因提供了Poco::Path::clear()definition和该定义:

  1. libPocoUtil.so.60和]不兼容>
  2. 克服libPocoUtil.so.60中提供的定义。
  3. [您需要弄清楚src/Path.c如何以二进制形式结束,并删除该错误将解决您的崩溃问题。

© www.soinside.com 2019 - 2024. All rights reserved.