rtc::Thread ProcessMessage Crash

159 views
Skip to first unread message

Dipankar Das

unread,
Jan 26, 2023, 8:22:20 PM1/26/23
to discuss-webrtc
Hi All,

I am seeing a crash while calling `ProcessMessages` on the main thread. I am using M105.  This issue only happens on Linux.

Please note that this issue was not present on M88.

My test is running on main thread and I am just calling the following:

rtc::Thread::Current()->ProcessMessages(100);

And when I run the test, it crashes immediately. Below is the crash dump.

```
Caught signal 11 (SIGSEGV)
 0# signalHandler(int) at /opt/twilio/rtc-cpp/common/test/support/signal_handler.cc:115
 1# 0x00007F55F8759090 in /lib/x86_64-linux-gnu/libc.so.6
 2# rtc::Thread::ProcessMessages(int) at ../../../src/rtc_base/thread.cc:1167
 3# twilio::test::PeerConnectionOptionsBitrateTest::connectParticipant(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<twilio::media::VideoCodec>, std::shared_ptr<twilio::media::AudioCodec>, unsigned char, bool) at /opt/twilio/rtc-cpp/video/test/main-thread/peerconnectionoptions_bitrate_test.cc:85
 4# twilio::test::PeerConnectionOptionsBitrateTest_SetAndUnsetMaxBitrates_Test::TestBody() at /opt/twilio/rtc-cpp/video/test/main-thread/peerconnectionoptions_bitrate_test.cc:312
 5# void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) at ../../../src/third_party/googletest/src/googletest/src/gtest.cc:2595
 6# void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) at ../../../src/third_party/googletest/src/googletest/src/gtest.cc:2650
 7# testing::Test::Run() at ../../../src/third_party/googletest/src/googletest/src/gtest.cc:2677
 8# testing::TestInfo::Run() at ../../../src/third_party/googletest/src/googletest/src/gtest.cc:2852
 9# testing::TestSuite::Run() at ../../../src/third_party/googletest/src/googletest/src/gtest.cc:3010
10# testing::internal::UnitTestImpl::RunAllTests() at ../../../src/third_party/googletest/src/googletest/src/gtest.cc:5867
11# bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) at ../../../src/third_party/googletest/src/googletest/src/gtest.cc:2595
12# bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) at ../../../src/third_party/googletest/src/googletest/src/gtest.cc:2650
13# testing::UnitTest::Run() at ../../../src/third_party/googletest/src/googletest/src/gtest.cc:5440
14# RUN_ALL_TESTS() at /opt/twilio/rtc-cpp-build/third-party/webrtc-full-tvi/include/webrtc/third_party/googletest/src/googletest/include/gtest/gtest.h:2284
15# main at /opt/twilio/rtc-cpp/video/test/main-thread/test_runner_single_thread.cc:70
16# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
17# _start in video/test/main-thread/video-main-thread-tests
```

Any help regarding this matter is highly appreciated.

Thanks,
Dipankar.

Dipankar Das

unread,
Jan 27, 2023, 3:39:54 PM1/27/23
to discuss-webrtc
The problem is `rtc::Thread::Current()` called from the main thread always returns null. I tried `WrapCurrentThread()` but it returns a new thread which my test does not expect. Any Ideas folks?

Thanks,
Dipankar. 

Artiom Khachaturian

unread,
Mar 6, 2023, 5:33:47 AM3/6/23
to discuss-webrtc

Calling of rtc::Thread::Current() is possible only for threads with message queue, which should be created through rtc::Thread::CreateWithSocketServer() or rtc::Thread::Create()
Reply all
Reply to author
Forward
0 new messages