简体   繁体   English

Boost.Coroutine在iPhone上崩溃

[英]Boost.Coroutine crashing on iPhone

Is someone trying to use Boost.Coroutine library in iOS applications? 是否有人试图在iOS应用程序中使用Boost.Coroutine库? If yes, is it have worked? 如果是,是否奏效?

I'm now trying to do that, but when incomplete coroutine trying to unwind stack application is terminating with uncaughing exception forced_unwind(). 我现在正在尝试执行此操作,但是当尝试取消堆栈应用程序的不完整协程时,会因未发生异常而终止,异常情况是force_unwind()。

I have run this library on other platform (i386 (ios simulator) and elf armv7 (htc one x, one v)), and it worked fine. 我已经在其他平台(i386(ios模拟器)和elf armv7(htc一x,一v))上运行了该库,并且运行良好。 But iOS.. :[ 但是iOS ..:[

Additional information: 附加信息:

I'm trying to run unwind.cpp example, from boost/coroutine/example: https://github.com/olk/boost-coroutine/blob/master/example/cpp03/unwind.cpp 我正在尝试从boost / coroutine / example运行unwind.cpp示例: https : //github.com/olk/boost-coroutine/blob/master/example/cpp03/unwind.cpp

Stack is: 堆栈为:

libc++abi.dylib: terminating with uncaught exception of type yboost::coroutines::detail::forced_unwind
(lldb) bt
* thread #1: tid = 0x258dd, 0x399eb1fc libsystem_kernel.dylib`__pthread_kill + 8, queue = 'com.apple.main-thread, stop reason = signal SIGABRT
    frame #0: 0x399eb1fc libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x39a52a52 libsystem_pthread.dylib`pthread_kill + 58
    frame #2: 0x3999c02c libsystem_c.dylib`abort + 76
    frame #3: 0x38dea98e libc++abi.dylib`abort_message + 74
    frame #4: 0x38e036e6 libc++abi.dylib`default_terminate_handler() + 254
    frame #5: 0x3943b95c libobjc.A.dylib`_objc_terminate() + 228
    frame #6: 0x38e011b2 libc++abi.dylib`std::__terminate(void (*)()) + 78
    frame #7: 0x38e012b0 libc++abi.dylib`std::terminate() + 156
    frame #8: 0x000ab2fc CoroutinesTest`__clang_call_terminate + 16
    frame #9: 0x000aefaa CoroutinesTest`yboost::coroutines::detail::pull_coroutine_object<void, void (this=0x15645b90)(yboost::coroutines::push_coroutine<void>&), yboost::coroutines::detail::standard_stack_allocator, std::__1::allocator<yboost::coroutines::pull_coroutine<void> >, yboost::coroutines::push_coroutine<void> >::unwind_stack_() + 358 at pull_coroutine_object.hpp:804
    frame #10: 0x000aee02 CoroutinesTest`yboost::coroutines::detail::pull_coroutine_object<void, void (this=0x15645b90)(yboost::coroutines::push_coroutine<void>&), yboost::coroutines::detail::standard_stack_allocator, std::__1::allocator<yboost::coroutines::pull_coroutine<void> >, yboost::coroutines::push_coroutine<void> >::~pull_coroutine_object() + 62 at pull_coroutine_object.hpp:862
    frame #11: 0x000aed9e CoroutinesTest`yboost::coroutines::detail::pull_coroutine_object<void, void (this=0x15645b90)(yboost::coroutines::push_coroutine<void>&), yboost::coroutines::detail::standard_stack_allocator, std::__1::allocator<yboost::coroutines::pull_coroutine<void> >, yboost::coroutines::push_coroutine<void> >::~pull_coroutine_object() + 14 at pull_coroutine_object.hpp:860
    frame #12: 0x000aefea CoroutinesTest`yboost::coroutines::detail::pull_coroutine_object<void, void (&)(yboost::coroutines::push_coroutine<void>&), yboost::coroutines::detail::standard_stack_allocator, std::__1::allocator<yboost::coroutines::pull_coroutine<void> >, yboost::coroutines::push_coroutine<void> >::destroy_(std::__1::allocator<yboost::coroutines::detail::pull_coroutine_object<void, void (&)(yboost::coroutines::push_coroutine<void>&), yboost::coroutines::detail::standard_stack_allocator, std::__1::allocator<yboost::coroutines::pull_coroutine<void> >, yboost::coroutines::push_coroutine<void> > >&, yboost::coroutines::detail::pull_coroutine_object<void, void (&)(yboost::coroutines::push_coroutine<void>&), yboost::coroutines::detail::standard_stack_allocator, std::__1::allocator<yboost::coroutines::pull_coroutine<void> >, yboost::coroutines::push_coroutine<void> >*) [inlined] std::__1::allocator<yboost::coroutines::detail::pull_coroutine_object<void, void (this=0x15645cbc, __p=0x15645b90)(yboost::coroutines::push_coroutine<void>&), yboost::coroutines::detail::standard_stack_allocator, std::__1::allocator<yboost::coroutines::pull_coroutine<void> >, yboost::coroutines::push_coroutine<void> > >::destroy(yboost::coroutines::detail::pull_coroutine_object<void, void (&)(yboost::coroutines::push_coroutine<void>&), yboost::coroutines::detail::standard_stack_allocator, std::__1::allocator<yboost::coroutines::pull_coroutine<void> >, yboost::coroutines::push_coroutine<void> >*) + 34 at memory:1739
    frame #13: 0x000aefe0 CoroutinesTest`yboost::coroutines::detail::pull_coroutine_object<void, void (alloc=0x15645cbc, p=0x15645b90)(yboost::coroutines::push_coroutine<void>&), yboost::coroutines::detail::standard_stack_allocator, std::__1::allocator<yboost::coroutines::pull_coroutine<void> >, yboost::coroutines::push_coroutine<void> >::destroy_(std::__1::allocator<yboost::coroutines::detail::pull_coroutine_object<void, void (&)(yboost::coroutines::push_coroutine<void>&), yboost::coroutines::detail::standard_stack_allocator, std::__1::allocator<yboost::coroutines::pull_coroutine<void> >, yboost::coroutines::push_coroutine<void> > >&, yboost::coroutines::detail::pull_coroutine_object<void, void (&)(yboost::coroutines::push_coroutine<void>&), yboost::coroutines::detail::standard_stack_allocator, std::__1::allocator<yboost::coroutines::pull_coroutine<void> >, yboost::coroutines::push_coroutine<void> >*) + 24 at pull_coroutine_object.hpp:783
    frame #14: 0x000aed8c CoroutinesTest`yboost::coroutines::detail::pull_coroutine_object<void, void (this=0x15645b90)(yboost::coroutines::push_coroutine<void>&), yboost::coroutines::detail::standard_stack_allocator, std::__1::allocator<yboost::coroutines::pull_coroutine<void> >, yboost::coroutines::push_coroutine<void> >::deallocate_object() + 24 at pull_coroutine_object.hpp:892
    frame #15: 0x000ad9a4 CoroutinesTest`yboost::coroutines::detail::intrusive_ptr_release(p=0x15645b90) + 116 at pull_coroutine_base.hpp:311
    frame #16: 0x000ad92a CoroutinesTest`yboost::intrusive_ptr<yboost::coroutines::detail::pull_coroutine_base<void> >::~intrusive_ptr(this=0x27d5d990) + 34 at intrusive_ptr.hpp:97
    frame #17: 0x000ad902 CoroutinesTest`yboost::intrusive_ptr<yboost::coroutines::detail::pull_coroutine_base<void> >::~intrusive_ptr(this=0x27d5d990) + 14 at intrusive_ptr.hpp:96
    frame #18: 0x000ad8e8 CoroutinesTest`yboost::coroutines::pull_coroutine<void>::~pull_coroutine(this=0x27d5d990) + 16 at coroutine.hpp:1784
    frame #19: 0x000ad8d2 CoroutinesTest`yboost::coroutines::pull_coroutine<void>::~pull_coroutine(this=0x27d5d990) + 14 at coroutine.hpp:1784
    frame #20: 0x000aa0a0 CoroutinesTest`(anonymous namespace)::runnable() + 260 at CoroRunner.cpp:38
    frame #21: 0x000a9f98 CoroutinesTest`CoroRunner::run(this=0x15641dd0) + 12 at CoroRunner.cpp:84
    frame #22: 0x000c723e CoroutinesTest`-[Runner run](self=0x1563f900, _cmd=0x31edde22) + 34 at Runner.mm:32
    frame #23: 0x000c65ba CoroutinesTest`-[TPCAppDelegate application:didFinishLaunchingWithOptions:](self=0x15539dc0, _cmd=0x31eae996, application=0x15532840, launchOptions=0x00000000) + 666 at TPCAppDelegate.m:21
    frame #24: 0x31937424 UIKit`-[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 276
    frame #25: 0x31936e6a UIKit`-[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1390
    frame #26: 0x319314b8 UIKit`-[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 720
    frame #27: 0x318cbbe6 UIKit`-[UIApplication handleEvent:withNewEvent:] + 3142
    frame #28: 0x318caedc UIKit`-[UIApplication sendEvent:] + 72
    frame #29: 0x31930ca0 UIKit`_UIApplicationHandleEvent + 664
    frame #30: 0x33dac76c GraphicsServices`_PurpleEventCallback + 608
    frame #31: 0x33dac356 GraphicsServices`PurpleEventCallback + 34
    frame #32: 0x2f10b77e CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
    frame #33: 0x2f10b71a CoreFoundation`__CFRunLoopDoSource1 + 346
    frame #34: 0x2f109ee6 CoreFoundation`__CFRunLoopRun + 1406
    frame #35: 0x2f074540 CoreFoundation`CFRunLoopRunSpecific + 524
    frame #36: 0x2f074322 CoreFoundation`CFRunLoopRunInMode + 106
    frame #37: 0x3192ff42 UIKit`-[UIApplication _run] + 762
    frame #38: 0x3192b1e4 UIKit`UIApplicationMain + 1136
    frame #39: 0x000c67c4 CoroutinesTest`main(argc=1, argv=0x27d5fcf4) + 116 at main.m:16

IOS on ARM uses a different ABI than AAPCS (which is the standard). ARM上的IOS使用与AAPCS(这是标准)不同的ABI。 boost.coroutine uses internally boost.context for context switching/jumping. boost.coroutine内部使用boost.context进行上下文切换/跳转。 Until boost-1.55 bost.context does not support IOS's ABI. 直到boost-1.55,bost.context才支持IOS的ABI。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM