Random crash when creating RTCDataChannel on iOS

167 views
Skip to first unread message

Xavi R. Pinteño

unread,
Jan 19, 2017, 5:37:02 AM1/19/17
to discuss-webrtc
Hello,
   I'm currently using iOS framework r15970 though I've seen it also in few older ones.
I create an RTCDataChannel like this, so nothing special, label is just a regular NSString containing a text.

self.dataChannel = [self.peerConnection dataChannelForLabel:label configuration:[[RTCDataChannelConfiguration alloc] init]];


But from time to time, very seldom, I get a report from crashlytics which says:
Invalid parameter not satisfying: nativeDataChannel

Issue comes from RTCPeerConnection+DataChannel.mm when creating a DataChannel.
Has anyone encounter this at all? Since I'm using default configuration I'm almost certain I'm doing nothing wrong on that call.

Best regards


Zeke Chin

unread,
Jan 19, 2017, 9:20:59 PM1/19/17
to discuss-webrtc, dead...@webrtc.org
--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/8a28d9ca-afb5-4ba4-b402-3667de37cd11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Taylor Brandstetter

unread,
Jan 19, 2017, 9:50:58 PM1/19/17
to Zeke Chin, discuss-webrtc, dead...@webrtc.org
The most likely reasons I can think of:
  • PeerConnection is closed.
  • Config is invalid (which couldn't happen with your code snippet).
  • Ran out of SCTP stream IDs, which should only happen if you created (and didn't close) 512 data channels.
You may be able to find an error message in the native log.


On Thu, Jan 19, 2017 at 6:20 PM, Zeke Chin <tkc...@webrtc.org> wrote:
On Thu, Jan 19, 2017 at 2:37 AM Xavi R. Pinteño <fri...@gmail.com> wrote:
Hello,
   I'm currently using iOS framework r15970 though I've seen it also in few older ones.
I create an RTCDataChannel like this, so nothing special, label is just a regular NSString containing a text.

self.dataChannel = [self.peerConnection dataChannelForLabel:label configuration:[[RTCDataChannelConfiguration alloc] init]];


But from time to time, very seldom, I get a report from crashlytics which says:
Invalid parameter not satisfying: nativeDataChannel

Issue comes from RTCPeerConnection+DataChannel.mm when creating a DataChannel.
Has anyone encounter this at all? Since I'm using default configuration I'm almost certain I'm doing nothing wrong on that call.

Best regards


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.

Xavi R. Pinteño

unread,
Jan 20, 2017, 3:41:22 AM1/20/17
to discuss-webrtc, tkc...@webrtc.org, dead...@webrtc.org

Yep, I know the one I am hitting is during dataChannel creation. This pattern is the one I encounter in every crash (6 crashes in the last 45 days).

4  WebRTC -[RTCDataChannel initWithNativeDataChannel:] (RTCDataChannel.mm:170)
5  WebRTC -[RTCPeerConnection(DataChannel) dataChannelForLabel:configuration:] (RTCPeerConnection+DataChannel.mm:28)
6  Z             __24-[ZPeerData createOffer]_block_invoke (ZPeerData.m:83)

I haven't been able to reproduce this in any of my tests, so not much clue about what the native log would be saying :/
  • PeerConnection is closed.
  • Config is invalid (which couldn't happen with your code snippet).
  • Ran out of SCTP stream IDs, which should only happen if you created (and didn't close) 512 data channels.
You may be able to find an error message in the native log.

On Thu, Jan 19, 2017 at 6:20 PM, Zeke Chin <tkc...@webrtc.org> wrote:
On Thu, Jan 19, 2017 at 2:37 AM Xavi R. Pinteño <fri...@gmail.com> wrote:
Hello,
   I'm currently using iOS framework r15970 though I've seen it also in few older ones.
I create an RTCDataChannel like this, so nothing special, label is just a regular NSString containing a text.

self.dataChannel = [self.peerConnection dataChannelForLabel:label configuration:[[RTCDataChannelConfiguration alloc] init]];


But from time to time, very seldom, I get a report from crashlytics which says:
Invalid parameter not satisfying: nativeDataChannel

Issue comes from RTCPeerConnection+DataChannel.mm when creating a DataChannel.
Has anyone encounter this at all? Since I'm using default configuration I'm almost certain I'm doing nothing wrong on that call.

Best regards


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Zeke Chin

unread,
Jan 20, 2017, 6:22:56 PM1/20/17
to Xavi R. Pinteño, discuss-webrtc, dead...@webrtc.org
Can you file a bug? The right thing to do from ObjC standpoint is to make sure we're not getting nullptr, and to mark the return value for the factory method in peerconnection nullable.
That way, we at least won't crash. But we probably need more logs to debug underlying issue.

Luís Antonio De Marchi

unread,
Feb 14, 2017, 1:43:48 AM2/14/17
to discuss-webrtc



2017-02-13 23:49:51.279551 WebRTCDemo[1454:304850] *** Assertion failure in -[RTCDataChannel initWithNativeDataChannel:], ../../webrtc/sdk/objc/Framework/Classes/RTCDataChannel.mm:170

2017-02-13 23:49:51.280737 WebRTCDemo[1454:304850] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: nativeDataChannel'

*** First throw call stack:

(0x1e7e4df7 0x1da47077 0x1e7e4cd1 0x1f0df931 0x424bad 0x42b459 0xd24b4 0xd2954 0xc972c 0xca67c 0xcf304 0xc4030 0x365c68 0x369040 0x3627d0 0x1125ba9 0x1116d43 0x111b5e1 0x1e7a04a7 0x1e79e78f 0x1e6ed533 0x1e6ed341 0x1fec4bfd 0x238fbe67 0x238f6591 0xd6390 0x1deb750b)

libc++abi.dylib: terminating with uncaught exception of type NSException

Xavi R. Pinteño

unread,
Mar 18, 2017, 9:25:01 AM3/18/17
to discuss-webrtc
I have just filed a bug report. I hadn't seen the issue in a while.
Reply all
Reply to author
Forward
0 new messages