WebRTC 在第 webrtc::PeerConnectionInterface::RTCConfiguration 行崩溃;对于本机 Linux 应用程序

WebRTC crash at line webrtc::PeerConnectionInterface::RTCConfiguration config; for Native Linux application

我正在为 Linux (Ubuntu) 编写本机 WebRTC 应用程序,代码在 webrtc::PeerConnectionInterface::RTCConfiguration 配置时崩溃;

我有以下两种推测

  1. 我可能搞砸了 rtc 线程,因为同一行在示例应用程序中运行良好。
  2. C++字符串的处理有没有错误。不确定在变量声明期间它会如何影响。

下面是痕迹:

0 0x00007fbd841e6fdf in std::__cxx1998::vector, std::allocator >, std::allocator, std::allocator >> >::~vector() () 在 /usr/include/c++/8/bits/stl_vector.h:567 1 0x00007fbd841e696e 在 std::__debug::vector, std::allocator >, std::allocator, std::allocator > > >::~vector() () 在 /usr/include/c++/8/debug/vector:210 警告:找不到 CU 在偏移量 0xe2f950 处引用的 DWO CU obj/api/libjingle_peerconnection_api/peer_connection_interface.dwo(0x88209d7623c67b6c) [在模块 /opt/Citrix/ICAClient/libwebrpc.so]

2 0x00007fbd8464272c 在 webrtc::PeerConnectionInterface::IceServer::~IceServer() () at ../../../api/peer_connection_interface.h:208 警告:找不到 CU 在偏移量 0xe2f03c 处引用的 DWO CU obj/pc/peerconnection/peer_connection_factory.dwo(0xc714b8e7fa522831) [在模块 /opt/Citrix/ICAClient/libwebrpc.so]

3 0x00007fbd84438068 无效 std::_Destroy(webrtc::PeerConnectionInterface::IceServer*) () 在 /usr/include/c++/8/bits/stl_construct.h:98

4 0x00007fbd844370b3 无效 std::_Destroy_aux::__destroy(webrtc::PeerConnectionInterface::IceServer*, webrtc::PeerConnectionInterface::IceServer*) () 在 /usr/include/c++/8/ bits/stl_construct.h:108

5 0x00007fbd84435a85 无效 std::_Destroy(webrtc::PeerConnectionInterface::IceServer*, webrtc::PeerConnectionInterface::IceServer*) () 在 /usr/include/c++/8/bits/stl_construct.h: 137

6 0x00007fbd84433f1b 无效 std::_Destroy(webrtc::PeerConnectionInterface::IceServer*, webrtc::PeerConnectionInterface::IceServer*, std::allocator&) () 在 /usr/include/c++/8/bits/stl_construct.h:206

7 std::__cxx1998::vector 中的 0x00007fbd8464454f >::~vector() () 在 /usr/include/c++/8/bits/stl_vector.h:567

8 0x00007fbd84644192 在 std::__debug::vector >::~vector() () 在 /usr/include/c++/8/debug/vector:210

9 0x00007fbd84643132 在 webrtc::PeerConnectionInterface::RTCConfiguration::~RTCConfiguration() () 在 ../../../api/peer_connection_interface.h:292

连我都观察到了这个问题。发生此问题是因为默认情况下 webrtc 是使用 -D_GLIBCXX_DEBUG 编译的(请参阅文件 build//config/BUILD.GN)。如果你不使用这个标志编译你的程序,你会遇到问题,因为这个标志会导致向量的实现发生变化,以吐出更好的调试消息。因此,如果您不使用此标志编译您的程序,std::vector 实现将不一致并导致段错误。 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53324