Search code examples
ioseveryplay

The app crashes after previewing the recording with Everyplay when using the FaceCam


We are testing recording with Everyplay and FaceCam in our game app (landscape only, iOS 9.1, testing on iPhone 5S and iPad 2) and it works fine... only once. To stop recording we call:

[[[EveryplaysharedInstance] capture] stopRecording]​

The recording is stopped and the delegate method everyplayRecordingStopped is called. Automatically the FaceCam session is stopped, too, since the delegate method everyplayFaceCamSessionStopped gets also called. Now we preview the recording by calling:

[[EveryplaysharedInstance] playLastRecording]​

Everyplay's preview window is shown and everything seems fine. Now when closing this window the app crashes before the delegate method "everyplayHidden" is called. Any idea?

Stack trace (bt output in the console):

* thread #1: tid = 0x89fa, 0x0000000198f9aba0 libsystem_c.dylib`strcasestr_l + 132, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000198f9aba0 libsystem_c.dylib`strcasestr_l + 132
    frame #1: 0x00000001014e6d8c Project`epgles_checkExtensions + 456
    frame #2: 0x00000001014dcbf0 Project`-[EveryplayFaceCamConnectionGlEs initWithParentContext:andDelegate:] + 344
    frame #3: 0x00000001014dad08 Project`-[EveryplayFaceCam startSession] + 824
    frame #4: 0x00000001014aaf08 Project`-[Everyplay handleFaceCamOnEveryplayShown:] + 244
    frame #5: 0x00000001014aadd4 Project`-[Everyplay setEveryplayHidden] + 220
    frame #6: 0x00000001014ab7a8 Project`-[Everyplay hideEveryplay] + 72
    frame #7: 0x000000010153bfc0 Project`__39-[EveryplayVideoEditorView closeEditor]_block_invoke + 644
    frame #8: 0x0000000102e49ca8 libdispatch.dylib`_dispatch_call_block_and_release + 24
    frame #9: 0x0000000102e49c68 libdispatch.dylib`_dispatch_client_callout + 16
    frame #10: 0x0000000102e4f710 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 2096
    frame #11: 0x0000000183c101f8 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
    frame #12: 0x0000000183c0e060 CoreFoundation`__CFRunLoopRun + 1628
    frame #13: 0x0000000183b3cca0 CoreFoundation`CFRunLoopRunSpecific + 384
    frame #14: 0x000000018ed78088 GraphicsServices`GSEventRunModal + 180
    frame #15: 0x0000000189254ffc UIKit`UIApplicationMain + 204
  * frame #16: 0x00000001011215f0 Project`main(argc=1, argv=0x000000016fd07a80) + 152 at main.m:39
    frame #17: 0x0000000198f6a8b8 libdyld.dylib`start + 4

Here is the output from the crash log (not the main thread is the one which crashes):

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   libsystem_c.dylib               0x0000000198f9aba0 strcasestr_l + 132
1   libsystem_c.dylib               0x0000000198f9ab9c strcasestr_l + 128
2   Project                         0x0000000101446c5c epgles_checkExtensions + 456
3   Project                         0x000000010143cac0 -[EveryplayFaceCamConnectionGlEs initWithParentContext:andDelegate:] + 344
4   Project                         0x000000010143abd8 -[EveryplayFaceCam startSession] + 824
5   Project                         0x000000010140add8 -[Everyplay handleFaceCamOnEveryplayShown:] + 244
6   Project                         0x000000010140aca4 -[Everyplay setEveryplayHidden] + 220
7   Project                         0x000000010140b678 -[Everyplay hideEveryplay] + 72
8   Project                         0x000000010149be90 __39-[EveryplayVideoEditorView closeEditor]_block_invoke + 644
9   libdispatch.dylib               0x0000000198f396e8 _dispatch_call_block_and_release + 24
10  libdispatch.dylib               0x0000000198f396a8 _dispatch_client_callout + 16
11  libdispatch.dylib               0x0000000198f3edb0 _dispatch_main_queue_callback_4CF + 1844
12  CoreFoundation                  0x0000000183c101f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
13  CoreFoundation                  0x0000000183c0e060 __CFRunLoopRun + 1628
14  CoreFoundation                  0x0000000183b3cca0 CFRunLoopRunSpecific + 384
15  GraphicsServices                0x000000018ed78088 GSEventRunModal + 180
16  UIKit                           0x0000000189254ffc UIApplicationMain + 204
17  Project                         0x00000001010814bc main (main.m:39)
18  libdyld.dylib                   0x0000000198f6a8b8 start + 4

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1 Crashed:
0   libsystem_kernel.dylib          0x00000001990884fc kevent_qos + 8
1   libdispatch.dylib               0x0000000198f4ca04 _dispatch_mgr_invoke + 232
2   libdispatch.dylib               0x0000000198f3b874 _dispatch_source_invoke + 0

Solution

  • Sometimes a crash may happen if your orientation handling is not implemented properly. Usually implementing things like on this thread has helped Does Everyplay support Landscape in iOS6?