Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cerbero] JavaScriptCore issue on 64-bit Android and iOS #177

Closed
stefanalund opened this issue Feb 16, 2015 · 28 comments
Closed

[Cerbero] JavaScriptCore issue on 64-bit Android and iOS #177

stefanalund opened this issue Feb 16, 2015 · 28 comments

Comments

@stefanalund
Copy link
Contributor

Applications that use the OWR bridge (e.g. hybrid apps like Bowser) crashes when running on 64-bit devices:

** Message: Loaded namespace: GLib
** Message: Loaded namespace: GObject
** Message: Loaded namespace: Gio
** Message: Loaded namespace: GIRepository
** Message: Loaded namespace: Owr
WARNING: no real random source present!
(lldb) bt all
  thread #1: tid = 0x231a38, 0x00000001992d7078 libsystem_kernel.dylib`__psynch_cvwait + 8, queue = 'com.apple.main-thread'
    frame #0: 0x00000001992d7078 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x0000000199372fe4 libsystem_pthread.dylib`_pthread_cond_wait + 624
    frame #2: 0x00000001002bb678 SimpleDemo`g_cond_wait(cond=<unavailable>, mutex=<unavailable>) + 56 at gthread-posix.c:767
    frame #3: 0x00000001002bc320 SimpleDemo`g_async_queue_pop_intern_unlocked(queue=0x0000000170a65840, wait=1, end_time=-1) + 116 at gasyncqueue.c:419
    frame #4: 0x00000001002bc26c SimpleDemo`g_async_queue_pop(queue=0x0000000170a65840) + 44 at gasyncqueue.c:453
    frame #5: 0x00000001004b4538 SimpleDemo`owr_bridge_start_in_thread + 56 at owr_bridge.c:441
    frame #6: 0x0000000100064280 SimpleDemo`+[OpenWebRTCViewController initOpenWebRTC](self=0x0000000100869b50, _cmd=0x000000010061eda4) + 20 at OpenWebRTCViewController.m:52
    frame #7: 0x00000001000651b4 SimpleDemo`-[SimpleDemoAppDelegate application:didFinishLaunchingWithOptions:](self=0x00000001740119d0, _cmd=0x000000018d3829aa, application=0x000000013cd1c4a0, launchOptions=0x0000000000000000) + 140 at SimpleDemoAppDelegate.m:37
    frame #8: 0x000000018cc1e6f0 UIKit`-[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 304
    frame #9: 0x000000018ce35688 UIKit`-[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2284
    frame #10: 0x000000018ce37e08 UIKit`-[UIApplication _runWithMainScene:transitionContext:completion:] + 1480
    frame #11: 0x000000018ce364a0 UIKit`-[UIApplication workspaceDidEndTransaction:] + 184
    frame #12: 0x000000019066562c FrontBoardServices`__31-[FBSSerialQueue performAsync:]_block_invoke + 28
    frame #13: 0x00000001883b6a28 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
    frame #14: 0x00000001883b5b30 CoreFoundation`__CFRunLoopDoBlocks + 312
    frame #15: 0x00000001883b4154 CoreFoundation`__CFRunLoopRun + 1756
    frame #16: 0x00000001882e10a4 CoreFoundation`CFRunLoopRunSpecific + 396
    frame #17: 0x000000018cc17aac UIKit`-[UIApplication _run] + 552
    frame #18: 0x000000018cc12aa4 UIKit`UIApplicationMain + 1488
    frame #19: 0x0000000100065aa8 SimpleDemo`main(argc=1, argv=0x000000016fd9f9d0) + 116 at main.m:14
    frame #20: 0x00000001991bea08 libdyld.dylib`start + 4

  thread #3: tid = 0x231a89, 0x00000001992d7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #0: 0x00000001992d7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x0000000199371394 libsystem_pthread.dylib`_pthread_wqthread + 992
    frame #2: 0x0000000199370fa8 libsystem_pthread.dylib`start_wqthread + 4

  thread #4: tid = 0x231a8a, 0x00000001992d7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #0: 0x00000001992d7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x0000000199371394 libsystem_pthread.dylib`_pthread_wqthread + 992

  thread #5: tid = 0x231a92, 0x00000001992bcc94 libsystem_kernel.dylib`kevent64 + 8, queue = 'com.apple.libdispatch-manager'
    frame #0: 0x00000001992bcc94 libsystem_kernel.dylib`kevent64 + 8
    frame #1: 0x00000001015bd258 libdispatch.dylib`_dispatch_mgr_invoke + 276
    frame #2: 0x00000001015aeef8 libdispatch.dylib`_dispatch_mgr_thread + 52

  thread #6: tid = 0x231a95, 0x00000001992d7570 libsystem_kernel.dylib`__semwait_signal + 8, name = 'gputools.smt_poll.0x174223c80'
    frame #0: 0x00000001992d7570 libsystem_kernel.dylib`__semwait_signal + 8
    frame #1: 0x00000001991f9930 libsystem_c.dylib`nanosleep + 216
    frame #2: 0x00000001991f984c libsystem_c.dylib`usleep + 68
    frame #3: 0x0000000101604914 GPUToolsCore`smt_poll_thread_entry(void*) + 144
    frame #4: 0x0000000199373e80 libsystem_pthread.dylib`_pthread_body + 164
    frame #5: 0x0000000199373ddc libsystem_pthread.dylib`_pthread_start + 160

  thread #7: tid = 0x231a98, 0x00000001992d7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #0: 0x00000001992d7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x0000000199371394 libsystem_pthread.dylib`_pthread_wqthread + 992

  thread #8: tid = 0x231a99, 0x00000001992d7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #0: 0x00000001992d7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x0000000199371394 libsystem_pthread.dylib`_pthread_wqthread + 992

* thread #9: tid = 0x231ab0, 0x0000000189b769a4 JavaScriptCore`JSC::JSCallbackObject<JSC::JSDestructibleObject>::construct(JSC::ExecState*) + 256, name = 'owr-bridge-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x468)
    frame #0: 0x0000000189b769a4 JavaScriptCore`JSC::JSCallbackObject<JSC::JSDestructibleObject>::construct(JSC::ExecState*) + 256
    frame #1: 0x00000001898b8f0c JavaScriptCore`JSC::LLInt::setUpCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*) + 296
    frame #2: 0x0000000189bea100 JavaScriptCore`llint_entry + 24944
    frame #3: 0x0000000189bea10c JavaScriptCore`llint_entry + 24956
    frame #4: 0x0000000189be3d74 JavaScriptCore`callToJavaScript + 308
    frame #5: 0x0000000189b523d8 JavaScriptCore`JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 48
    frame #6: 0x000000018989e80c JavaScriptCore`JSC::Interpreter::execute(JSC::ProgramExecutable*, JSC::ExecState*, JSC::JSObject*) + 7652
    frame #7: 0x000000018989c8b8 JavaScriptCore`JSC::evaluate(JSC::ExecState*, JSC::SourceCode const&, JSC::JSValue, JSC::JSValue*) + 476
    frame #8: 0x0000000189b707a8 JavaScriptCore`JSEvaluateScript + 408
  * frame #9: 0x00000001004b45fc SimpleDemo`evaluate_script(context=0x00000001045df4b0, script=<unavailable>, script_len=<unavailable>, script_name=<unavailable>) + 108 at owr_bridge.c:292
    frame #10: 0x00000001004b4470 SimpleDemo`run(msg_queue=<unavailable>) + 2512 at owr_bridge.c:414
    frame #11: 0x0000000100289054 SimpleDemo`g_thread_proxy(data=0x0000000103d54000) + 96 at gthread.c:764
    frame #12: 0x0000000199373e80 libsystem_pthread.dylib`_pthread_body + 164
    frame #13: 0x0000000199373ddc libsystem_pthread.dylib`_pthread_start + 160

  thread #10: tid = 0x231ab1, 0x00000001992d7078 libsystem_kernel.dylib`__psynch_cvwait + 8, name = 'JavaScriptCore::BlockFree'
    frame #0: 0x00000001992d7078 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x0000000199372fe4 libsystem_pthread.dylib`_pthread_cond_wait + 624
    frame #2: 0x00000001982d0d60 libc++.1.dylib`std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >) + 140
    frame #3: 0x00000001899d6264 JavaScriptCore`JSC::BlockAllocator::waitForDuration(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >) + 180
    frame #4: 0x000000018986d4f4 JavaScriptCore`JSC::BlockAllocator::blockFreeingThreadMain() + 80
    frame #5: 0x0000000189868b10 JavaScriptCore`WTF::wtfThreadEntryPoint(void*) + 24
    frame #6: 0x0000000199373e80 libsystem_pthread.dylib`_pthread_body + 164
    frame #7: 0x0000000199373ddc libsystem_pthread.dylib`_pthread_start + 160

  thread #11: tid = 0x231ab2, 0x00000001992d7078 libsystem_kernel.dylib`__psynch_cvwait + 8, name = 'JavaScriptCore::Marking'
    frame #0: 0x00000001992d7078 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x0000000199372fe4 libsystem_pthread.dylib`_pthread_cond_wait + 624
    frame #2: 0x00000001982d0cb0 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 56
    frame #3: 0x0000000189b1684c JavaScriptCore`JSC::GCThread::waitForNextPhase() + 156
    frame #4: 0x0000000189b168f0 JavaScriptCore`JSC::GCThread::gcThreadMain() + 92
    frame #5: 0x0000000189868b10 JavaScriptCore`WTF::wtfThreadEntryPoint(void*) + 24
    frame #6: 0x0000000199373e80 libsystem_pthread.dylib`_pthread_body + 164
    frame #7: 0x0000000199373ddc libsystem_pthread.dylib`_pthread_start + 160
(lldb) print context
(SeedContext) $0 = 0x00000001045df4b0
(lldb) print seed_script

![screen shot 2015-02-14 at 09 59 06](https://cloud.githubusercontent.com/assets/190856/6213083/6d9fe46c-b5ec-11e4-8bb8-277549eba66e.png)

@sdroege
Copy link
Contributor

sdroege commented Feb 16, 2015

Might be an incompatibility between seed and javascriptcore. Unfortunately I don't have any 64 bit ARM devices here for testing.

@stefanalund
Copy link
Contributor Author

I now get a new kind of error after re-building Cerbero (SimpleDemo on 64-bit iPhone 6+):

screen shot 2015-02-17 at 07 59 26

Stacktrace:

** Message: Loaded namespace: GLib
** Message: Loaded namespace: GObject
** Message: Loaded namespace: Gio
** Message: Loaded namespace: GIRepository
** Message: Loaded namespace: Owr
WARNING: no real random source present!
** Message: ready
(lldb) bt all
  thread #1: tid = 0xd2c7, 0x00000001932dce7c libsystem_kernel.dylib`mach_msg_trap + 8, queue = 'com.apple.main-thread'
    frame #0: 0x00000001932dce7c libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x00000001932dccf8 libsystem_kernel.dylib`mach_msg + 72
    frame #2: 0x00000001823d5ed0 CoreFoundation`__CFRunLoopServiceMachPort + 200
    frame #3: 0x00000001823d3e24 CoreFoundation`__CFRunLoopRun + 940
    frame #4: 0x00000001823010a4 CoreFoundation`CFRunLoopRunSpecific + 396
    frame #5: 0x000000018b49b5a4 GraphicsServices`GSEventRunModal + 168
    frame #6: 0x0000000186c32aa4 UIKit`UIApplicationMain + 1488
    frame #7: 0x00000001000a10e8 SimpleDemo`main(argc=1, argv=0x000000016fd679d0) + 116 at main.m:14
    frame #8: 0x00000001931dea08 libdyld.dylib`start + 4

  thread #3: tid = 0xd2e2, 0x00000001932f7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #0: 0x00000001932f7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x0000000193391394 libsystem_pthread.dylib`_pthread_wqthread + 992
    frame #2: 0x0000000193390fa8 libsystem_pthread.dylib`start_wqthread + 4

  thread #4: tid = 0xd2e3, 0x00000001932f7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #0: 0x00000001932f7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x0000000193391394 libsystem_pthread.dylib`_pthread_wqthread + 992

  thread #5: tid = 0xd2e5, 0x00000001932dcc94 libsystem_kernel.dylib`kevent64 + 8, queue = 'com.apple.libdispatch-manager'
    frame #0: 0x00000001932dcc94 libsystem_kernel.dylib`kevent64 + 8
    frame #1: 0x00000001017b9258 libdispatch.dylib`_dispatch_mgr_invoke + 276
    frame #2: 0x00000001017aaef8 libdispatch.dylib`_dispatch_mgr_thread + 52

  thread #6: tid = 0xd2e7, 0x00000001932f7570 libsystem_kernel.dylib`__semwait_signal + 8, name = 'gputools.smt_poll.0x17003dd40'
    frame #0: 0x00000001932f7570 libsystem_kernel.dylib`__semwait_signal + 8
    frame #1: 0x0000000193219930 libsystem_c.dylib`nanosleep + 216
    frame #2: 0x000000019321984c libsystem_c.dylib`usleep + 68
    frame #3: 0x0000000101800914 GPUToolsCore`smt_poll_thread_entry(void*) + 144
    frame #4: 0x0000000193393e80 libsystem_pthread.dylib`_pthread_body + 164
    frame #5: 0x0000000193393ddc libsystem_pthread.dylib`_pthread_start + 160

  thread #7: tid = 0xd2e8, 0x00000001932f7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #0: 0x00000001932f7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x0000000193391394 libsystem_pthread.dylib`_pthread_wqthread + 992

* thread #8: tid = 0xd2e9, 0x0000000104ecc010, name = 'owr-bridge-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x104ecc010)
    frame #0: 0x0000000104ecc010
  * frame #1: 0x00000001002ab568 SimpleDemo`g_task_return [inlined] g_task_return_now(task=0x0000000104ce41f0) + 24 at gtask.c:1077
    frame #2: 0x00000001002ab550 SimpleDemo`g_task_return(task=0x0000000104ce41f0, type=<unavailable>) + 132 at gtask.c:1130
    frame #3: 0x0000000100247a8c SimpleDemo`g_data_input_stream_read_complete(task=0x0000000104ce41f0, read_length=<unavailable>, skip_length=<unavailable>) + 288 at gdatainputstream.c:982
    frame #4: 0x0000000100247940 SimpleDemo`g_data_input_stream_read_line_ready(object=<unavailable>, result=<unavailable>, user_data=<unavailable>) + 280 at gdatainputstream.c:1055
    frame #5: 0x000000010023ffec SimpleDemo`async_fill_callback_wrapper(source_object=0x0000000104dbc060, res=<unavailable>, user_data=<unavailable>) + 56 at gbufferedinputstream.c:449
    frame #6: 0x00000001002ab568 SimpleDemo`g_task_return [inlined] g_task_return_now(task=0x0000000104ce42c0) + 24 at gtask.c:1077
    frame #7: 0x00000001002ab550 SimpleDemo`g_task_return(task=0x0000000104ce42c0, type=<unavailable>) + 132 at gtask.c:1130
    frame #8: 0x0000000100240e5c SimpleDemo`fill_async_callback(source_object=<unavailable>, result=<unavailable>, user_data=0x0000000104ce42c0) + 164 at gbufferedinputstream.c:1048
    frame #9: 0x0000000100280cc8 SimpleDemo`async_ready_callback_wrapper(source_object=0x0000000101b35650, res=<unavailable>, user_data=<unavailable>) + 60 at ginputstream.c:523
    frame #10: 0x00000001002abbdc SimpleDemo`complete_in_idle_cb [inlined] g_task_return_now + 24 at gtask.c:1077
    frame #11: 0x00000001002abbc4 SimpleDemo`complete_in_idle_cb(task=0x0000000104ce4390) + 16 at gtask.c:1086
    frame #12: 0x00000001003306bc SimpleDemo`g_main_context_dispatch [inlined] g_main_dispatch(context=<unavailable>) + 192 at gmain.c:3199
    frame #13: 0x00000001003305fc SimpleDemo`g_main_context_dispatch(context=0x0000000170173b00) + 52 at gmain.c:3847
    frame #14: 0x0000000100330a0c SimpleDemo`g_main_context_iterate(context=<unavailable>, block=<unavailable>, dispatch=<unavailable>, self=<unavailable>) + 436 at gmain.c:3918
    frame #15: 0x0000000100330d04 SimpleDemo`g_main_loop_run(loop=0x00000001700198a0) + 236 at gmain.c:4112
    frame #16: 0x00000001005b872c SimpleDemo`run(msg_queue=<unavailable>) + 2584 at owr_bridge.c:424
    frame #17: 0x000000010031a97c SimpleDemo`g_thread_proxy(data=0x0000000103e88000) + 96 at gthread.c:764
    frame #18: 0x0000000193393e80 libsystem_pthread.dylib`_pthread_body + 164
    frame #19: 0x0000000193393ddc libsystem_pthread.dylib`_pthread_start + 160

  thread #9: tid = 0xd2ea, 0x00000001932f7078 libsystem_kernel.dylib`__psynch_cvwait + 8, name = 'JavaScriptCore::BlockFree'
    frame #0: 0x00000001932f7078 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x0000000193392fe4 libsystem_pthread.dylib`_pthread_cond_wait + 624
    frame #2: 0x00000001922f0d60 libc++.1.dylib`std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >) + 140
    frame #3: 0x00000001839f6264 JavaScriptCore`JSC::BlockAllocator::waitForDuration(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >) + 180
    frame #4: 0x000000018388d4f4 JavaScriptCore`JSC::BlockAllocator::blockFreeingThreadMain() + 80
    frame #5: 0x0000000183888b10 JavaScriptCore`WTF::wtfThreadEntryPoint(void*) + 24
    frame #6: 0x0000000193393e80 libsystem_pthread.dylib`_pthread_body + 164
    frame #7: 0x0000000193393ddc libsystem_pthread.dylib`_pthread_start + 160

  thread #10: tid = 0xd2eb, 0x00000001932f7078 libsystem_kernel.dylib`__psynch_cvwait + 8, name = 'JavaScriptCore::Marking'
    frame #0: 0x00000001932f7078 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x0000000193392fe4 libsystem_pthread.dylib`_pthread_cond_wait + 624
    frame #2: 0x00000001922f0cb0 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 56
    frame #3: 0x0000000183b3684c JavaScriptCore`JSC::GCThread::waitForNextPhase() + 156
    frame #4: 0x0000000183b368f0 JavaScriptCore`JSC::GCThread::gcThreadMain() + 92
    frame #5: 0x0000000183888b10 JavaScriptCore`WTF::wtfThreadEntryPoint(void*) + 24
    frame #6: 0x0000000193393e80 libsystem_pthread.dylib`_pthread_body + 164
    frame #7: 0x0000000193393ddc libsystem_pthread.dylib`_pthread_start + 160

  thread #11: tid = 0xd2ec, 0x00000001932dce7c libsystem_kernel.dylib`mach_msg_trap + 8, name = 'AVAudioSession Notify Thread'
    frame #0: 0x00000001932dce7c libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x00000001932dccf8 libsystem_kernel.dylib`mach_msg + 72
    frame #2: 0x00000001823d5ed0 CoreFoundation`__CFRunLoopServiceMachPort + 200
    frame #3: 0x00000001823d3e24 CoreFoundation`__CFRunLoopRun + 940
    frame #4: 0x00000001823010a4 CoreFoundation`CFRunLoopRunSpecific + 396
    frame #5: 0x0000000180da5570 libAVFAudio.dylib`GenericRunLoopThread::Entry(void*) + 164
    frame #6: 0x0000000180d97f50 libAVFAudio.dylib`CAPThread::Entry(CAPThread*) + 120
    frame #7: 0x0000000193393e80 libsystem_pthread.dylib`_pthread_body + 164
    frame #8: 0x0000000193393ddc libsystem_pthread.dylib`_pthread_start + 160

  thread #12: tid = 0xd2ee, 0x00000001932f7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #0: 0x00000001932f7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x0000000193391394 libsystem_pthread.dylib`_pthread_wqthread + 992

  thread #13: tid = 0xd2f6, 0x00000001932f7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #0: 0x00000001932f7c78 libsystem_kernel.dylib`__workq_kernreturn + 8
    frame #1: 0x0000000193391394 libsystem_pthread.dylib`_pthread_wqthread + 992
(lldb) 

@sdroege
Copy link
Contributor

sdroege commented Feb 17, 2015

In that line it's calling our callback, most likely gotHeaderLine from websocket.js. And it seems like seed or JavascriptCore already destroyed the closure for that.

@stefanalund
Copy link
Contributor Author

@stefhak could this be related to the changes you have done in the bridge?

@stefhak
Copy link
Contributor

stefhak commented Feb 17, 2015

I don't know. It's supposed to be benign and don't do anything if you do not have a browser extension, but things have gone wrong before.

Check out an earlier version (https://github.com/EricssonResearch/openwebrtc/blob/a3018bc2e752f1acb0edd2d6f8da86056ee34521/bridge/worker/bridgeserver.js) of bridgeserver.js and build again. If that works, perhaps we should have flags or specific versions of bridgeserver for cases when there is no browser.

@sdroege
Copy link
Contributor

sdroege commented Feb 17, 2015

I would expect this to be another bug in seed where it doesn't properly keep track of objects and frees them too early.

@stefanalund
Copy link
Contributor Author

If I disable armv7s and arm64, i.e. specify $(ARCHS_STANDARD_32_BIT), this crash does not happen, even when using Cerbero. BUT I don't get any video in the SimpleDemo app.

@stefanalund
Copy link
Contributor Author

Correction: I do get video when forcing 32-bit only, but I now encounter the same problem as EricssonResearch/openwebrtc-gst-plugins#25

Could it be that 64-bit is problematic in ercolorspace? Maybe we should switch sooner than later :)

==== Error message start ====
Error in element source-video-convert-1.
Error: Internal GStreamer error: code not implemented.  Please file a bug at http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer.
Debugging info: src/gstercolorspace.c(340): gst_ercolorspace_transform_frame (): /GstPipeline:transport-agent-1/GstBin:source-bin-1/GstERColorspace:source-video-convert-1:
colorspace conversion failed: unsupported formats
==== Error message stop ====
==== Error message start ====
Error in element source-1.
Error: Internal data flow error.
Debugging info: gstbasesrc.c(2943): void gst_base_src_loop(GstPad *) (): /GstPipeline:transport-agent-1/GstBin:source-bin-1/GstInterVideoSrc:source-1:
streaming task paused, reason not-negotiated (-4)
==== Error message stop ====
==== Error message start ====
Error in element source-queue-1.
Error: Internal data flow error.

@stefanalund stefanalund changed the title JavaScriptCore issue on 64-bit iOS [Cerbero] JavaScriptCore issue on 64-bit iOS Feb 18, 2015
@stefanalund
Copy link
Contributor Author

@sdroege did you look into why 64-bit brakes the bridge?

@sdroege
Copy link
Contributor

sdroege commented Feb 20, 2015

No, I don't have any 64 bit ARM device. The problem is still #177 (comment) and everything else is solved by now?

As it works fine on x86-64 here it's not a generic 64 bit problem, and I'm suspecting that this is a incompatibility between seed and JavaScriptCore on iOS/ARM64 or maybe the JavaScriptCore version there has new interesting bugs.

@sdroege
Copy link
Contributor

sdroege commented Mar 9, 2015

Problem here is that this version of libffi fails to build on iOS/ARM (not 64 bit). See https://github.com/atgreen/libffi/issues/181

nirbheek added a commit to nirbheek/cerbero-old that referenced this issue Mar 23, 2015
@thenetsnake
Copy link

using v3.2 for ARM causes errors at glib compilation:

/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in .
/bin/sh ../libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I..  -DG_LOG_DOMAIN=\"GLib-GObject\" -I.. -I../glib -I../glib -I.. -DG_DISABLE_CAST_CHECKS -DGOBJECT_COMPILATION -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -D_REENTRANT -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -I/Users/tns/cerbero/dist/ios_universal/lib/libffi-3.2/include  -fvisibility=hidden -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -miphoneos-version-min=6.0 -Wall -g -Os -Wno-error=format-nonliteral -Wno-error=implicit-function-declaration  -MT libgobject_2_0_la-gclosure.lo -MD -MP -MF .deps/libgobject_2_0_la-gclosure.Tpo -c -o libgobject_2_0_la-gclosure.lo `test -f 'gclosure.c' || echo './'`gclosure.c
/bin/sh ../libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I..  -DG_LOG_DOMAIN=\"GLib-GObject\" -I.. -I../glib -I../glib -I.. -DG_DISABLE_CAST_CHECKS -DGOBJECT_COMPILATION -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -D_REENTRANT -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -I/Users/tns/cerbero/dist/ios_universal/lib/libffi-3.2/include  -fvisibility=hidden -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -miphoneos-version-min=6.0 -Wall -g -Os -Wno-error=format-nonliteral -Wno-error=implicit-function-declaration  -MT libgobject_2_0_la-genums.lo -MD -MP -MF .deps/libgobject_2_0_la-genums.Tpo -c -o libgobject_2_0_la-genums.lo `test -f 'genums.c' || echo './'`genums.c
/bin/sh ../libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I..  -DG_LOG_DOMAIN=\"GLib-GObject\" -I.. -I../glib -I../glib -I.. -DG_DISABLE_CAST_CHECKS -DGOBJECT_COMPILATION -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -D_REENTRANT -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -I/Users/tns/cerbero/dist/ios_universal/lib/libffi-3.2/include  -fvisibility=hidden -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -miphoneos-version-min=6.0 -Wall -g -Os -Wno-error=format-nonliteral -Wno-error=implicit-function-declaration  -MT libgobject_2_0_la-gmarshal.lo -MD -MP -MF .deps/libgobject_2_0_la-gmarshal.Tpo -c -o libgobject_2_0_la-gmarshal.lo `test -f 'gmarshal.c' || echo './'`gmarshal.c
/bin/sh ../libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I..  -DG_LOG_DOMAIN=\"GLib-GObject\" -I.. -I../glib -I../glib -I.. -DG_DISABLE_CAST_CHECKS -DGOBJECT_COMPILATION -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -D_REENTRANT -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -I/Users/tns/cerbero/dist/ios_universal/lib/libffi-3.2/include  -fvisibility=hidden -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -miphoneos-version-min=6.0 -Wall -g -Os -Wno-error=format-nonliteral -Wno-error=implicit-function-declaration  -MT libgobject_2_0_la-gobject.lo -MD -MP -MF .deps/libgobject_2_0_la-gobject.Tpo -c -o libgobject_2_0_la-gobject.lo `test -f 'gobject.c' || echo './'`gobject.c
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"GLib-GObject\" -I.. -I../glib -I../glib -I.. -DG_DISABLE_CAST_CHECKS -DGOBJECT_COMPILATION -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -D_REENTRANT -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -I/Users/tns/cerbero/dist/ios_universal/lib/libffi-3.2/include -fvisibility=hidden -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -miphoneos-version-min=6.0 -Wall -g -Os -Wno-error=format-nonliteral -Wno-error=implicit-function-declaration -MT libgobject_2_0_la-gmarshal.lo -MD -MP -MF .deps/libgobject_2_0_la-gmarshal.Tpo -c gmarshal.c  -fno-common -DPIC -o .libs/libgobject_2_0_la-gmarshal.o
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"GLib-GObject\" -I.. -I../glib -I../glib -I.. -DG_DISABLE_CAST_CHECKS -DGOBJECT_COMPILATION -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -D_REENTRANT -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -I/Users/tns/cerbero/dist/ios_universal/lib/libffi-3.2/include -fvisibility=hidden -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -miphoneos-version-min=6.0 -Wall -g -Os -Wno-error=format-nonliteral -Wno-error=implicit-function-declaration -MT libgobject_2_0_la-genums.lo -MD -MP -MF .deps/libgobject_2_0_la-genums.Tpo -c genums.c  -fno-common -DPIC -o .libs/libgobject_2_0_la-genums.o
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"GLib-GObject\" -I.. -I../glib -I../glib -I.. -DG_DISABLE_CAST_CHECKS -DGOBJECT_COMPILATION -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -D_REENTRANT -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -I/Users/tns/cerbero/dist/ios_universal/lib/libffi-3.2/include -fvisibility=hidden -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -miphoneos-version-min=6.0 -Wall -g -Os -Wno-error=format-nonliteral -Wno-error=implicit-function-declaration -MT libgobject_2_0_la-gobject.lo -MD -MP -MF .deps/libgobject_2_0_la-gobject.Tpo -c gobject.c  -fno-common -DPIC -o .libs/libgobject_2_0_la-gobject.o
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"GLib-GObject\" -I.. -I../glib -I../glib -I.. -DG_DISABLE_CAST_CHECKS -DGOBJECT_COMPILATION -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -D_REENTRANT -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -I/Users/tns/cerbero/dist/ios_universal/lib/libffi-3.2/include -fvisibility=hidden -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -miphoneos-version-min=6.0 -Wall -g -Os -Wno-error=format-nonliteral -Wno-error=implicit-function-declaration -MT libgobject_2_0_la-gclosure.lo -MD -MP -MF .deps/libgobject_2_0_la-gclosure.Tpo -c gclosure.c  -fno-common -DPIC -o .libs/libgobject_2_0_la-gclosure.o
gclosure.c:27:10: fatal error: 'ffi.h' file not found
#include <ffi.h>
         ^
1 error generated.
make[4]: *** [libgobject_2_0_la-gclosure.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"GLib-GObject\" -I.. -I../glib -I../glib -I.. -DG_DISABLE_CAST_CHECKS -DGOBJECT_COMPILATION -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -D_REENTRANT -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -I/Users/tns/cerbero/dist/ios_universal/lib/libffi-3.2/include -fvisibility=hidden -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -miphoneos-version-min=6.0 -Wall -g -Os -Wno-error=format-nonliteral -Wno-error=implicit-function-declaration -MT libgobject_2_0_la-genums.lo -MD -MP -MF .deps/libgobject_2_0_la-genums.Tpo -c genums.c -o libgobject_2_0_la-genums.o >/dev/null 2>&1
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"GLib-GObject\" -I.. -I../glib -I../glib -I.. -DG_DISABLE_CAST_CHECKS -DGOBJECT_COMPILATION -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -D_REENTRANT -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -I/Users/tns/cerbero/dist/ios_universal/lib/libffi-3.2/include -fvisibility=hidden -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -miphoneos-version-min=6.0 -Wall -g -Os -Wno-error=format-nonliteral -Wno-error=implicit-function-declaration -MT libgobject_2_0_la-gmarshal.lo -MD -MP -MF .deps/libgobject_2_0_la-gmarshal.Tpo -c gmarshal.c -o libgobject_2_0_la-gmarshal.o >/dev/null 2>&1
mv -f .deps/libgobject_2_0_la-genums.Tpo .deps/libgobject_2_0_la-genums.Plo
mv -f .deps/libgobject_2_0_la-gmarshal.Tpo .deps/libgobject_2_0_la-gmarshal.Plo
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"GLib-GObject\" -I.. -I../glib -I../glib -I.. -DG_DISABLE_CAST_CHECKS -DGOBJECT_COMPILATION -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -D_REENTRANT -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -I/Users/tns/cerbero/dist/ios_universal/lib/libffi-3.2/include -fvisibility=hidden -arch armv7s -mcpu=cortex-a9 -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk -miphoneos-version-min=6.0 -Wall -g -Os -Wno-error=format-nonliteral -Wno-error=implicit-function-declaration -MT libgobject_2_0_la-gobject.lo -MD -MP -MF .deps/libgobject_2_0_la-gobject.Tpo -c gobject.c -o libgobject_2_0_la-gobject.o >/dev/null 2>&1
mv -f .deps/libgobject_2_0_la-gobject.Tpo .deps/libgobject_2_0_la-gobject.Plo
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Running command 'make -j4'

Recipe 'glib' failed at the build step 'compile'

@sdroege
Copy link
Contributor

sdroege commented Mar 25, 2015

That's because they end up in different directories, the headers I mean:
lib/libffi-3.2/include vs. lib/libffi-3.2.1/include

Why did this even compile glib for me?

nirbheek added a commit to nirbheek/cerbero-old that referenced this issue Mar 25, 2015
@nirbheek
Copy link
Contributor

@sdroege Probably because the old headers were still around from a previous compile. Cerbero doesn't remove the old files when installing a new version of a recipe.

@sdroege
Copy link
Contributor

sdroege commented Mar 25, 2015

rm -rf dist/* does though ;)

@superdump
Copy link
Contributor

This should now be fixed by use of an updated libffi. Closing.

@Rugvip
Copy link
Contributor

Rugvip commented Apr 11, 2015

I'm getting the same problem as #177 (comment) on Android, when using both 3.2.1 and 3.2

@Rugvip Rugvip reopened this Apr 11, 2015
@Rugvip Rugvip added the Android label Apr 11, 2015
@superdump superdump changed the title [Cerbero] JavaScriptCore issue on 64-bit iOS [Cerbero] JavaScriptCore issue on 64-bit Android (was iOS) Apr 11, 2015
@stefanalund
Copy link
Contributor Author

I noticed the same thing when porting Bowser to the new framework and adding 64-bit support. The bridge crashes immediately.

@superdump superdump changed the title [Cerbero] JavaScriptCore issue on 64-bit Android (was iOS) [Cerbero] JavaScriptCore issue on 64-bit Android and iOS Apr 11, 2015
@Rugvip
Copy link
Contributor

Rugvip commented Apr 11, 2015

It's most likely a problem with libffi, the native closure that is created isn't callable even just after it's created, so no chance for seed to lose the ref to it.

@superdump
Copy link
Contributor

libffi was updated and fixed this issue on iOS apparently. I haven't observed any crashes with the bridge on iOS on an iPhone 6 Plus but Stefan has on an iPhone 5S I think, consistently.

@stefanalund
Copy link
Contributor Author

@superdump I think you will get them if you set Bowser (for example) to support not only 32 bit architectures.

@nirbheek
Copy link
Contributor

Perhaps as recommended by https://github.com/atgreen/libffi/issues/181#issuecomment-88053634 we should use https://github.com/frida/libffi till upstream fixes this. It seems to work for 32-bit, 64-bit, etc, for them.

@superdump
Copy link
Contributor

@nirbheek yes, I think we should do that. Thanks to @oleavr! @nirbheek - can you fix this?

@superdump superdump added this to the First official release milestone Apr 12, 2015
@superdump
Copy link
Contributor

We should at least try the frida branch before making the release. If it works, great!

@sdroege
Copy link
Contributor

sdroege commented Apr 14, 2015

We use that branch now. All solved?

@sdroege sdroege closed this as completed Apr 14, 2015
adam-be pushed a commit to adam-be/openwebrtc that referenced this issue Apr 21, 2015
use partial dictionary for MediaStreamConstraints
@superdump
Copy link
Contributor

Not solved.

@superdump superdump reopened this Apr 24, 2015
@superdump
Copy link
Contributor

For example, with SimpleDemo in 64-bit mode: https://gist.github.com/superdump/431963602aa83a8fac72

@superdump superdump removed this from the First official release milestone Apr 24, 2015
alessandrod added a commit to alessandrod/cerbero-old that referenced this issue Apr 28, 2015
alessandrod added a commit to EricssonResearch/cerbero that referenced this issue Apr 28, 2015
3.2.1 fixes the arm64 trampoline segfault
(EricssonResearch/openwebrtc#177). The patch is from
https://github.com/atgreen/libffi/issues/181#issuecomment-88053634 and it fixes
32 bit compilation with clang.

Closes #20.
@superdump
Copy link
Contributor

This was fixed by EricssonResearch/cerbero#20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants