冰候选人委托方法调用时发生崩溃

在这里输入图像描述 请帮助是什么问题。

webrtc库调用一些内部方法并获取excess_bad。 并坠毁

如有需要,请提供更多信息。

//码

 let iceServer = RTCICEServer(uri:URL(string: resturi), username: “***”, password: “***”)

// Enable SSL globally for WebRTC in our app
let pcFactory:RTCPeerConnectionFactory = RTCPeerConnectionFactory()

let rtcConfiguration = RTCConfiguration()
rtcConfiguration.iceServers = [iceServer!]

let pair1 = RTCPair(key: "OfferToReceiveAudio", value: "true")
let pair2 = RTCPair(key: "OfferToReceiveVideo", value: "false")

let pair3 = RTCPair(key: "DtlsSrtpKeyAgreement", value: "true")

self.mediaConstraints = RTCMediaConstraints(mandatoryConstraints: [pair1!,pair2!], optionalConstraints:[pair3!])

 // Create the peer connection using the ICE server list and the current class as the delegate

    let localStream:RTCMediaStream = pcFactory.mediaStream(withLabel: “12345”)
    let audioTrack:RTCAudioTrack = pcFactory.audioTrack(withID: “123456”)
    audioTrack.delegate = self

    let status = localStream.addAudioTrack(audioTrack)

 self.peerConnection = pcFactory.peerConnection(with: rtcConfiguration, constraints: self.mediaConstraints!, delegate: self)

  let pstatus = self.peerConnection!.add(localStream)

  print(status)
  print(pstatus)

//Let’s look at how the offer is created, which initiates the call.
 self.peerConnection!.createOffer(with: self, constraints: self.mediaConstraints)

我正在这里喝酒。

public func peerConnection(_ peerConnection: RTCPeerConnection!, didCreateSessionDescription sdp: RTCSessionDescription!, error: Error!)

这位代表打来电话时发生崩溃。

func peerConnection(_ peerConnection: RTCPeerConnection!, gotICECandidate candidate: RTCICECandidate!)

崩溃报告

异常类型:EXC_BAD_ACCESS(SIGSEGV)异常子类型:KERN_INVALID_ADDRESS 0x5000000000000038终止信号:分段错误:11终止原因:命名空间SIGNAL,代码0xb终止进程:exc handler [0]由​​Thread:9触发

已筛选的系统日志:未找到

线程0名称:调度队列:com.apple.main-thread线程0:0
libsystem_kernel.dylib 0x000000018f58816c mach_msg_trap + 8 1 libsystem_kernel.dylib 0x000000018f587fdc mach_msg + 72 2
CoreFoundation 0x0000000190585cec __CFRunLoopServiceMachPort + 192 3 CoreFoundation 0x0000000190583908 __CFRunLoopRun + 1132 4 CoreFoundation
0x00000001904b2048 CFRunLoopRunSpecific + 444 5 GraphicsServices
0x0000000191f35198 GSEventRunModal + 180 6 UIKit
0x000000019648b818 - [UIApplication _run] + 684 7 UIKit
0x0000000196486550 UIApplicationMain + 208 8 Shukran
0x0000000100080a1c 0x10007c000 + 18972 9 libdyld.dylib
0x000000018f4945b8开始+ 4

线程1名称:com.apple.uikit.eventfetch-thread线程1:0
libsystem_kernel.dylib 0x000000018f58816c mach_msg_trap + 8 1 libsystem_kernel.dylib 0x000000018f587fdc mach_msg + 72 2
CoreFoundation 0x0000000190585cec CFRunLoopServiceMachPort + 192 3 CoreFoundation 0x0000000190583908 __CFRunLoopRun + 1132 4 CoreFoundation
0x00000001904b2048 CFRunLoopRunSpecific + 444 5基金会
0x0000000190fc0b1c - [NSRunLoop(NSRunLoop)runMode:beforeDate:] + 304 6 Foundation 0x0000000190fe160c - [NSRunLoop(NSRunLoop)runUntilDate:] + 96 7 UIKit 0x0000000196e00e6c - [UIEventFetcher threadMain] + 136 8 Foundation 0x00000001910be50c __NSThread__start + 1024 9
libsystem_pthread.dylib 0x000000018f66b860 _pthread_body + 240 10 libsystem_pthread.dylib 0x000000018f66b770 _pthread_body + 0 11 libsystem_pthread.dylib 0x000000018f668dbc thread_start + 4

