1

我正在尝试在 OSX Catalina 上使用 WebRTC 对等连接创建一个基本的聊天应用程序,我执行以下操作:

signaling_thread = rtc::Thread::Create();
signaling_thread->SetName("signaling_thread", signaling_thread.get());
signaling_thread->Start();

webrtc::PeerConnectionFactoryDependencies pc_dependencies;
pc_dependencies.network_thread = nullptr;
pc_dependencies.worker_thread = nullptr;
pc_dependencies.signaling_thread = signaling_thread.get();
pc_dependencies.media_engine = nullptr;
pc_dependencies.call_factory = nullptr;
pc_dependencies.event_log_factory = nullptr;

pc_factory = webrtc::CreateModularPeerConnectionFactory(std::move(pc_dependencies));

signaling_thread是一个std::unique_ptr<rtc::Thread> signaling_thread

但是当我执行 std::move 时,我得到了以下崩溃:

thread #1, queue = 'com.apple.main-thread'
frame #0: 0x00007fff6f26fce6 libsystem_kernel.dylib`__psynch_cvwait + 10
frame #1: 0x0000000100c1acdd libsystem_pthread.dylib`_pthread_cond_wait + 701
frame #2: 0x00000001001a1af2 stream_test`rtc::Event::Wait(int, int) [inlined] rtc::Event::Wait(this=<unavailable>, timeout_ts=const absl::optional<timespec> @ 0x00007ffeefbfee70)::$_0::operator()(absl::optional<timespec>) const at event.cc:172:13 [opt]
frame #3: 0x00000001001a1aa7 stream_test`rtc::Event::Wait(this=0x00007ffeefbfef40, give_up_after_ms=<unavailable>, warn_after_ms=<unavailable>) at event.cc:183 [opt]
frame #4: 0x0000000100072801 stream_test`webrtc::CreateModularPeerConnectionFactory(webrtc::PeerConnectionFactoryDependencies) [inlined] webrtc::MethodCall0<webrtc::PeerConnectionFactory, bool>::Marshal(this=0x00007ffeefbfeed8, posted_from=0x00007ffeefbfeec8, t=0x000000010390b050) at proxy.h:168:43 [opt]
frame #5: 0x00000001000727eb stream_test`webrtc::CreateModularPeerConnectionFactory(dependencies=<unavailable>) at peer_connection_factory.cc:58 [opt]
frame #6: 0x000000010000964e stream_test`WebRTCLibPeerConnection::_init(this=0x000000010390aa90) at WebRTCLibPeerConnection.cpp:321:18
frame #7: 0x000000010000904d stream_test`WebRTCLibPeerConnection::create_data_channel(this=0x000000010390aa90, p_channel="chat", p_channel_config="{ \"id\": 1, \"negotiated\": true}") at WebRTCLibPeerConnection.cpp:204:5
frame #8: 0x0000000100026289 stream_test`streamer::Streamer::init(this=0x000000010390aa70) at streamer.cpp:36:14
frame #9: 0x00000001000029c9 stream_test`main at streamer_run.cpp:10:8
frame #10: 0x00007fff6f12c7fd libdyld.dylib`start + 1
thread #2
frame #0: 0x00007fff6f26e92e libsystem_kernel.dylib`__workq_kernreturn + 10
frame #1: 0x0000000100c17090 libsystem_pthread.dylib`_pthread_wqthread + 390
frame #2: 0x0000000100c16157 libsystem_pthread.dylib`start_wqthread + 15
* thread #4, name = 'a', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x00007fff6f322769 libsystem_platform.dylib`_platform_memmove$VARIANT$Haswell + 41
frame #1: 0x00007fff6c23f258 libc++.1.dylib`std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 140
* frame #2: 0x00000001002ce14d stream_test`cricket::RtpDataCodec::RtpDataCodec(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) [inlined] cricket::Codec::Codec(this=0x000070000969cd50, id=<unavailable>, name=<unavailable>, clockrate=90000) at codec.cc:115:15 [opt]
frame #3: 0x00000001002ce134 stream_test`cricket::RtpDataCodec::RtpDataCodec(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) [inlined] cricket::RtpDataCodec::RtpDataCodec(this=0x000070000969cd50, id=<unavailable>, name=<unavailable>) at codec.cc:361 [opt]
frame #4: 0x00000001002ce12a stream_test`cricket::RtpDataCodec::RtpDataCodec(this=0x000070000969cd50, id=<unavailable>, name=<unavailable>) at codec.cc:361 [opt]
frame #5: 0x00000001002d50c6 stream_test`cricket::RtpDataEngine::RtpDataEngine(this=0x0000000100d04040) at rtp_data_engine.cc:40:7 [opt]
frame #6: 0x0000000100072954 stream_test`webrtc::PeerConnectionFactory::Initialize() [inlined] std::__1::__unique_if<cricket::RtpDataEngine>::__unique_single std::__1::make_unique<cricket::RtpDataEngine>() at memory:3131:32 [opt]
frame #7: 0x000000010007293f stream_test`webrtc::PeerConnectionFactory::Initialize(this=0x0000000103a001c0) at peer_connection_factory.cc:138 [opt]
frame #8: 0x0000000100074393 stream_test`webrtc::MethodCall0<webrtc::PeerConnectionFactory, bool>::OnMessage(rtc::Message*) [inlined] void webrtc::ReturnType<bool>::Invoke<webrtc::PeerConnectionFactory, bool (this=0x00007ffeefbfef28, m=<unavailable>)()>(webrtc::PeerConnectionFactory*, bool (webrtc::PeerConnectionFactory::*)()) at proxy.h:78:10 [opt]
frame #9: 0x0000000100074381 stream_test`webrtc::MethodCall0<webrtc::PeerConnectionFactory, bool>::OnMessage(this=0x00007ffeefbfeed8, (null)=<unavailable>) at proxy.h:173 [opt]
frame #10: 0x00000001000db5f8 stream_test`non-virtual thunk to webrtc::internal::SynchronousMethodCall::OnMessage(rtc::Message*) [inlined] webrtc::internal::SynchronousMethodCall::OnMessage(this=<unavailable>, (null)=<unavailable>) at proxy.cc:32:11 [opt]
frame #11: 0x00000001000db5e9 stream_test`non-virtual thunk to webrtc::internal::SynchronousMethodCall::OnMessage(rtc::Message*) at proxy.cc:0 [opt]
frame #12: 0x000000010016fb87 stream_test`rtc::MessageQueue::Dispatch(this=<unavailable>, pmsg=0x000070000969cf30) at message_queue.cc:514:19 [opt]
frame #13: 0x000000010018da6e stream_test`rtc::Thread::ProcessMessages(this=0x000000010390b050, cmsLoop=-1) at thread.cc:528:5 [opt]
frame #14: 0x000000010018d6e2 stream_test`rtc::Thread::PreRun(pv=0x000000010390b050) at thread.cc:341:11 [opt]
frame #15: 0x0000000100c1a9bd libsystem_pthread.dylib`_pthread_start + 148
frame #16: 0x0000000100c1616b libsystem_pthread.dylib`thread_start + 15
thread #5, name = 'a'
frame #0: 0x00007fff6f2755be libsystem_kernel.dylib`__select + 10
frame #1: 0x00000001001829f8 stream_test`rtc::PhysicalSocketServer::WaitSelect(this=<unavailable>, cmsWait=<unavailable>, process_io=true) at physical_socket_server.cc:1446:13 [opt]
frame #2: 0x000000010016f51c stream_test`rtc::MessageQueue::Get(this=<unavailable>, pmsg=<unavailable>, cmsWait=-1, process_io=<unavailable>) at message_queue.cc:330:17 [opt]
frame #3: 0x000000010018d9f3 stream_test`rtc::Thread::ProcessMessages(this=0x0000000103a0fa30, cmsLoop=-1) at thread.cc:526:10 [opt]
frame #4: 0x000000010018d6e2 stream_test`rtc::Thread::PreRun(pv=0x0000000103a0fa30) at thread.cc:341:11 [opt]
frame #5: 0x0000000100c1a9bd libsystem_pthread.dylib`_pthread_start + 148
frame #6: 0x0000000100c1616b libsystem_pthread.dylib`thread_start + 15
thread #6, name = 'a'
frame #0: 0x00007fff6f26fce6 libsystem_kernel.dylib`__psynch_cvwait + 10
frame #1: 0x0000000100c1acdd libsystem_pthread.dylib`_pthread_cond_wait + 701
frame #2: 0x00000001001a1b85 stream_test`rtc::Event::Wait(int, int) [inlined] rtc::Event::Wait(this=<unavailable>, timeout_ts=const absl::optional<timespec> @ 0x00007000097a2dd0)::$_0::operator()(absl::optional<timespec>) const at event.cc:165:17 [opt]
frame #3: 0x00000001001a1b17 stream_test`rtc::Event::Wait(this=0x0000000103a01bf0, give_up_after_ms=<unavailable>, warn_after_ms=<unavailable>) at event.cc:181 [opt]
frame #4: 0x00000001001787a2 stream_test`rtc::NullSocketServer::Wait(this=<unavailable>, cms=<unavailable>, process_io=<unavailable>) at null_socket_server.cc:24:10 [opt]
frame #5: 0x000000010016f51c stream_test`rtc::MessageQueue::Get(this=<unavailable>, pmsg=<unavailable>, cmsWait=-1, process_io=<unavailable>) at message_queue.cc:330:17 [opt]
frame #6: 0x000000010018d9f3 stream_test`rtc::Thread::ProcessMessages(this=0x0000000103a0fb90, cmsLoop=-1) at thread.cc:526:10 [opt]
frame #7: 0x000000010018d6e2 stream_test`rtc::Thread::PreRun(pv=0x0000000103a0fb90) at thread.cc:341:11 [opt]
frame #8: 0x0000000100c1a9bd libsystem_pthread.dylib`_pthread_start + 148
frame #9: 0x0000000100c1616b libsystem_pthread.dylib`thread_start + 15
Program ended with exit code: 9

有没有人遇到过类似的问题?

4

0 回答 0