Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webrtc.node don't build correctly for mac #10

Closed
fuson opened this issue Oct 16, 2013 · 17 comments
Closed

webrtc.node don't build correctly for mac #10

fuson opened this issue Oct 16, 2013 · 17 comments
Labels

Comments

@fuson
Copy link

fuson commented Oct 16, 2013

/Users/wwwposta/node_modules/node-webrtc/node_modules/bindings/bindings.js:83
throw e
^
Error: dlopen(/Users/wwwposta/node_modules/node-webrtc/build/Release/webrtc.node, 1): Symbol not found: OBJC_CLASS$_NSColor
Referenced from: /Users/wwwposta/node_modules/node-webrtc/build/Release/webrtc.node
Expected in: dynamic lookup

at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at bindings (/Users/wwwposta/node_modules/node-webrtc/node_modules/bindings/bindings.js:76:44)
at Object.<anonymous> (/Users/wwwposta/node_modules/node-webrtc/src/peerconnection.js:1:96)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
@modeswitch
Copy link

I'll try and get my hands on a mac to debug this.

@fuson
Copy link
Author

fuson commented Oct 16, 2013

(moving in proper place)
...
Currently only webrtc module what i successfully build on mac and run test example (with segfault after ice candidate exchange:) ) is https://github.com/helloIAmPau/node-rtc. This module have some path for webrtc, maybe you will find it usable for you.

@fuson
Copy link
Author

fuson commented Oct 18, 2013

Guys, current state of mac build from actual repo state + change libjingle revision: i see some progress, for now:
ws connected
{ type: 'offer',
sdp: 'v=0\r\no=- 6754621065176264031 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio data\r\na=msid-semantic: WMS\r\nm=audio 1 RTP/SAVPF 111 103 104 0 8 107 106 105 13 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:jM28/3ZXS4+CYSXD\r\na=ice-pwd:OQCj0RVoatTwqJOJwTMDSKbm\r\na=ice-options:google-ice\r\na=mid:audio\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=recvonly\r\na=rtcp-mux\r\na=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:w3OEnBaViX9nMfzu8WDS8ZOuNPINKlbPTYDF8y4f\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:107 CN/48000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:126 telephone-event/8000\r\na=maxptime:60\r\nm=application 1 RTP/SAVPF 101\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:jM28/3ZXS4+CYSXD\r\na=ice-pwd:OQCj0RVoatTwqJOJwTMDSKbm\r\na=ice-options:google-ice\r\na=mid:data\r\na=sendrecv\r\nb=AS:30\r\na=rtcp-mux\r\na=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:w3OEnBaViX9nMfzu8WDS8ZOuNPINKlbPTYDF8y4f\r\na=rtpmap:101 google-data/90000\r\na=ssrc:3981505182 cname:2asrWm2o07plthWz\r\na=ssrc:3981505182 msid:reliable reliable\r\na=ssrc:3981505182 mslabel:reliable\r\na=ssrc:3981505182 label:reliable\r\n' }
signaling state change: 3
ondatachannel reliable connecting
{ type: 'answer',
sdp: 'v=0\r\no=- 4649007703530109084 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio data\r\na=msid-semantic: WMS\r\nm=audio 1 RTP/SAVPF 111 103 104 0 8 106 105 13 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:bguzblN7hwg6gZ90\r\na=ice-pwd:Jl3TMMmIACvuXrFnqiXBn/ZZ\r\na=mid:audio\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=sendonly\r\na=rtcp-mux\r\na=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:rT0beYFfxsayPT491GhE6B8g7lQPMn0si/G9C1Lx\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:126 telephone-event/8000\r\na=maxptime:60\r\nm=application 1 RTP/SAVPF 101\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:bguzblN7hwg6gZ90\r\na=ice-pwd:Jl3TMMmIACvuXrFnqiXBn/ZZ\r\na=mid:data\r\na=sendrecv\r\nb=AS:30\r\na=rtcp-mux\r\na=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:rT0beYFfxsayPT491GhE6B8g7lQPMn0si/G9C1Lx\r\na=rtpmap:101 google-data/90000\r\na=ssrc:935829516 cname:nYOcC4DnHmdgiXgD\r\na=ssrc:935829516 msid:reliable reliable\r\na=ssrc:935829516 mslabel:reliable\r\na=ssrc:935829516 label:reliable\r\n' }
signaling state change: 0
WARNING: no real random source present!
ice connection state change: 1
ice gathering state change: 1
ice gathering state change: 1
awaiting data channels
Segmentation fault: 11

@modeswitch
Copy link

@Fusion You can try doing a debug build and running it through GDB. If so, please paste a backtrace here and I'll have a look.

@fuson
Copy link
Author

fuson commented Oct 18, 2013

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000004100000100
[Switching to process 62300 thread 0x3003]
0x00000001000c0a85 in EVP_PKEY_CTX_ctrl ()

@fuson
Copy link
Author

fuson commented Oct 18, 2013

(gdb) backtrace
#0 0x00000001000c0a85 in EVP_PKEY_CTX_ctrl ()
#1 0x00000001000b5aa9 in EVP_DigestInit_ex ()
#2 0x000000010337477b in talk_base::OpenSSLDigest::OpenSSLDigest (this=0x100d1ede0, algorithm=@0x104a86830) at talk/base/openssldigest.cc:39
#3 0x00000001033746bb in talk_base::OpenSSLDigest::OpenSSLDigest (this=0x100d1ede0, algorithm=@0x104a86830) at talk/base/openssldigest.cc:43
#4 0x000000010331169c in talk_base::MessageDigestFactory::Create (alg=@0x104a86830) at talk/base/messagedigest.cc:56
#5 0x0000000103311fbf in talk_base::ComputeHmac (alg=@0x104a86830, key=0x100e067a8, key_len=24, input=0x1018ce000, in_len=80, output=0x104a86840, out_len=20)
at talk/base/messagedigest.cc:151
#6 0x00000001034dc44e in cricket::StunMessage::AddMessageIntegrity (this=0x100d1f920, key=0x100e067a8 "M0eM6d4+5hWbzeNIW6ybgdNJ", keylen=24) at talk/p2p/base/stun.cc:245
#7 0x00000001034dc26f in cricket::StunMessage::AddMessageIntegrity (this=0x100d1f920, password=@0x100b225f8) at talk/p2p/base/stun.cc:225
#8 0x0000000103462e0e in cricket::ConnectionRequest::Prepare (this=0x100d1d360, request=0x100d1f920) at talk/p2p/base/port.cc:797
#9 0x00000001034e9fca in cricket::StunRequest::Construct (this=0x100d1d360) at talk/p2p/base/stunrequest.cc:158
#10 0x00000001034e9e9e in cricket::StunRequestManager::SendDelayed (this=0x100b22658, request=0x100d1d360, delay=0) at talk/p2p/base/stunrequest.cc:61
#11 0x00000001034e9e30 in cricket::StunRequestManager::Send (this=0x100b22658, request=0x100d1d360) at talk/p2p/base/stunrequest.cc:55
#12 0x00000001034528bd in cricket::Connection::Ping (this=0x100b224b0, now=304593895) at talk/p2p/base/port.cc:1142
#13 0x0000000103437070 in cricket::P2PTransportChannel::PingConnection (this=0x100d1eaf0, conn=0x100b224b0) at talk/p2p/base/p2ptransportchannel.cc:1159
#14 0x0000000103436c62 in cricket::P2PTransportChannel::OnPing (this=0x100d1eaf0) at talk/p2p/base/p2ptransportchannel.cc:1080
#15 0x0000000103436b8a in cricket::P2PTransportChannel::OnMessage (this=0x100d1eaf0, pmsg=0x104a86e40) at talk/p2p/base/p2ptransportchannel.cc:1057
#16 0x0000000103436d24 in non-virtual thunk to cricket::P2PTransportChannel::OnMessage(talk_base::Message*) (this=0x100d1ec80, pmsg=0x104a86e40)
at talk/p2p/base/p2ptransportchannel.cc:1063
#17 0x000000010331413b in talk_base::MessageQueue::Dispatch (this=0x103018ef0, pmsg=0x104a86e40) at talk/base/messagequeue.cc:396
#18 0x0000000103359497 in talk_base::Thread::ProcessMessages (this=0x103018ef0, cmsLoop=-1) at talk/base/thread.cc:501
#19 0x0000000103359398 in talk_base::Thread::Run (this=0x103018ef0) at talk/base/thread.cc:365
#20 0x0000000103359241 in talk_base::Thread::PreRun (pv=0x100d045d0) at talk/base/thread.cc:353
#21 0x00007fff8a2398bf in _pthread_start ()
#22 0x00007fff8a23cb75 in thread_start ()

