EricssonResearch / openwebrtc-ios-sdk

SDK for adding OpenWebRTC to your iOS apps using CocoaPods
BSD 2-Clause "Simplified" License
69 stars 37 forks source link

IOS Version crash randomly #63

Open songzhe1988 opened 8 years ago

songzhe1988 commented 8 years ago

Hi there, I ran across a issue that the IOS app that I built (actually I just made another view controller in the native demo) randomly crashes during the video chat, throwing a EXC_BAD_ACCESS exception:(gstglcontext(14):EXC_BAD_ACCESS (code=1,address=0x30)) on gst_glimage_sink_on_draw. I have no idea what is going on here, did I made a mistake somewhere or it's a bug from the sdk? Thanks.

nevyn commented 8 years ago

I get the same error. Unprovoked after just leaving it for a few minutes without touching, it crashes at gst_glimage_sink_on_draw. Stack trace:

(lldb) bt
NativeDemo was compiled with optimization - stepping may behave oddly; variables may not be available.
* thread #13: tid = 0x281b4, 0x000000018ed2ef4c IOAccelerator`IOAccelResourceGetResidentDataSize, name = 'gstglcontext', stop reason = EXC_BAD_ACCESS (code=1, address=0x30)
    frame #0: 0x000000018ed2ef4c IOAccelerator`IOAccelResourceGetResidentDataSize
    frame #1: 0x00000001816f01e0 AGXGLDriver`AGXAllocationBindings<AGXAllocationHashTable>::bindResourceToHardwareCommand(AGXStreamHardwareCommandRec*, unsigned int, __IOAccelResource*, unsigned int, int*, bool, unsigned long) + 240
    frame #2: 0x00000001816b3520 AGXGLDriver`agxuAllocateHardwareRenderCommand(AGXContextRec*, unsigned long, unsigned int) + 328
    frame #3: 0x00000001816b3688 AGXGLDriver`agxuBeginRenderCommand(AGXContextRec*, BeginRenderCommandFlags) + 268
    frame #4: 0x00000001816ae0ac AGXGLDriver`agxuCoalescedClear(AGXContextRec*) + 200
    frame #5: 0x000000018672fd64 GLEngine`glClear_Exec + 432
    frame #6: 0x0000000101746488 libglInterpose.dylib`clear(__GLIContextRec*, unsigned int) + 264
  * frame #7: 0x0000000100128074 NativeDemo`gst_glimage_sink_on_draw(gl_sink=0x00000001048d8560) + 500 at gstglimagesink.c:2011 [opt]
    frame #8: 0x00000001004938a8 NativeDemo`draw_cb(data=<unavailable>) + 220 at gstglwindow_eagl.m:161 [opt]
    frame #9: 0x0000000100490cb8 NativeDemo`_run_message_sync(message=0x000000016e9ecd60) + 36 at gstglwindow.c:607 [opt]
    frame #10: 0x0000000100490cf8 NativeDemo`_run_message_async(message=0x0000000104f9c6c0) + 32 at gstglwindow.c:676 [opt]
    frame #11: 0x00000001003715e4 NativeDemo`g_main_context_dispatch + 192 at gmain.c:3237 [opt]
    frame #12: 0x0000000100371524 NativeDemo`g_main_context_dispatch(context=0x000000014f15f2d0) + 52 at gmain.c:3898 [opt]
    frame #13: 0x0000000100371924 NativeDemo`g_main_context_iterate(context=<unavailable>, block=<unavailable>, dispatch=<unavailable>, self=<unavailable>) + 440 at gmain.c:3969 [opt]
    frame #14: 0x0000000100371c18 NativeDemo`g_main_loop_run(loop=0x000000014dfcacd0) + 244 at gmain.c:4163 [opt]
    frame #15: 0x000000010048bf48 NativeDemo`gst_gl_context_create_thread(context=0x00000001039e7280) + 512 at gstglcontext.c:1226 [opt]
    frame #16: 0x000000010035bd90 NativeDemo`g_thread_proxy(data=0x0000000104709f40) + 92 at gthread.c:778 [opt]
    frame #17: 0x00000001988abb28 libsystem_pthread.dylib`_pthread_body + 156
    frame #18: 0x00000001988aba8c libsystem_pthread.dylib`_pthread_start + 156
    frame #19: 0x00000001988a9028 libsystem_pthread.dylib`thread_start + 4
cwack-letsdev commented 8 years ago

Hey just I had the same issue. Did you solve it?

xelven commented 8 years ago

seems draw_cb problem still had now?

I guess are same issue with https://github.com/EricssonResearch/openwebrtc-ios-sdk/issues/27 take look at my solution first.

cwack-letsdev commented 8 years ago

OK thanks. I'll try it out. The issue doesn't happen so often. Do you have a way to get it reproduced to verify if it's fixed?

xelven commented 8 years ago

In my version, it is in any video chat then press home button let that app goes background, then the issue will 100% happened. since when the app going background and draw_cb still callback from glwindow to redraw the video frame but the handler is unavailable anymore.

xelven commented 8 years ago

BTW. here is my version used.

cerbero version 2015/12/4
openssl: Bump to 1.0.2e
git:4e8ec2994bb3298db37c3f84356260e86ea3e07a

also openwebrtc are 2015/12/4

after this changed, it's no got happened on me.

shayanjalil commented 7 years ago

Has the sdk been updated to cater this issue? I am facing the exact same issue. The app crashes randomly with the above error. I have been trying for days to find a fix but nothing has worked for me till now :( Please can someone tell me how to get rid of these crashes?