QuickBlox / quickblox-ios-sdk

QuickBlox iOS SDK for messaging and video calling
https://quickblox.com/developers/IOS
MIT License
397 stars 358 forks source link

The application crashes when calling from a web application #914

Closed DaskiOFF closed 6 years ago

DaskiOFF commented 6 years ago

New Issue Checklist

Environment details

Info Value
iOS Version 11.0
Quickblox iOS SDK version 2.14
QuickbloxWebRTC SDK version 2.6.3
Xcode Version Xcode 9.1

Did this work before? Yes

Expected behavior During an incoming call is invoked func didReceiveNewSession(_ session: QBRTCSession, userInfo: [String : String]? = nil)

Actual behavior During a call, from our website (version 2.7.0 js SDK) The following happens (the logs are below or here (Gist))

Application crash during before calling func didReceiveNewSession(_ session: QBRTCSession, userInfo: [String : String]? = nil)

If you call our app from your test application, then everything is fine

Logs

Actual behavior logs ```logos 2017-11-23 12:56:52.723 rtc::[Signaling Processor] - Did receive signal: call from: 36894006 2017-11-23 12:56:52.724926+0300 MobileDoctor[20004:6593902] [ChatService]: RCV: 585a9231-42c5-41cf-847d-a53f0e5b7e38 1 36894006 37675630 v=0 o=- 9016391303964378858 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE audio video a=msid-semantic: WMS 696a3efd-5e8c-44fb-9eb3-2cc686ffca90 m=audio 1 RTP/SAVPF 111 103 104 0 8 106 105 13 126 c=IN IP4 0.0.0.0 a=rtcp:1 IN IP4 0.0.0.0 a=ice-ufrag:7zIt5FnSbDlfz5Rq a=ice-pwd:0WzXkpD7jtD89YGn5UXOAFbE a=ice-options:google-ice a=fingerprint:sha-256 5A:63:08:D0:D0:29:F5:4C:9B:95:17:71:06:18:DB:BC:16:29:4D:0F:1C:A3:7D:FD:D7:C7:03:76:BA:E2:BE:74 a=setup:actpass a=mid:audio a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=sendrecv a=rtcp-mux a=rtpmap:111 opus/48000/2 a=fmtp:111 minptime=10 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:126 telephone-event/8000 a=maxptime:60 a=ssrc:3851596435 cname:PqI75kSgUsE9ywAN a=ssrc:3851596435 msid:696a3efd-5e8c-44fb-9eb3-2cc686ffca90 029bf6e4-19b7-49ed-ae70-f23305318138 a=ssrc:3851596435 mslabel:696a3efd-5e8c-44fb-9eb3-2cc686ffca90 a=ssrc:3851596435 label:029bf6e4-19b7-49ed-ae70-f23305318138 m=video 1 RTP/SAVPF 100 116 117 96 c=IN IP4 0.0.0.0 a=rtcp:1 IN IP4 0.0.0.0 a=ice-ufrag:7zIt5FnSbDlfz5Rq a=ice-pwd:0WzXkpD7jtD89YGn5UXOAFbE a=ice-options:google-ice a=fingerprint:sha-256 5A:63:08:D0:D0:29:F5:4C:9B:95:17:71:06:18:DB:BC:16:29:2017-11-23 12:56:52.733 rtc::[RTCClient] Initializing SSL... 4D:0F:1C:A3:7D:FD:D7:C7:03:76:BA:E2:BE:74 a=setup:actpass a=mid:video a=extmap:2 urn:ietf:params:rtp-hdrext:toffset a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=sendrecv a=rtcp-mux a=rtpmap:100 VP8/90000 a=rtcp-fb:100 ccm fir a=rtcp-fb:100 nack a=rtcp-fb:100 nack pli a=rtcp-fb:100 goog-remb a=rtpmap:116 red/90000 a=rtpmap:117 ulpfec/90000 a=rtpmap:96 rtx/90000 a=fmtp:96 apt=100 a=ssrc-group:FID 3959075012 1577350557 a=ssrc:3959075012 cname:PqI75kSgUsE9ywAN a=ssrc:3959075012 msid:696a3efd-5e8c-44fb-9eb3-2cc686ffca90 4791ade5-2634-4b8e-98df-9e8281d304e3 a=ssrc:3959075012 mslabel:696a3efd-5e8c-44fb-9eb3-2cc686ffca90 a=ssrc:3959075012 label:4791ade5-2634-4b8e-98df-9e8281d304e3 a=ssrc:1577350557 cname:PqI75kSgUsE9ywAN a=ssrc:1577350557 msid:696a3efd-5e8c-44fb-9eb3-2cc686ffca90 4791ade5-2634-4b8e-98df-9e8281d304e3 a=ssrc:1577350557 mslabel:696a3efd-5e8c-44fb-9eb3-2cc686ffca90 a=ssrc:1577350557 label:4792017-11-23 12:56:52.740 rtc::Create audio track: RTCMediaStreamTrack: kind:audio, id:audioTrack, enabled, state:Live 2017-11-23 12:56:52.745 rtc::[VSND] Init. 1ade5-2634-4b8e-98df-9e8281d304e3 WebRTCVideoChat call web 2017-11-23 12:56:52:719 MobileDoctor[20004:111f] RECV: 585a9231-42c5-41cf-847d-a53f0e5b7e3813689400637675630v=0 o=- 9016391303964378858 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE audio video a=msid-semantic: WMS 696a3efd-5e8c-44fb-9eb3-2cc686ffca90 m=audio 1 RTP/SAVPF 111 103 104 0 8 106 105 13 126 c=IN IP4 0.0.0.0 a=rtcp:1 IN IP4 0.0.0.0 a=ice-ufrag:7zIt5FnSbDlfz5Rq a=ice-pwd:0WzXkpD7jtD89YGn5UXOAFbE a=ice-options:google-ice a=fingerprint:sha-256 5A:63:08:D0:D0:29:F5:4C:9B:95:17:71:06:18:DB:BC:16:29:4D:0F:1C:A3:7D:FD:D7:C7:03:76:BA:E2:BE:74 a=setup:actpass a=mid:audio a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=sendrecv a=rtcp-mux a=rtpmap:111 opus/48000/2 a=fmtp:111 minptime=10 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:126 telephone-event/8000 a=maxptime:60 a=ssrc:3851596435 cname:PqI75kSgUsE9ywAN a=ssrc:3851596435 msid:696a3efd-5e8c-44fb-9eb3-2cc686ffca90 029bf6e4-19b7-49ed-ae70-f23305318138 a=ssrc:3851596435 mslabel:696a3efd-5e8c-44fb-9eb3-2cc686ffca90 a=ssrc:3851596435 label:029bf6e4-19b7-49ed-ae70-f23305318138 m=video 1 RTP/SAVPF 100 116 117 96 c=IN IP4 0.0.0.0 a=rtcp:1 IN IP4 0.0.0.0 a=ice-ufrag:7zIt5FnSbDlfz5Rq a=ice-pwd:0WzXkpD7jtD89YGn5UXOAFbE a=ice-options:google-ice a=fingerprint:sha-256 5A:63:08:D0:D0:29:F5:4C:9B:95:17:71:06:18:DB:BC:16:29:4D:0F:1C:A3:7D:FD:D7:C7:03:76:BA:E2:BE:74 a=setup:actpass a=mid:video a=extmap:2 urn:ietf:params:rtp-hdrext:toffset a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=sendrecv a=rtcp-mux a=rtpmap:100 VP8/90000 a=rtcp-fb:100 ccm fir a=rtcp-fb:100 nack a=rtcp-fb:100 nack pli a=rtcp-fb:100 goog-remb a=rtpmap:116 red/90000 a=rtpmap:117 ulpfec/90000 a=rtpmap:96 rtx/90000 a=fmtp:96 apt=100 a=ssrc-group:FID 3959075012 1577350557 a=ssrc:3959075012 cname:PqI75kSgUsE9ywAN a=ssrc:3959075012 msid:696a3efd-5e8c-44fb-9eb3-2cc686ffca90 4791ade5-2634-4b8e-98df-9e8281d304e3 a=ssrc:3959075012 mslabel:696a3efd-5e8c-44fb-9eb3-2cc686ffca90 a=ssrc:3959075012 label:4791ade5-2634-4b8e-98df-9e8281d304e3 a=ssrc:1577350557 cname:PqI75kSgUsE9ywAN a=ssrc:1577350557 msid:696a3efd-5e8c-44fb-9eb3-2cc686ffca90 4791ade5-2634-4b8e-98df-9e8281d304e3 a=ssrc:1577350557 mslabel:696a3efd-5e8c-44fb-9eb3-2cc686ffca90 a=ssrc:1577350557 label:4791ade5-2634-4b8e-98df-9e8281d304e3 WebRTCVideoChatcallweb 2017-11-23 12:56:52.746 rtc::[VSND] Start 2017-11-23 12:56:52.754 rtc::Create video track: RTCMediaStreamTrack: kind:video, id:videoTrack, enabled, state:Live 2017-11-23 12:56:52.755 rtc::initialize - QBRTCRecorder 2017-11-23 12:56:52.755 rtc::[SESS]<585a9231-42c5-41cf-847d-a53f0e5b7e38, I:36894006, O:[37675630], T:V> Init. 2017-11-23 12:56:52.757 rtc::[TASK] Start. 2017-11-23 12:56:52.757 rtc::[RTCClient] created new [SESS]<585a9231-42c5-41cf-847d-a53f0e5b7e38, I:36894006, O:[37675630], T:V> 2017-11-23 12:56:52.759521+0300 MobileDoctor[20004:6592743] -[__NSCFConstantString count]: unrecognized selector sent to instance 0x103b5b2b0 2017-11-23 12:56:52.760188+0300 MobileDoctor[20004:6592743] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFConstantString count]: unrecognized selector sent to instance 0x103b5b2b0' *** First throw call stack: (0x1868e7d38 0x185dfc528 0x1868f51f8 0x1868ed6e4 0x1867d30dc 0x106c0c27c 0x102215560 0x1868ef6a0 0x1867ce820 0x1867d322c 0x1041e104c 0x106f9949c 0x106f9945c 0x106f9e050 0x18688ff20 0x18688dafc 0x1867ae2d8 0x18863ff84 0x18fd5b880 0x102204f30 0x1862d256c) libc++abi.dylib: terminating with uncaught exception of type NSException ```
Raikerian commented 6 years ago

