error in broadcaster demo - mac os x

Hi all,
I’m trying to run the broadcaster on mac os x.
when I launch the application I obtain the following error (output of lldb)

`* thread #4, name = ‘a’, stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)

  • frame #0: 0x00007fff70072929 libsystem_platform.dylib_platform_memmove$VARIANT$Haswell + 41 frame #1: 0x00007fff6d17eba8 libc++.1.dylibstd::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::basic_string(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 140
    frame #2: 0x000000010057ae3d broadcastercricket::RtpDataCodec::RtpDataCodec(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) [inlined] cricket::Codec::Codec(this=0x0000700005151d30, id=<unavailable>, name=<unavailable>, clockrate=90000) at codec.cc:127:15 [opt] frame #3: 0x000000010057ae24 broadcastercricket::RtpDataCodec::RtpDataCodec(int, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) [inlined] cricket::RtpDataCodec::RtpDataCodec(this=0x0000700005151d30, id=, name=) at codec.cc:373 [opt]
    frame #4: 0x000000010057ae1a broadcastercricket::RtpDataCodec::RtpDataCodec(this=0x0000700005151d30, id=<unavailable>, name=<unavailable>) at codec.cc:373 [opt] frame #5: 0x0000000100582226 broadcastercricket::RtpDataEngine::RtpDataEngine(this=0x0000000104e0d5d0) at rtp_data_engine.cc:40:7 [opt]
    frame #6: 0x0000000100319854 broadcasterwebrtc::PeerConnectionFactory::Initialize() [inlined] std::__1::__unique_if<cricket::RtpDataEngine>::__unique_single std::__1::make_unique<cricket::RtpDataEngine>() at memory:3043:32 [opt] frame #7: 0x000000010031983f broadcasterwebrtc::PeerConnectionFactory::Initialize(this=0x0000000104e0d310) at peer_connection_factory.cc:143 [opt]
    frame #8: 0x000000010031b423 broadcasterwebrtc::MethodCall<webrtc::PeerConnectionFactory, bool>::OnMessage(rtc::Message*) [inlined] void webrtc::ReturnType<bool>::Invoke<webrtc::PeerConnectionFactory, bool (this=0x00007ffeefbfe1c0, c=<unavailable>, m=<unavailable>)()>(webrtc::PeerConnectionFactory*, bool (webrtc::PeerConnectionFactory::*)()) at proxy.h:78:10 [opt] frame #9: 0x000000010031b411 broadcasterwebrtc::MethodCall<webrtc::PeerConnectionFactory, bool>::OnMessage(rtc::Message*) [inlined] void webrtc::MethodCall<webrtc::PeerConnectionFactory, bool>::Invoke<>(this=0x00007ffeefbfe170) at proxy.h:136 [opt]
    frame #10: 0x000000010031b409 broadcasterwebrtc::MethodCall<webrtc::PeerConnectionFactory, bool>::OnMessage(this=0x00007ffeefbfe170, (null)=<unavailable>) at proxy.h:132 [opt] frame #11: 0x000000010025d098 broadcasternon-virtual thunk to webrtc::internal::SynchronousMethodCall::OnMessage(rtc::Message*) [inlined] webrtc::internal::SynchronousMethodCall::OnMessage(this=, (null)=) at proxy.cc:32:11 [opt]
    frame #12: 0x000000010025d089 broadcasternon-virtual thunk to webrtc::internal::SynchronousMethodCall::OnMessage(rtc::Message*) at proxy.cc:0 [opt] frame #13: 0x00000001003edcab broadcasterrtc::thread::Dispatch(this=, pmsg=0x0000700005151f20) at thread.cc:664:19 [opt]
    frame #14: 0x00000001003ec2ae broadcasterrtc::Thread::ProcessMessages(this=0x0000000104e042b0, cmsLoop=<unavailable>) at thread.cc:1000:5 [opt] frame #15: 0x00000001003ee147 broadcasterrtc::thread::PreRun(pv=0x0000000104e042b0) at thread.cc:831:11 [opt]
    frame #16: 0x00007fff70081109 libsystem_pthread.dylib_pthread_start + 148 frame #17: 0x00007fff7007cb8b libsystem_pthread.dylibthread_start + 15`

Do you have idea why there is this error?
Thank you very much
Angelo

Hi,

Sorry, this is related to libwebrtc, not any mediasoup library. You need to search and ask in the corresponding mailing list.

discuss-webrtc@googlegroups.com

Hi,
I corrected the version of libcurl and I solved that error, but I have this error now:

[INFO] Broadcaster::Start()
2020-09-09 14:07:43.157743+0200 broadcaster[29944:813048] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x103c13d70> F8BB1C28-BAE8-11D6-9C31-00039315CD46
Process 29944 stopped
* thread #5, name = 'network_thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x50)
    frame #0: 0x0000000000000050
error: memory read failed for 0x0
Target 0: (broadcaster) stopped.
(lldb) bt
* thread #5, name = 'network_thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x50)
  * frame #0: 0x0000000000000050
    frame #1: 0x0000000102abe7f4 libcrypto.1.1.dylib`asn1_item_embed_new + 97
    frame #2: 0x0000000102abeaa8 libcrypto.1.1.dylib`asn1_template_new + 112
    frame #3: 0x0000000102abe90f libcrypto.1.1.dylib`asn1_item_embed_new + 380
    frame #4: 0x0000000102abe775 libcrypto.1.1.dylib`ASN1_item_new + 25
    frame #5: 0x00000001003d979d broadcaster`rtc::OpenSSLCertificate::Generate(rtc::OpenSSLKeyPair*, rtc::SSLIdentityParams const&) [inlined] rtc::(anonymous namespace)::MakeCertificate(pkey=0x0000000102e0c7d8, params=0x00007000074b6c60) at openssl_certificate.cc:67:15 [opt]
    frame #6: 0x00000001003d9769 broadcaster`rtc::OpenSSLCertificate::Generate(key_pair=0x0000000102e09a90, params=<unavailable>) at openssl_certificate.cc:134 [opt]
    frame #7: 0x00000001003db177 broadcaster`rtc::OpenSSLIdentity::CreateInternal(params=0x00007000074b6d40) at openssl_identity.cc:218:9 [opt]
    frame #8: 0x00000001003db348 broadcaster`rtc::OpenSSLIdentity::CreateWithExpiration(common_name=<unavailable>, key_params=0x0000000102f15050, certificate_lifetime=2592000) at openssl_identity.cc:241:10 [opt]
    frame #9: 0x00000001003e9ee7 broadcaster`rtc::SSLIdentity::Create(common_name=<unavailable>, key_param=<unavailable>) at ssl_identity.cc:223:10 [opt]
    frame #10: 0x00000001003e2990 broadcaster`rtc::RTCCertificateGenerator::GenerateCertificate(key_params=0x0000000102f15050, expires_ms=0x0000000102f15060) at rtc_certificate_generator.cc:114:16 [opt]
    frame #11: 0x00000001003e2ca6 broadcaster`rtc::(anonymous namespace)::RTCCertificateGenerationTask::OnMessage(this=0x0000000102f15030, msg=0x00007000074b6f20) at rtc_certificate_generator.cc:68:24 [opt]
    frame #12: 0x00000001003ed18b broadcaster`rtc::Thread::Dispatch(rtc::Message*) + 235
    frame #13: 0x00000001003eb7ae broadcaster`rtc::Thread::ProcessMessages(int) + 302
    frame #14: 0x00000001003ed62d broadcaster`rtc::Thread::PreRun(void*) + 109
    frame #15: 0x00007fff6cb9b109 libsystem_pthread.dylib`_pthread_start + 148
    frame #16: 0x00007fff6cb96b8b libsystem_pthread.dylib`thread_start + 15

I understand that the problem is inside webrtc, but I want to know if I have to compile the application linking against the same version of openssl of webrtc, and if yes, which version?
Thank you for your help

I noticed that the error is about an incompatibility of openssl and boringssl.
I tried to use cpr installed with brew.
Now I’m obtaining a linkin error:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_NSScreen", referenced from:
      objc-class-ref in libwebrtc.a(desktop_configuration.o)
  "std::__1::__libcpp_debug_function", referenced from:
      bool std::__1::operator==<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) in libwebrtc.a(logging.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long) in libwebrtc.a(logging.o)
      std::__1::char_traits<char>::copy(char*, char const*, unsigned long) in libwebrtc.a(logging.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*) in libwebrtc.a(logging.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*, unsigned long) in libwebrtc.a(logging.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string<std::nullptr_t>(char const*) in libwebrtc.a(logging.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(unsigned long, unsigned long, char const*, unsigned long) const in libwebrtc.a(logging.o)
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

do you have a solution for this?
I don’t understand what I have to include to avoid this c++ errors.

Thank you a lot
Angelo

Hi found a solution:
I’m using libcurl and libcpr provided by brew and I changed a little bit the cmake.
let me know if you like this solution, so I can put the code in your repository.

Angelo

Feel free to make a PR exposing your changes and we’ll see.

this is my version:

I create a pull request about it.
Thanks for your help
Angelo