open-webrtc-toolkit / owt-client-native

Open WebRTC Toolkit client SDK for native Windows/Linux/iOS applications.
https://01.org/open-webrtc-toolkit
Apache License 2.0
384 stars 180 forks source link

version5.0.x crash on ios: sdallocx(ptr, size + OPENSSL_MALLOC_PREFIX, 0 /* flags */); #685

Closed jycmashiro closed 1 year ago

jycmashiro commented 1 year ago

Environment: Machine: Intel Core i9 XCode: 13.2.1 xcode-select version 2396 Branch: 5.0.x

build libsioclient.a: cmake -DBOOST_INCLUDEDIR=/usr/local/Cellar/boost/1.81.0_1/include -DBOOST_LIBRARYDIR=/usr/local/Cellar/boost/1.81.0_1/lib -DBOOST_VER:STRING=1.81.0_1 -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl@1.1/1.1.1s -DOPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl@1.1/1.1.1s/include -DCMAKE_SYSTEM_NAME=iOS

build OWT.framework & WebRTC.framework: python3 scripts/build.py --scheme debug --arch x64,arm64 --skip_tests

crashed while publishing or subscribing a stream

network_thread (29)#0   0x000000011020b4c8 in sdallocx ()
#1  0x000000012e4eea45 in OPENSSL_free at /Users/mashiro/Desktop/owt-client-native/src/third_party/boringssl/src/crypto/mem.c:133
#2  0x000000012e4eeb54 in OPENSSL_realloc at /Users/mashiro/Desktop/owt-client-native/src/third_party/boringssl/src/crypto/mem.c:157
#3  0x000000012e507666 in sk_insert at /Users/mashiro/Desktop/owt-client-native/src/third_party/boringssl/src/crypto/stack/stack.c:184
#4  0x000000012e507d24 in sk_push at /Users/mashiro/Desktop/owt-client-native/src/third_party/boringssl/src/crypto/stack/stack.c:321
#5  0x000000012e49825d in sk_BIGNUM_push at /Users/mashiro/Desktop/owt-client-native/src/third_party/boringssl/src/crypto/fipsmodule/bn/ctx.c:88
#6  0x000000012e49817a in BN_CTX_get at /Users/mashiro/Desktop/owt-client-native/src/third_party/boringssl/src/crypto/fipsmodule/bn/ctx.c:173
#7  0x000000012e49849f in BN_div at /Users/mashiro/Desktop/owt-client-native/src/third_party/boringssl/src/crypto/fipsmodule/bn/div.c:228
#8  0x000000012e4a5623 in BN_MONT_CTX_set at /Users/mashiro/Desktop/owt-client-native/src/third_party/boringssl/src/crypto/fipsmodule/bn/montgomery.c:230
#9  0x000000012e49d4d5 in BN_MONT_CTX_new_for_modulus at /Users/mashiro/Desktop/owt-client-native/src/third_party/boringssl/src/crypto/fipsmodule/bn/montgomery.c:239
#10 0x000000012e4b9eab in ec_GFp_mont_group_set_curve at /Users/mashiro/Desktop/owt-client-native/src/third_party/boringssl/src/crypto/fipsmodule/ec/ec_montgomery.c:108
#11 0x000000012e4b6eb8 in ec_group_new_from_data at /Users/mashiro/Desktop/owt-client-native/src/third_party/boringssl/src/crypto/fipsmodule/ec/ec.c:439
#12 0x000000012e4b6c81 in EC_GROUP_new_by_curve_name at /Users/mashiro/Desktop/owt-client-native/src/third_party/boringssl/src/crypto/fipsmodule/ec/ec.c:530
#13 0x000000012e4b8cd2 in EC_KEY_new_by_curve_name at /Users/mashiro/Desktop/owt-client-native/src/third_party/boringssl/src/crypto/fipsmodule/ec/ec_key.c:147
#14 0x000000012e3c18b7 in rtc::MakeKey(rtc::KeyParams const&) at /Users/mashiro/Desktop/owt-client-native/src/third_party/webrtc/rtc_base/openssl_identity.cc:63
#15 0x000000012e3c11c5 in rtc::OpenSSLKeyPair::Generate(rtc::KeyParams const&) at /Users/mashiro/Desktop/owt-client-native/src/third_party/webrtc/rtc_base/openssl_identity.cc:96
#16 0x000000012e3c4c38 in rtc::OpenSSLIdentity::CreateInternal(rtc::SSLIdentityParams const&) at /Users/mashiro/Desktop/owt-client-native/src/third_party/webrtc/rtc_base/openssl_identity.cc:215
#17 0x000000012e3c5196 in rtc::OpenSSLIdentity::CreateWithExpiration(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, rtc::KeyParams const&, long) at /Users/mashiro/Desktop/owt-client-native/src/third_party/webrtc/rtc_base/openssl_identity.cc:241
#18 0x000000012e404c05 in rtc::SSLIdentity::Create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, rtc::KeyParams const&) at /Users/mashiro/Desktop/owt-client-native/src/third_party/webrtc/rtc_base/ssl_identity.cc:223
#19 0x000000012e3ed549 in rtc::RTCCertificateGenerator::GenerateCertificate(rtc::KeyParams const&, absl::optional<unsigned long long> const&) at /Users/mashiro/Desktop/owt-client-native/src/third_party/webrtc/rtc_base/rtc_certificate_generator.cc:114
#20 0x000000012e3ee8c3 in rtc::(anonymous namespace)::RTCCertificateGenerationTask::OnMessage(rtc::Message*) at /Users/mashiro/Desktop/owt-client-native/src/third_party/webrtc/rtc_base/rtc_certificate_generator.cc:68
#21 0x000000012e4107ef in rtc::Thread::Dispatch(rtc::Message*) at /Users/mashiro/Desktop/owt-client-native/src/third_party/webrtc/rtc_base/thread.cc:664
#22 0x000000012e40d9c1 in rtc::Thread::ProcessMessages(int) at /Users/mashiro/Desktop/owt-client-native/src/third_party/webrtc/rtc_base/thread.cc:1000
#23 0x000000012e411f8a in rtc::Thread::Run() at /Users/mashiro/Desktop/owt-client-native/src/third_party/webrtc/rtc_base/thread.cc:842
#24 0x000000012e411b00 in rtc::Thread::PreRun(void*) at /Users/mashiro/Desktop/owt-client-native/src/third_party/webrtc/rtc_base/thread.cc:831
#25 0x00007ff836176259 in _pthread_start ()
#26 0x00007ff836171c7b in thread_start ()