@fuson
Copy link
Author

fuson commented Oct 18, 2013

#0 0x00000001000c0a85 in EVP_PKEY_CTX_ctrl ()
#1 0x00000001000b5aa9 in EVP_DigestInit_ex ()
#2 0x00000001039f277b in talk_base::OpenSSLDigest::OpenSSLDigest (this=0x100d0b9c0, algorithm=@0x102784a90) at talk/base/openssldigest.cc:39
#3 0x00000001039f26bb in talk_base::OpenSSLDigest::OpenSSLDigest (this=0x100d0b9c0, algorithm=@0x102784a90) at talk/base/openssldigest.cc:43
#4 0x000000010398f69c in talk_base::MessageDigestFactory::Create (alg=@0x102784a90) at talk/base/messagedigest.cc:56
#5 0x000000010398ffbf in talk_base::ComputeHmac (alg=@0x102784a90, key=0x100b22a08, key_len=24, input=0x100d0ad10, in_len=84, output=0x102784aa0, out_len=20)
at talk/base/messagedigest.cc:151
#6 0x0000000103b5a14a in cricket::StunMessage::ValidateMessageIntegrity (data=0x102828000 "", size=116, password=@0x10201adb8) at talk/p2p/base/stun.cc:211
#7 0x0000000103aca927 in cricket::Port::GetStunMessage (this=0x10201abe0, data=0x102828000 "", size=116, addr=@0x10201b550, out_msg=0x102786218, out_username=0x102786210)
at talk/p2p/base/port.cc:397
#8 0x0000000103aceda2 in cricket::Connection::OnReadPacket (this=0x10201b440, data=0x102828000 "", size=116) at talk/p2p/base/port.cc:931
#9 0x0000000103b6323c in cricket::UDPPort::OnReadPacket (this=0x10201abe0, socket=0x10201a960, data=0x102828000 "", size=116, remote_addr=@0x1027866a0)
at talk/p2p/base/stunport.cc:271
#10 0x0000000103bc6b73 in cricket::UDPPort::HandleIncomingPacket (this=0x10201abe0, socket=0x10201a960, data=0x102828000 "", size=116, remote_addr=@0x1027866a0)
at stunport.h:100
#11 0x0000000103babff1 in cricket::AllocationSequence::OnReadPacket (this=0x10201a480, socket=0x10201a960, data=0x102828000 "", size=116, remote_addr=@0x1027866a0)
at talk/p2p/client/basicportallocator.cc:1032
#12 0x0000000103bb7ae6 in sigslot::_connection4<cricket::AllocationSequence, talk_base::AsyncPacketSocket*, char const*, unsigned long, talk_base::SocketAddress const&, sigslot::single_threaded>::emit (this=0x10201a5e0, a1=0x10201a960, a2=0x102828000 "", a3=116, a4=@0x1027866a0) at sigslot.h:1993
#13 0x000000010396c6bc in sigslot::signal4<talk_base::AsyncPacketSocket*, char const*, unsigned long, talk_base::SocketAddress const&, sigslot::single_threaded>::operator() (
this=0x10201a9a0, a1=0x10201a960, a2=0x102828000 "", a3=116, a4=@0x1027866a0) at sigslot.h:2544
#14 0x000000010396ba49 in talk_base::AsyncUDPSocket::OnReadEvent (this=0x10201a960, socket=0x10201a878) at talk/base/asyncudpsocket.cc:131
#15 0x000000010396d0f0 in sigslot::_connection1<talk_base::AsyncUDPSocket, talk_base::AsyncSocket*, sigslot::single_threaded>::emit (this=0x10201a380, a1=0x10201a878)
at sigslot.h:1852
#16 0x00000001039b529e in sigslot::signal1<talk_base::AsyncSocket*, sigslot::single_threaded>::operator() (this=0x10201a880, a1=0x10201a878) at sigslot.h:2346
#17 0x00000001039b169b in talk_base::SocketDispatcher::OnEvent (this=0x10201a870, ff=1, err=0) at talk/base/physicalsocketserver.cc:893
#18 0x00000001039aa0bf in talk_base::PhysicalSocketServer::Wait (this=0x10210d9d0, cmsWait=20, process_io=true) at talk/base/physicalsocketserver.cc:1409
#19 0x0000000103991827 in talk_base::MessageQueue::Get (this=0x102010280, pmsg=0x102786e40, cmsWait=-1, process_io=true) at talk/base/messagequeue.cc:266
#20 0x00000001039d7456 in talk_base::Thread::ProcessMessages (this=0x102010280, cmsLoop=-1) at talk/base/thread.cc:499
#21 0x00000001039d7398 in talk_base::Thread::Run (this=0x102010280) at talk/base/thread.cc:365
#22 0x00000001039d7241 in talk_base::Thread::PreRun (pv=0x100d03fc0) at talk/base/thread.cc:353
#23 0x00007fff8a2398bf in _pthread_start ()
#24 0x00007fff8a23cb75 in thread_start ()