线程2名称:AVAudioSession通知线程线程2:0
libsystem_kernel.dylib 0x000000018f58816c mach_msg_trap + 8 1 libsystem_kernel.dylib 0x000000018f587fdc mach_msg + 72 2
CoreFoundation 0x0000000190585cec __CFRunLoopServiceMachPort + 192 3 CoreFoundation 0x0000000190583908 __CFRunLoopRun + 1132 4 CoreFoundation
0x00000001904b2048 CFRunLoopRunSpecific + 444 5 AVFAudio
0x00000001a9baafe8 GenericRunLoopThread :: Entry(void *)+ 164 6
AVFAudio 0x00000001a9bd0f14 CAPThread :: Entry(CAPThread *)+ 84 7 libsystem_pthread.dylib
0x000000018f66b860 _pthread_body + 240 8 libsystem_pthread.dylib
0x000000018f66b770 _pthread_body + 0 9 libsystem_pthread.dylib
0x000000018f668dbc thread_start + 4

线程3名称:com.apple.NSURLConnectionLoader线程3:0
libsystem_kernel.dylib 0x000000018f58816c mach_msg_trap + 8 1 libsystem_kernel.dylib 0x000000018f587fdc mach_msg + 72 2
CoreFoundation 0x0000000190585cec CFRunLoopServiceMachPort + 192 3 CoreFoundation 0x0000000190583908 __CFRunLoopRun + 1132 4 CoreFoundation
0x00000001904b2048 CFRunLoopRunSpecific + 444 5 CFNetwork
0x0000000190c9fcec + [NSURLConnection(Loader)_resourceLoadLoop:] + 336 6 Foundation 0x00000001910be50c __NSThread__start + 1024 7 libsystem_pthread.dylib 0x000000018f66b860 _pthread_body + 240 8 libsystem_pthread.dylib
0x000000018f66b770 _pthread_body + 0 9 libsystem_pthread.dylib
0x000000018f668dbc thread_start + 4

线程4:0 libsystem_pthread.dylib 0x000000018f668db0 start_wqthread + 0

线程5:0 libsystem_kernel.dylib 0x000000018f5a6a88 __workq_kernreturn + 8 1 libsystem_pthread.dylib 0x000000018f669188 _pthread_wqthread + 968 2
libsystem_pthread.dylib 0x000000018f668db4 start_wqthread + 4

线程6:0 libsystem_pthread.dylib 0x000000018f668db0 start_wqthread + 0

线程7:0 libsystem_kernel.dylib 0x000000018f5a5e1c __psynch_cvwait + 8 1 libsystem_pthread.dylib 0x000000018f66a9d0 _pthread_cond_wait + 640 2 Shukran
0x000000010030009c 0x10007c000 + 2637980 3 libsystem_pthread.dylib 0x000000018f66b860 _pthread_body + 240 4 libsystem_pthread.dylib
0x000000018f66b770 _pthread_body + 0 5 libsystem_pthread.dylib
0x000000018f668dbc thread_start + 4

线程8:0 libsystem_kernel.dylib 0x000000018f5a623c __select + 8 1 Shukran 0x00000001003004d0 0x10007c000 + 2639056 2 libsystem_pthread.dylib
0x000000018f66b860 _pthread_body + 240 3 libsystem_pthread.dylib
0x000000018f66b770 _pthread_body + 0 4 libsystem_pthread.dylib
0x000000018f668dbc thread_start + 4

线程9名称:VoiceProcessThread线程9崩溃:0 Shukran
0x00000001001956ac 0x10007c000 + 1152684 1 Shukran
0x000000010019569c 0x10007c000 + 1152668 2 Shukran
0x0000000100168688 0x10007c000 + 968328 3 Shukran
0x0000000100191020 0x10007c000 + 1134624 4 Shukran
0x000000010033b1bc 0x10007c000 + 2879932 5 Shukran
0x00000001002d906c 0x10007c000 + 2478188 6 Shukran
0x00000001002d8670 0x10007c000 + 2475632 7舒克兰
0x00000001002ca330 0x10007c000 + 2417456 8舒克兰
0x00000001004293f0 0x10007c000 + 3855344 9舒克兰
0x00000001002fb010 0x10007c000 + 2617360 10 Shukran
0x00000001002faf94 0x10007c000 + 2617236 11 libsystem_pthread.dylib 0x000000018f66b860 _pthread_body + 240 12 libsystem_pthread.dylib
0x000000018f66b770 _pthread_body + 0 13 libsystem_pthread.dylib
0x000000018f668dbc thread_start + 4

线程10名称:PacerThread线程10:0 libsystem_kernel.dylib
0x000000018f5a5e1c __psynch_cvwait + 8 1 libsystem_pthread.dylib
0x000000018f66a9d0 _pthread_cond_wait + 640 2 Shukran
0x000000010028548c 0x10007c000 + 2135180 3 Shukran
0x00000001002f7544 0x10007c000 + 2602308 4 Shukran
0x00000001004294f0 0x10007c000 + 3855600 5舒克兰
0x00000001002fb010 0x10007c000 + 2617360 6舒克兰
0x00000001002faf94 0x10007c000 + 2617236 7 libsystem_pthread.dylib 0x000000018f66b860 _pthread_body + 240 8 libsystem_pthread.dylib
0x000000018f66b770 _pthread_body + 0 9 libsystem_pthread.dylib
0x000000018f668dbc thread_start + 4

线程11名称:ModuleProcessThread线程11:0
libsystem_kernel.dylib 0x000000018f5a5e1c __psynch_cvwait + 8 1 libsystem_pthread.dylib 0x000000018f66a9d0 _pthread_cond_wait + 640 2 Shukran 0x000000010028548c 0x10007c000 + 2135180 3 Shukran
0x00000001002f7544 0x10007c000 + 2602308 4 Shukran
0x00000001004294f0 0x10007c000 + 3855600 5舒克兰
0x00000001002fb010 0x10007c000 + 2617360 6舒克兰
0x00000001002faf94 0x10007c000 + 2617236 7 libsystem_pthread.dylib 0x000000018f66b860 _pthread_body + 240 8 libsystem_pthread.dylib
0x000000018f66b770 _pthread_body + 0 9 libsystem_pthread.dylib
0x000000018f668dbc thread_start + 4

线程9与ARM线程状态(64位)崩溃:x0:0x000000010303c100 x1:0x0000000000000000 x2:0x0000000000000000 x3:0x00000001024694e8 x4:0x0000000000000000 x5:0x0000000000000010 x6:0x0000000000000002 x7:0x000000016e54a45c x8:0x5000000000000000 x9:0x0000000000000000 x10:0x000000016e54b818 x11:0x0000000000000000 x12 :0x03e0fe0003e0fe00 X13:0x000000018f66b770 X14:0x000000018f668dbc X15:0x0000000000000010 X16:0x000000018f669ab8 X17:0x0000000000000001 X18:0x0000000000000000 X19:0x0000000000000004 X20:0x0000000104082e00 X21:0x00000001702a42c0 X22:0x000000016e54a278 X23:0x00000001702a42e8 X24:0x000000016e54a240 X25:0x00000001702a42c8 X26:0x00000001702a42e0 X27:0xd96031967698005a
x28:0x0000000000000000 fp:0x000000016e54a1f0 lr:0x000000010019569c sp:0x000000016e549b10 pc:0x00000001001956ac cpsr:0x60000000


请检查你的iceServer是否运行正常,我已经使用了iceServers并解决了崩溃。 或者你可以建立你自己的STUN server 。 这可能是导致事故发生的原因之一。

let iceServer1:RTCICEServer = RTCICEServer.init(uri: URL.init(string: "stun:stun.l.google.com:19302"), username: "", password: "")

要么

let iceServer2:RTCICEServer = RTCICEServer.init(uri: URL.init(string: "turn:numb.viagenie.ca"), username: "webrtc@live.com", password: "muazkh")
链接地址: http://www.djcxy.com/p/93627.html

上一篇: Getting crash when ice candidate delegate method called

下一篇: libobjc.A.dylib crashed?how can i debug?