Hi,

According to logs crash is somewhere in your application:

2017-11-23 12:56:52.759521+0300 MobileDoctor[20004:6592743] -[NSCFConstantString count]: unrecognized selector sent to instance 0x103b5b2b0 2017-11-23 12:56:52.760188+0300 MobileDoctor[20004:6592743] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFConstantString count]: unrecognized selector sent to instance 0x103b5b2b0' *** First throw call stack:

You are sending an unrecognized selector. In order to catch this add exception for all exceptions: http://blog.manbolo.com/2012/01/23/xcode-tips-1-break-on-exceptions

DaskiOFF commented 6 years ago

Hello,

Why it happens only when we call from our web application? If you call from your test application into our iOS application, then everything is fine.

I think if it was a problem in our code, I'd get the session in the callback function func didReceiveNewSession(_ session: QBRTCSession, userInfo: [String : String]? = nil) otherwise, why with your example I get through, and from our server no?

But this is not happening, the app crashes before that.

Is there a way to verify that the problem is from our side? Given the fact that the test application the call succeeds

Raikerian commented 6 years ago

Have you set up all exceptions? The link is provided in my previous answer. It should point out the exact line where it is crashing.

You can also call to our sample app from our web sample to test: http://samples.quickblox.com/web/webrtc/?creds=test#dashboard

DaskiOFF commented 6 years ago

Yes, I set up all exceptions.

Line crashing which indicates Xcode is class AppDelegate: UIResponder, UIApplicationDelegate {

In the near future will try to call from the web application in your example application and I will report on the results.

Thank you

Raikerian commented 6 years ago

Please also check this issue https://github.com/QuickBlox/quickblox-ios-sdk/issues/797 It might be related to yours.

DaskiOFF commented 6 years ago

Hi, we have been able to call in your example application, but we still continue to Crash in our application.

I tried to find a solution and here's what happened:

Example Our QBCore


DaskiOFF commented 6 years ago

Error was found! For Swift 3.2

In xcode wrong interface generation for header files, in particular xcode generated method: func didReceiveNewSession(_ session: QBRTCSession, users: [string : string]? = nil)

and should be: func didReceiveNewSession(_ session: QBRTCSession, users: Any!)