@fuson
Copy link
Author

fuson commented Oct 18, 2013

my OpenSSL 0.9.8y 5 Feb 2013

@fuson
Copy link
Author

fuson commented Oct 18, 2013

well guys, I MADE IT! :) Root of evil was in openssl version on mac. Step by step instruction:

brew install openssl
brew link --force openssl (you may need to run chmod for some permissions)
export LDFLAGS=-L/usr/local/opt/openssl/lib
export CPPFLAGS=-I/usr/local/opt/openssl/include
cd ./lib/libwebrtc/trunk
make (it build only DEBUG, ninja was non functional in my case)

then go to the module dir and:
change gyp file
set debug source of libs: 'libwebrtc_out%': '<(libwebrtc)/out/Debug/obj'
add '-framework Cocoa ' in linking libraries for mac,
add '-L/usr/local/opt/openssl/lib' in link_settings.ldflags
add '/usr/local/opt/openssl/include' in include_dirs

then:
node-gyp rebuild --debug

And be happy :)

@piranna
Copy link
Contributor

piranna commented Oct 19, 2013

Couldn't be this steps done automatically by the gyp file, maybe with some
global vars? With make, you are able to check for LINUX_ or MACOS or
WIN32 global environment variables for conditional compilation...

2013/10/19 Aleksey Mihailiuk notifications@github.com

well guys, I MADE IT! :) Root of evil was in openssl version on mac. Step
by step instruction:

brew install openssl
brew link --force openssl (you may need to run chmod for some permissions)
export LDFLAGS=-L/usr/local/opt/openssl/lib
export CPPFLAGS=-I/usr/local/opt/openssl/include
cd ./lib/libwebrtc/trunk
make (it build only DEBUG)

then:
change gyp file
set debug source of libs: 'libwebrtc_out%': '<(libwebrtc)/out/Debug/obj'
add '-framework Cocoa ' in linking libraries for mac,
add '-L/usr/local/opt/openssl/lib' in link_settings.ldflags
add '/usr/local/opt/openssl/include' in include_dirs

then:
node-gyp rebuild --debug

And be happy :)


Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-26635758
.

"Si quieres viajar alrededor del mundo y ser invitado a hablar en un monton
de sitios diferentes, simplemente escribe un sistema operativo Unix."
– Linus Tordvals, creador del sistema operativo Linux

@modeswitch
Copy link

If you make a pull request for these changes I'll review and merge.

@fuson
Copy link
Author

fuson commented Oct 21, 2013

As i see, helloIAmPau is working on builds, and i hope he read project issue list and take into consideration my small exploration and experiments.

@helloIAmPau
Copy link
Contributor

I've just now read this issue. I'm fixing this.

@helloIAmPau
Copy link
Contributor

@modeswitch I've added the @fuson changes, but it still doesn't work. Please refer to my fork for more informations: https://github.com/helloIAmPau/node-webrtc

@fuson
Copy link
Author

fuson commented Oct 22, 2013

First what i see is that you linking Release build but 'make' build only Debug build when i'm playing with it.

@helloIAmPau
Copy link
Contributor

By passing BUILDTYPE=Release to make, it compiles in Release mode. The linking path is properly set.

@modeswitch
Copy link

I've updated the package on npm. Please give it a try and open new issues for problems you find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants