wix / Detox

Gray box end-to-end testing and automation framework for mobile apps
https://wix.github.io/Detox/
MIT License
11.15k stars 1.92k forks source link

Signal 11 was raised #2802

Closed walterholohan closed 2 years ago

walterholohan commented 3 years ago

Description

I am getting the following Signal 11 crash intermittently when running tests on iOS Simulator

DetoxRuntimeError: The pending request #321 ("invoke") has been rejected due to the following error:

    The app has crashed, see the details below:

    Signal 11 was raised
    (
        0   Detox                               0x0000000104ad3335 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
        1   Detox                               0x0000000104ad6540 __DTXHandleCrash + 464
        2   Detox                               0x0000000104ad6c85 __DTXHandleSignal + 59
        3   libsystem_platform.dylib            0x00007fff5e733d7d _sigtramp + 29
        4   ???                                 0x0000000000000001 0x0 + 1
        5   DetoxSync                           0x00000001063d274f -[_DTXTimerTrampoline fire:] + 188
        6   DetoxSync                           0x00000001063bab10 _DTXCFTimerTrampoline + 74
        7   CoreFoundation                      0x00007fff2038cc47 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
        8   CoreFoundation                      0x00007fff2038c71a __CFRunLoopDoTimer + 926
        9   CoreFoundation                      0x00007fff2038bccd __CFRunLoopDoTimers + 265
        10  CoreFoundation                      0x00007fff2038634e __CFRunLoopRun + 1949
        11  CoreFoundation                      0x00007fff203856c6 CFRunLoopRunSpecific + 567
        12  MinoApp                             0x0000000103a4ee9a +[RCTCxxBridge runRunLoop] + 274
        13  DetoxSync                           0x00000001063c300e swz_runRunLoopThread + 291
        14  Foundation                          0x00007fff20852e68 __NSThread__start__ + 1042
        15  libsystem_pthread.dylib             0x00007fff5e741954 _pthread_start + 224
        16  libsystem_pthread.dylib             0x00007fff5e73d4a7 thread_start + 15
    )

Environment (please complete the following information):

d4vidi commented 3 years ago

@alon-ha please try to follow the stacktrace and come up with the conditions where this can take place. It seems to be coming from the inside of DetoxSync itself.

walterholohan commented 3 years ago

Hey @alon-ha @d4vidi , any update on this issue. It seems to happen more often now. Below is a snippet of the detox logs which might help you debug easier. Do you think it has anything to do with Lottie animations? I have disabled the autoPlay and loop options of all lottie animations in my app.

2021-06-06 08:31:17.878 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.878 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.878 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.878 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.878 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.878 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.878 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.878 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.878 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.879 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.925 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.925 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.925 Db MinoApp[84806:a887700] [com.apple.defaults:User Defaults] looked up value 1 for key RCTI18nUtil_makeRTLFlipLeftAndRightStyles in CFPrefsPlistSource<0x600000648080> (Domain: com.fnni.milli.int, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No) via CFPrefsSearchListSource<0x60000064c200> (Domain: com.fnni.milli.int, Container: (null))
2021-06-06 08:31:17.927 E  MinoApp[84806:a8877c9] [com.wix.Detox:DetoxManager] App crashed: Signal 11 was raised
(
    0   Detox                               0x000000010a4d3c45 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
    1   Detox                               0x000000010a4d6e50 __DTXHandleCrash + 464
    2   Detox                               0x000000010a4d7595 __DTXHandleSignal + 59
    3   libsystem_platform.dylib            0x00007fff5e732d7d _sigtramp + 29
    4   ???                                 0x0000000000000000 0x0 + 0
    5   DetoxSync                           0x000000010bf7274f -[_DTXTimerTrampoline fire:] + 188
    6   DetoxSync                           0x000000010bf5ab10 _DTXCFTimerTrampoline + 74
    7   CoreFoundation                      0x00007fff2038cc47 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    8   CoreFoundation                      0x00007fff2038c71a __CFRunLoopDoTimer + 926
    9   CoreFoundation                      0x00007fff2038bccd __CFRunLoopDoTimers + 265
    10  CoreFoundation                      0x00007fff2038634e __CFRunL<…>
2021-06-06 08:31:17.927 I  MinoApp[84806:a8877c9] [com.wix.Detox:DetoxInstrumentsManager] Called stop but no recording in progress
2021-06-06 08:31:18.029 Df MinoApp[84806:a88b358] (CFNetwork) Task <E49A74FE-0650-4A7B-BF0D-4F37568CB54E>.<36> received response, status 200 content U
2021-06-06 08:31:18.029 Df MinoApp[84806:a88b358] (CFNetwork) Task <E49A74FE-0650-4A7B-BF0D-4F37568CB54E>.<36> done using Connection 7
2021-06-06 08:31:18.029 Db MinoApp[84806:a88b358] [com.apple.network:activity] Returning should log: 0 for activity cfnetwork:foreground_task
2021-06-06 08:31:18.029 Db MinoApp[84806:a88b358] (CFNetwork) Task <E49A74FE-0650-4A7B-BF0D-4F37568CB54E>.<36> request https://mino-api-staging.int.us-east-1.dev.gen6bk.com/api/graphql is NOT allowed to set HSTS for main doc (null)
2021-06-06 08:31:18.029 Df MinoApp[84806:a88b358] (CFNetwork) Task <E49A74FE-0650-4A7B-BF0D-4F37568CB54E>.<36> response ended
2021-06-06 08:31:18.029 Df MinoApp[84806:a88bc8d] [com.apple.CFNetwork:Summary] Task <E49A74FE-0650-4A7B-BF0D-4F37568CB54E>.<36> summary for task success {transaction_duration_ms=180, response_status=200, connection=7, reused=1, request_start_ms=0, request_duration_ms=0, response_start_ms=180, response_duration_ms=0, request_bytes=1776, response_bytes=821, cache_hit=0}
2021-06-06 08:31:18.030 Df MinoApp[84806:a88b359] (CFNetwork) Task <E49A74FE-0650-4A7B-BF0D-4F37568CB54E>.<36> finished successfully
2021-06-06 08:31:18.030 Db MinoApp[84806:a88bc8d] [com.apple.network:activity] Returning should log: 0 for activity cfnetwork:foreground_task
2021-06-06 08:31:18.030 Db MinoApp[84806:a88bc8d] [com.apple.network:activity] No threshold for cfnetwork:foreground_task, returning NW_ACTIVITY_DURATION_INVALID
2021-06-06 08:31:18.030 Db MinoApp[84806:a88bc8d] [com.apple.network:activity] No threshold for activity <nw_activity 12:2 [7A3B85C9-BAA8-46C0-9E38-5E1D42C672DD] (reporting strategy default) complete (reason success)>
sypl commented 3 years ago

Got the same issue

DetoxRuntimeError: The pending request #-1000 ("isReady") has been rejected due to the following error:

    The app has crashed, see the details below:

    Signal 11 was raised
    (
        0   Detox                               0x000000010c9ab335 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
        1   Detox                               0x000000010c9ae540 __DTXHandleCrash + 464
        2   Detox                               0x000000010c9aec85 __DTXHandleSignal + 59
        3   libsystem_platform.dylib            0x00007fff5e733d7d _sigtramp + 29
        4   ???                                 0x0000000000000000 0x0 + 0
        5   DetoxSync                           0x000000010e44574f -[_DTXTimerTrampoline fire:] + 188
        6   DetoxSync                           0x000000010e42db10 _DTXCFTimerTrampoline + 74
        7   CoreFoundation                      0x00007fff2038cc47 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
        8   CoreFoundation                      0x00007fff2038c71a __CFRunLoopDoTimer + 926
        9   CoreFoundation                      0x00007fff2038bccd __CFRunLoopDoTimers + 265
        10  CoreFoundation                      0x00007fff2038634e __CFRunLoopRun + 1949
        11  CoreFoundation                      0x00007fff203856c6 CFRunLoopRunSpecific + 567
        12  MinoApp                             0x000000010bc352fa +[RCTCxxBridge runRunLoop] + 274
        13  DetoxSync                           0x000000010e43600e swz_runRunLoopThread + 291
        14  Foundation                          0x00007fff20852e68 __NSThread__start__ + 1042
        15  libsystem_pthread.dylib             0x00007fff5e741954 _pthread_start + 224
        16  libsystem_pthread.dylib             0x00007fff5e73d4a7 thread_start + 15
    )

Detox: 18.14.1 React Native: 0.63.4 Node: 14 Device: iOS Simulator 11 Xcode: 12.4 iOS: 14.4 macOS: Big Sur 11.3.1

alon-ha commented 3 years ago

@walterholohan @sypl I'm trying to reproduce but without any luck. Can one of you open an example project it happens so I can solve it?

SiM07 commented 3 years ago

I have the same issue, on my own env and in github action env.

        20  libdispatch.dylib                   0x0000000114e7498c _dispatch_lane_invoke + 400
        21  libdispatch.dylib                   0x0000000114e7ef81 _dispatch_workloop_worker_thread + 772
        22  libsystem_pthread.dylib             0x000000011533b45d _pthread_wqthread + 314
        23  libsystem_pthread.dylib             0x000000011533a42f start_wqthread + 15
    )

  ● MyBookings test › should login

    DetoxRuntimeError: The pending request #-1000 ("isReady") has been rejected due to the following error:

    The app has crashed, see the details below:

    Signal 11 was raised
    (
        0   Detox                               0x0000000107b88735 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
        1   Detox                               0x0000000107b8b940 __DTXHandleCrash + 464
        2   Detox                               0x0000000107b8c085 __DTXHandleSignal + 59
        3   libsystem_platform.dylib            0x0000000115317d7d _sigtramp + 29
        4   libsystem_c.dylib                   0x00000001150376f8 __global_locale + 0
        5   CoreFoundation                      0x000000010e66b833 -[__NSDictionaryM dealloc] + 128
        6   libobjc.A.dylib                     0x000000010e48e604 objc_object::sidetable_release(bool, bool) + 174
        7   libobjc.A.dylib                     0x000000010e48a8ad _object_remove_assocations + 562
        8   libobjc.A.dylib                     0x000000010e487c02 objc_destructInstance + 84
        9   libobjc.A.dylib                     0x000000010e48dd88 -[NSObject dealloc] + 21
        10  Foundation                          0x000000010a4c6ca1 -[NSOperation dealloc] + 281
        11  libobjc.A.dylib                     0x000000010e48e604 objc_object::sidetable_release(bool, bool) + 174
        12  libsystem_blocks.dylib              0x0000000114fa6432 _Block_release + 128
        13  libsystem_blocks.dylib              0x0000000114fa6432 _Block_release + 128
        14  libsystem_blocks.dylib              0x0000000114fa6432 _Block_release + 128
        15  olybe                               0x00000001058c0368 __destroy_helper_block_e8_32s40s48s + 24
        16  libsystem_blocks.dylib              0x0000000114fa6432 _Block_release + 128
        17  libsystem_blocks.dylib              0x0000000114fa6432 _Block_release + 128
        18  libdispatch.dylib                   0x0000000114e6d8df _dispatch_client_callout + 8
        19  libdispatch.dylib                   0x0000000114e73f5c _dispatch_lane_serial_drain + 1042
        20  libdispatch.dylib                   0x0000000114e7498c _dispatch_lane_invoke + 400
        21  libdispatch.dylib                   0x0000000114e7ef81 _dispatch_workloop_worker_thread + 772
        22  libsystem_pthread.dylib             0x000000011533b45d _pthread_wqthread + 314
        23  libsystem_pthread.dylib             0x000000011533a42f start_wqthread + 15
    )

Detox: 18.12.2 React Native: 0.64.1 Node: 14.1 Device: iOS Simulator 11 Xcode: 12.5 macOS: Big Sur (github macos-11)

d4vidi commented 3 years ago

@SiM07 it seems that, similar to everyone else's cases, your app crashes. However, in your case, the stack-trace doesn't appear to suggest anything related to Detox (the top-most frames are just Detox' crash handler, not related to the source). @alon-ha please verify...

alon-ha commented 3 years ago

@SiM07 Whenever you are running detox and your app crash, you will see "Signal 11 was raised", but it doesn't mean the crash was related to detox.. In your case detox only caught it.

alon-ha commented 3 years ago

@walterholohan @sypl I created a DetoxTemplate project that you can fork and add an example test which reproduce your issue. It will be great if you can do so and I will be able to solve it by cloning and debug locally.

meshaabi commented 3 years ago

Facing the same issue, sentry caught it as OutOfMemory : The OS most likely terminated your app because it overused RAM. : but theres no more context ...

will report if we find more info

alon-ha commented 3 years ago

Facing the same issue, sentry caught it as OutOfMemory : The OS most likely terminated your app because it overused RAM. : but theres no more context ...

will report if we find more info

Not necessarily related. Signal 11 Raised whenever the app crash. Here the bug related to DetoxSync DetoxSync 0x00000001063d274f -[_DTXTimerTrampoline fire:] + 188 Post the stack trace to see if it's seems to be the same issue or just a general crash which is not related to detox

meshaabi commented 3 years ago

@alon-ha thanks for the super quick response ! Seems like you are already on it :)

My issue might actually be a leak (exact same trace as Sim07's trace )

and most likely related to the firebase stuff stuff you are already looking in a couple of other tickets.

alon-ha commented 3 years ago

@meshaabi The trace you linked is a crash but not necessarily related to detox itself. See what @d4vidi commented after the trace. I will say it again - every time your app crash while detox is running you will see something like this: 0x0000000107b8b940 __DTXHandleCrash + 464 Doesn't mean the crash is from detox though.. In this ticket 5 DetoxSync 0x00000001063d274f -[_DTXTimerTrampoline fire:] + 188 is the thing which pointed to DetoxSync.

I hope fixing the issue with firebase will help you, but I'm not sure that's the issue in your case

todorone commented 3 years ago

My message won't bring much info, but still. On detox 17 we do not have this crash ever.

Upgrading to Detox 18 leads to occasional(not 100% reproducible) such crashes - probably on iOS only.

On M1 Mac mini these crashes are much more frequent(>50%), on x86 MacBook they are rarer (~10-20%).

alon-ha commented 3 years ago

@todorone Yes I can confirm. This bug specifically related to DetoxSync which was introduce since detox 18. Before we used EarlGrey for synchronisations. DetoxSynch is much less CPU demanding and have other benefits, with time it will be more and more stable and I'm working on fixing this issue.

M1 is a different story.. Seems that many RN libraries are flakey on M1 and I didn't have the chance to check Detox on M1 yet. I don't think the solution for M1 issues will be soon. I'm working more on stabilising DetoxSynch at the moment

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this reporsitory, read this discussion.

todorone commented 3 years ago

Still relevant

dirkpostma commented 3 years ago

Not sure, but similar issue here every now and then.

detox[52662] ERROR: [WS_ERROR] The app has crashed, see the details below:

Signal 11 was raised
(
    0   Detox                               0x0000000108fa1c45 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
    1   Detox                               0x0000000108fa4e50 __DTXHandleCrash + 464
    2   Detox                               0x0000000108fa5595 __DTXHandleSignal + 59
    3   libsystem_platform.dylib            0x00007fff60335d7d _sigtramp + 29
    4   libsystem_c.dylib                   0x00007fff8000a728 __global_locale + 0
    5   CoreFoundation                      0x00007fff20492833 -[__NSDictionaryM dealloc] + 128
    6   libobjc.A.dylib                     0x00007fff20191604 objc_object::sidetable_release(bool, bool) + 174
    7   libobjc.A.dylib                     0x00007fff2018d8ad _object_remove_assocations + 562
    8   libobjc.A.dylib                     0x00007fff2018ac02 objc_destructInstance + 84
    9   libobjc.A.dylib                     0x00007fff20190d88 -[NSObject dealloc] + 21
    10  Foundation                          0x00007fff207f7ca1 -[NSOperation dealloc] + 281
    11  libobjc.A.dylib                     0x00007fff20191604 objc_object::sidetable_release(bool, bool) + 174
    12  libsystem_blocks.dylib              0x00007fff20080432 _Block_release + 128
    13  libsystem_blocks.dylib              0x00007fff20080432 _Block_release + 128
    14  libsystem_blocks.dylib              0x00007fff20080432 _Block_release + 128
    15  MyhealthiApp                        0x0000000108365b60 __destroy_helper_block_e8_32s40s48s + 24
    16  libsystem_blocks.dylib              0x00007fff20080432 _Block_release + 128
    17  libsystem_blocks.dylib              0x00007fff20080432 _Block_release + 128
    18  libdispatch.dylib                   0x00007fff201078df _dispatch_client_callout + 8
    19  libdispatch.dylib                   0x00007fff2010df5c _dispatch_lane_serial_drain + 1042
    20  libdispatch.dylib                   0x00007fff2010e98c _dispatch_lane_invoke + 400
    21  libdispatch.dylib                   0x00007fff20118f81 _dispatch_workloop_worker_thread + 772
    22  libsystem_pthread.dylib             0x00007fff6034045d _pthread_wqthread + 314
    23  libsystem_pthread.dylib             0x00007fff6033f42f start_wqthread + 15
)
detox[52662] ERROR: [Client.js/ERROR] Detox can't seem to connect to the test app(s)!
ttkien commented 2 years ago

similar issue here every now and then.

 DetoxRuntimeError: The pending request #-1000 ("isReady") has been rejected due to the following error:

    The app has crashed, see the details below:

    Signal 11 was raised
    (
        0   Detox                               0x000000010ca45c45 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
        1   Detox                               0x000000010ca48e50 __DTXHandleCrash + 464
        2   Detox                               0x000000010ca49595 __DTXHandleSignal + 59
        3   libsystem_platform.dylib            0x0000000115819d7d _sigtramp + 29
        4   ScreenReaderCore                    0x0000000147725320 _dyld_private + 0
        5   DetoxSync                           0x0000000144bca74f -[_DTXTimerTrampoline fire:] + 188
        6   DetoxSync                           0x0000000144bb2b10 _DTXCFTimerTrampoline + 74
        7   CoreFoundation                      0x0000000112fe078a __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
        8   CoreFoundation                      0x0000000112fe027c __CFRunLoopDoTimer + 924
        9   CoreFoundation                      0x0000000112fdf81a __CFRunLoopDoTimers + 265
        10  CoreFoundation                      0x0000000112fd9e69 __CFRunLoopRun + 2013
        11  CoreFoundation                      0x0000000112fd91a7 CFRunLoopRunSpecific + 567
        12  EHLife                              0x000000010b182b81 +[RCTCxxBridge runRunLoop] + 449
        13  DetoxSync                           0x0000000144bbb00e swz_runRunLoopThread + 291
        14  Foundation                          0x000000010e7678a9 __NSThread__start__ + 1068
        15  libsystem_pthread.dylib             0x00000001158408fc _pthread_start + 224
        16  libsystem_pthread.dylib             0x000000011583c443 thread_start + 15
    )

      2 | 
      3 | beforeAll(async () => {
    > 4 |   await device.launchApp({
        |                ^
      5 |     permissions: {
      6 |       notifications: 'YES',
      7 |       userTracking: 'YES',

    at _callee$ (init.js:4:16)
      at tryCatch (../../node_modules/regenerator-runtime/runtime.js:45:40)
      at Generator.invoke [as _invoke] (../../node_modules/regenerator-runtime/runtime.js:274:22)
      at Generator.prototype.<computed> [as next] (../../node_modules/regenerator-runtime/runtime.js:97:21)
      at tryCatch (../../node_modules/regenerator-runtime/runtime.js:45:40)
      at invoke (../../node_modules/regenerator-runtime/runtime.js:135:20)
      at ../../node_modules/regenerator-runtime/runtime.js:170:11
      at callInvokeWithMethodAndArg (../../node_modules/regenerator-runtime/runtime.js:169:16)
      at AsyncIterator.enqueue (../../node_modules/regenerator-runtime/runtime.js:192:13)
      at AsyncIterator.prototype.<computed> [as next] (../../node_modules/regenerator-runtime/runtime.js:97:21)
      at Object.<anonymous>.exports.async (../../node_modules/regenerator-runtime/runtime.js:219:14)
      at _callee (init.js:3:11)

detox: 18.20.3 React Native: 0.64.1 react-native-firebase 11.4.1 Node: 12.14.1 Device: simluator iPhone 11 Xcode: 12.5 iOS: 14.5 macOS: 11.4 Mac chip: intel i7

parkcoop commented 2 years ago

Any solutions for this? Seeing same inconsistent behavior, did not see this on v17

jaheikki commented 2 years ago

Same here, still waiting fix for this issue to be able to upgrade to v18, now using v17 due to instability of v18.

d4vidi commented 2 years ago

Thanks guys. We will onboard with trying to address these random crashes by the year's end. In the meantime, it is highly recommended that you'd inspect your device logs - look up these crashes there, and then try to find a Javascript stacktrace. Sometimes, it can lead you to the place in the JS code that crashes.

shamilovtim commented 2 years ago

@SiM07 Whenever you are running detox and your app crash, you will see "Signal 11 was raised", but it doesn't mean the crash was related to detox.. In your case detox only caught it.

Could Detox possibly bubble up the track trace of the original crash? It's tough to debug without the original error message / stack trace.

dirkpostma commented 2 years ago

@d4vidi any idea how to access device logs on CI after the crash happened?

I found this:

Go to: Settings.app > Privacy > Analytics > Analytics Data >
Locate the sysdiagnose file and AirDrop it to your Mac. Scroll down, if necessary, to the point where you see the sysdiagnose with today's date, tap on that file and then tap the box with an arrow in it at the top right. Then choose the Mac device to send it to from the list of devices that appear in the AirDrop area. Once the transfer is complete (this may take several minutes), the file will be located in the /Users/[Your Username]/Downloads folder. The name will be similar to this: “sysdiagnose_YYYY.MM.DD_HH-MM-SS-XX..."

This doesn’t work for me as the crashes only occur on CI.

edit:

found this

~/Library/Logs/CoreSimulator/<simulator-hash>/system.log

Just need to figure out how to obtain the simulator hash and then store or dump tail of this file in a CI build step.

if other can do that to, might help finding the cause?

shamilovtim commented 2 years ago

I would love to know why these crashes mostly only occur on CI

todorone commented 2 years ago

@shamilovtim High chances that bc of significantly lower computing power on cloud service, but not sure.

dirkpostma commented 2 years ago

Different hardware? For me, crashes occur on macos build agent of Azure Pipelines.

May be we could post dump of system_profiler SPHardwareDataType?

No crashes on this system:

system_profiler SPHardwareDataType
2021-10-28 09:03:01.969 system_profiler[31539:3144100] Timed out waiting for the Activation Lock Capable check
Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro16,1
      Processor Name: 6-Core Intel Core i7
      Processor Speed: 2,6 GHz
      Number of Processors: 1
      Total Number of Cores: 6
      L2 Cache (per Core): 256 KB
      L3 Cache: 12 MB
      Hyper-Threading Technology: Enabled
      Memory: 16 GB
      System Firmware Version: 1554.140.20.0.0 (iBridge: 18.16.14759.0.1,0)
      Serial Number (system): C02C3L90MD6M
      Hardware UUID: 3D0629DD-F574-5072-988E-F2D18A5F7355
      Provisioning UDID: 3D0629DD-F574-5072-988E-F2D18A5F7355

Azure Pipeline build agent:

Hardware Overview:

      Model Name: Apple device
      Model Identifier: VMware7,1
      Processor Speed: 3.33 GHz
      Number of Processors: 1
      Total Number of Cores: 3
      L2 Cache (per Core): 256 KB
      L3 Cache: 12 MB
      Memory: 14 GB
      Boot ROM Version: VMW71.00V.13989454.B64.1906190538
      Apple ROM Info: [MS_VM_CERT/SHA1/27d66596a61c48dd3dc7216fd715126e33f59ae7]Welcome to the Virtual Machine
      SMC Version (system): 2.8f0
      Serial Number (system): VMitwzvPZgjs
      Hardware UUID: 4203018E-580F-C1B5-9525-B745CECA79EB
demchenko-a commented 2 years ago

Random crash

DetoxRuntimeError: The pending request #-1000 ("isReady") has been rejected due to the following error:

The app has crashed, see the details below:

Signal 11 was raised
(
    0   Detox                               0x000000010815dd45 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
    1   Detox                               0x00000001081609e0 __DTXHandleCrash + 464
    2   Detox                               0x0000000108161125 __DTXHandleSignal + 59
    3   libsystem_platform.dylib            0x00007fff6115dd7d _sigtramp + 29
    4   ???                                 0x0000000000000000 0x0 + 0
    5   CoreFoundation                      0x00007fff20490049 -[__NSDictionaryM dealloc] + 128
    6   libobjc.A.dylib                     0x00007fff2018f834 objc_object::sidetable_release(bool, bool) + 174
    7   libobjc.A.dylib                     0x00007fff2018bb85 _object_remove_assocations + 580
    8   libobjc.A.dylib                     0x00007fff20188f25 objc_destructInstance + 84
    9   libobjc.A.dylib                     0x00007fff2018efb8 -[NSObject dealloc] + 21
    10  Sima                                0x0000000104664d8a -[FBSDKGraphRequestConnection dealloc] + 106
    11  libobjc.A.dylib                     0x00007fff2018f834 objc_object::sidetable_release(bool, bool) + 174
    12  CFNetwork                           0x00007fff236d0b10 _CFNetworkHTTPConnectionCacheSetLimit + 163652
    13  CFNetwork                           0x00007fff23519ec5 CFNetwork + 28357
    14  DetoxSync                           0x0000000109445bf0 ____detox_sync_dispatch_wrapper_block_invoke + 23
    15  libdispatch.dylib                   0x00007fff2010532f _dispatch_call_block_and_release + 12
    16  libdispatch.dylib                   0x00007fff20106508 _dispatch_client_callout + 8
    17  libdispatch.dylib                   0x00007fff2010c3f9 _dispatch_lane_serial_drain + 715
    18  libdispatch.dylib                   0x00007fff2010cfab _dispatch_lane_invoke + 458
    19  libdispatch.dylib                   0x00007fff20117577 _dispatch_workloop_worker_thread + 782
    20  libsystem_pthread.dylib             0x00007fff6116845d _pthread_wqthread + 314
    21  libsystem_pthread.dylib             0x00007fff6116742f start_wqthread + 15
)

  85 |   LogBox.ignoreAllLogs()
  86 |   await detox.init(config)
> 87 |   await device.launchApp({permissions: {notifications: 'YES', location: 'never'}})
     |                                   ^
  88 | })
  89 |
  90 | beforeEach(async () => {

detox: 18.23.1 react-native: 0.65.1 node: v16.11.1 Device: simluator iPhone 8 Xcode: 13.0 iOS: 14.4 and 15.0 macOS: Big Sur 11.6

shamilovtim commented 2 years ago

This crash appears for us on CircleCI macOS containers running Intel Xeon 10 core machines with 8 vCPU and 16GB ram.

On my local machine I tried to replicate low compute resourcing. I ran (all at the same time): GeekBench 5, Cinebench, "CPU Stress test" with 64 threads of compute set to 100% compute, multiple instances of node.js, the Detox/React Native bundler and I watched the Simulator without headless mode enabled. Even with all of my threads maxed and being hit by multiple processes I still could not reproduce these crashes, and I also cannot reproduce the kind of low framerate and lag that Detox gets on CI. My only conclusion can be that it's not resource limitations causing this. I think that Detox on iOS has some sort of issue when running it on a VM there is some sort of methods it uses on that conflicts with the queueing and scheduling of a hypervisor. This problem does not appear on bare metal but as soon as you introduce a VM you start to see degraded performance and eventually crashes. I don't think it's crashing because of the lack of performance of the VM (the VM might be powerful enough) but because it seems to lack stability and compatibility with VMs as a technology. So, for the Detox team to easily reproduce this issue, I would suggest running Detox in a macOS VM, however you can do that.

phuochau commented 2 years ago

Detox v19 had worked fine for me on iOS (with Firebase as well, my package is expo-firebase-analytics) in just some first builds but now I have the same issue, it failed every builds. I hope we can find a workaround or an update soon.

dameunbite commented 2 years ago

Got the same error. The app opens and displays the push notification modal but it closes (crashes) after 3 seconds of that initial display of successful run.

Command Runned: detox test --configuration ios

detox: 19.1.0 react-native: 0.66.1 node: v14.17.4 Device: simluator iPhone 12 Xcode: 12.5 iOS: 14.5 macOS: Big Sur 11.2.3 MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports) Processor: 2.3 GHz Dual-Core Intel Core i5 Memory: 8 GB 2133 MHz LPDDR3

` DetoxRuntimeError: The pending request #-1000 ("isReady") has been rejected due to the following error:

The app has crashed, see the details below:

Signal 11 was raised
(
    0   Detox                               0x00000001093a86c5 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
    1   Detox                               0x00000001093ab250 __DTXHandleCrash + 464
    2   Detox                               0x00000001093ab991 __DTXHandleSignal + 59
    3   libsystem_platform.dylib            0x00000001133a2d7d _sigtramp + 29
    4   ???                                 0x0000600000ed2400 0x0 + 105553131807744
    5   MobileMessaging                     0x000000010f9b78a1 function signature specialization <Arg[1] = Owned To Guaranteed> of Swift.Dictionary.subscript.setter : (A) -> Swift.Optional<B> + 225
    6   MobileMessaging                     0x000000010f9b5601 closure #1 () -> () in MobileMessaging.ThreadSafeDict.set(value: Swift.Optional<A>, forKey: Swift.String) -> () + 161
    7   MobileMessaging                     0x000000010f9a206e reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @callee_unowned @convention(block) () -> () + 14
    8   libdispatch.dylib                   0x0000000112ef88df _dispatch_client_callout + 8
    9   libdispatch.dylib                   0x0000000112efba87 _dispatch_block_invoke_direct + 281
    10  DetoxSync                           0x0000000140bfae97 ____detox_sync_dispatch_wrapper_block_invoke + 23
    11  libdispatch.dylib                   0x0000000112ef770d _dispatch_call_block_and_release + 12
    12  libdispatch.dylib                   0x0000000112ef88df _dispatch_client_callout + 8
    13  libdispatch.dylib                   0x0000000112efb44a _dispatch_continuation_pop + 445
    14  libdispatch.dylib                   0x0000000112efab0e _dispatch_async_redirect_invoke + 742
    15  libdispatch.dylib                   0x0000000112f08a8e _dispatch_root_queue_drain + 350
    16  libdispatch.dylib                   0x0000000112f09285 _dispatch_worker_thread2 + 102
    17  libsystem_pthread.dylib             0x00000001133c6453 _pthread_wqthread + 244
    18  libsystem_pthread.dylib             0x00000001133c5467 start_wqthread + 15
)

  1 | describe('Example', () => {
  2 |   beforeAll(async () => {
> 3 |     await device.launchApp();
    |                  ^
  4 |   });
  5 |
  6 |   beforeEach(async () => {

  at _callee$ (firstTest.e2e.js:3:18)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:63:40)
  at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:294:22)
  at Generator.next (../node_modules/regenerator-runtime/runtime.js:119:21)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:63:40)
  at invoke (../node_modules/regenerator-runtime/runtime.js:155:20)
  at ../node_modules/regenerator-runtime/runtime.js:190:11

● Example › should show hello screen after tap

DetoxRuntimeError: The pending request #-1000 ("isReady") has been rejected due to the following error:

The app has crashed, see the details below:

Signal 11 was raised
(
    0   Detox                               0x00000001093a86c5 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
    1   Detox                               0x00000001093ab250 __DTXHandleCrash + 464
    2   Detox                               0x00000001093ab991 __DTXHandleSignal + 59
    3   libsystem_platform.dylib            0x00000001133a2d7d _sigtramp + 29
    4   ???                                 0x0000600000ed2400 0x0 + 105553131807744
    5   MobileMessaging                     0x000000010f9b78a1 function signature specialization <Arg[1] = Owned To Guaranteed> of Swift.Dictionary.subscript.setter : (A) -> Swift.Optional<B> + 225
    6   MobileMessaging                     0x000000010f9b5601 closure #1 () -> () in MobileMessaging.ThreadSafeDict.set(value: Swift.Optional<A>, forKey: Swift.String) -> () + 161
    7   MobileMessaging                     0x000000010f9a206e reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @callee_unowned @convention(block) () -> () + 14
    8   libdispatch.dylib                   0x0000000112ef88df _dispatch_client_callout + 8
    9   libdispatch.dylib                   0x0000000112efba87 _dispatch_block_invoke_direct + 281
    10  DetoxSync                           0x0000000140bfae97 ____detox_sync_dispatch_wrapper_block_invoke + 23
    11  libdispatch.dylib                   0x0000000112ef770d _dispatch_call_block_and_release + 12
    12  libdispatch.dylib                   0x0000000112ef88df _dispatch_client_callout + 8
    13  libdispatch.dylib                   0x0000000112efb44a _dispatch_continuation_pop + 445
    14  libdispatch.dylib                   0x0000000112efab0e _dispatch_async_redirect_invoke + 742
    15  libdispatch.dylib                   0x0000000112f08a8e _dispatch_root_queue_drain + 350
    16  libdispatch.dylib                   0x0000000112f09285 _dispatch_worker_thread2 + 102
    17  libsystem_pthread.dylib             0x00000001133c6453 _pthread_wqthread + 244
    18  libsystem_pthread.dylib             0x00000001133c5467 start_wqthread + 15
)

  1 | describe('Example', () => {
  2 |   beforeAll(async () => {
> 3 |     await device.launchApp();
    |                  ^
  4 |   });
  5 |
  6 |   beforeEach(async () => {

  at _callee$ (firstTest.e2e.js:3:18)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:63:40)
  at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:294:22)
  at Generator.next (../node_modules/regenerator-runtime/runtime.js:119:21)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:63:40)
  at invoke (../node_modules/regenerator-runtime/runtime.js:155:20)
  at ../node_modules/regenerator-runtime/runtime.js:190:11

● Example › should show world screen after tap

DetoxRuntimeError: The pending request #-1000 ("isReady") has been rejected due to the following error:

The app has crashed, see the details below:

Signal 11 was raised
(
    0   Detox                               0x00000001093a86c5 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
    1   Detox                               0x00000001093ab250 __DTXHandleCrash + 464
    2   Detox                               0x00000001093ab991 __DTXHandleSignal + 59
    3   libsystem_platform.dylib            0x00000001133a2d7d _sigtramp + 29
    4   ???                                 0x0000600000ed2400 0x0 + 105553131807744
    5   MobileMessaging                     0x000000010f9b78a1 function signature specialization <Arg[1] = Owned To Guaranteed> of Swift.Dictionary.subscript.setter : (A) -> Swift.Optional<B> + 225
    6   MobileMessaging                     0x000000010f9b5601 closure #1 () -> () in MobileMessaging.ThreadSafeDict.set(value: Swift.Optional<A>, forKey: Swift.String) -> () + 161
    7   MobileMessaging                     0x000000010f9a206e reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @callee_unowned @convention(block) () -> () + 14
    8   libdispatch.dylib                   0x0000000112ef88df _dispatch_client_callout + 8
    9   libdispatch.dylib                   0x0000000112efba87 _dispatch_block_invoke_direct + 281
    10  DetoxSync                           0x0000000140bfae97 ____detox_sync_dispatch_wrapper_block_invoke + 23
    11  libdispatch.dylib                   0x0000000112ef770d _dispatch_call_block_and_release + 12
    12  libdispatch.dylib                   0x0000000112ef88df _dispatch_client_callout + 8
    13  libdispatch.dylib                   0x0000000112efb44a _dispatch_continuation_pop + 445
    14  libdispatch.dylib                   0x0000000112efab0e _dispatch_async_redirect_invoke + 742
    15  libdispatch.dylib                   0x0000000112f08a8e _dispatch_root_queue_drain + 350
    16  libdispatch.dylib                   0x0000000112f09285 _dispatch_worker_thread2 + 102
    17  libsystem_pthread.dylib             0x00000001133c6453 _pthread_wqthread + 244
    18  libsystem_pthread.dylib             0x00000001133c5467 start_wqthread + 15
)

  1 | describe('Example', () => {
  2 |   beforeAll(async () => {
> 3 |     await device.launchApp();
    |                  ^
  4 |   });
  5 |
  6 |   beforeEach(async () => {

  at _callee$ (firstTest.e2e.js:3:18)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:63:40)
  at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:294:22)
  at Generator.next (../node_modules/regenerator-runtime/runtime.js:119:21)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:63:40)
  at invoke (../node_modules/regenerator-runtime/runtime.js:155:20)
  at ../node_modules/regenerator-runtime/runtime.js:190:11

detox[18415] ERROR: [cli.js] Command failed: jest --config e2e/config.json --testNamePattern '^((?!:android:).)*$' e2e `

After trying many times...

For me was to allow push notification right after the modal appeared

Fortidude commented 2 years ago

Android debug: ✅ Android release: ✅ iOS debug ✅ iOS release: ❌

Detox can install the app without any issues but launching ends up with the below crash. Running the installed app manually works perfectly fine (however tests are failing as detox is not connected)

detox[14040] ERROR: [WS_ERROR] The app has crashed, see the details below:

Signal 11 was raised
(
    0   Detox                               0x00000001025c7620 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 44
    1   Detox                               0x00000001025ca460 __DTXHandleCrash + 492
    2   Detox                               0x00000001025cab9c __DTXHandleSignal + 80
    3   libsystem_platform.dylib            0x00000001c7fd3760 _sigtramp + 52
    4   DetoxSync                           0x000000010474b7d4 +[DTXRunLoopSyncResource _existingSyncResourceWithRunLoop:clear:] + 144
    5   DetoxSync                           0x000000010474b7d4 +[DTXRunLoopSyncResource _existingSyncResourceWithRunLoop:clear:] + 144
    6   DetoxSync                           0x0000000104745c9c +[DTXSyncManager _untrackCFRunLoop:] + 56
    7   DetoxSync                           0x0000000104745c28 +[DTXSyncManager untrackCFRunLoop:] + 104
    8   DetoxSync                           0x000000010474180c swz_runRunLoopThread + 148
    9   Foundation                          0x000000018083a4f4 __NSThread__start__ + 772
    10  libsystem_pthread.dylib             0x00000001c7fde910 _pthread_start + 116
    11  libsystem_pthread.dylib             0x00000001c7fd9b1c thread_start + 8
)

edit:

fatlinesofcode commented 2 years ago

same issue here, when updated to xcode 13 and detox v19

app crashes on startup or first tap

detox[63660] INFO: [test.js] DETOX_CONFIGURATION="ios.sim.debug" DETOX_LOGLEVEL="verbose" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1638154622847 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern '^((?!:android:).)*$' --maxWorkers 1 e2e/000-screens/ShopScreen.e2e.js

`● CategoryScreen › can tap on Category Tab and see Shop Categories

DetoxRuntimeError: The pending request #6 ("invoke") has been rejected due to the following error:

The app has crashed, see the details below:

Signal 11 was raised
(
    0   Detox                               0x000000010cdf66c5 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
    1   Detox                               0x000000010cdf9250 __DTXHandleCrash + 464
    2   Detox                               0x000000010cdf9991 __DTXHandleSignal + 59
    3   libsystem_platform.dylib            0x00007fff6bfe7e2d _sigtramp + 29
    4   ???                                 0x00000003005800d3 0x0 + 12890669267
    5   CoreFoundation                      0x00007fff2046ccdf -[__NSDictionaryM dealloc] + 128
    6   libobjc.A.dylib                     0x00007fff2019c9f7 objc_object::sidetable_release(bool, bool) + 177
    7   libobjc.A.dylib                     0x00007fff20198cb3 _object_remove_assocations + 578
    8   libobjc.A.dylib                     0x00007fff20196207 objc_destructInstance + 84
    9   libobjc.A.dylib                     0x00007fff2019c187 -[NSObject dealloc] + 21
    10  Foundation                          0x00007fff207dcd86 -[NSOperation dealloc] + 280
    11  libobjc.A.dylib                     0x00007fff2019c9f7 objc_object::sidetable_release(bool, bool) + 177
    12  Adore Beauty                        0x0000000108666145 __destroy_helper_block_e8_32s40s + 53
    13  libsystem_blocks.dylib              0x00007fff2008a434 _Block_release + 130
    14  Adore Beauty                        0x000000010866ed1d __destroy_helper_block_e8_32s + 29
    15  libsystem_blocks.dylib              0x00007fff2008a434 _Block_release + 130
    16  Adore Beauty                        0x0000000108666145 __destroy_helper_block_e8_32s40s + 53
    17  libsystem_blocks.dylib              0x00007fff2008a434 _Block_release + 130
    18  Adore Beauty                        0x0000000108667223 __destroy_helper_block_e8_32s40s48s + 51
    19  libsystem_blocks.dylib              0x00007fff2008a434 _Block_release + 130
    20  libsystem_blocks.dylib              0x00007fff2008a434 _Block_release + 130
    21  libdispatch.dylib                   0x00007fff20111a56 _dispatch_client_callout + 8
    22  libdispatch.dylib                   0x00007fff201181ab _dispatch_lane_serial_drain + 1006
    23  libdispatch.dylib                   0x00007fff20118c31 _dispatch_lane_invoke + 400
    24  libdispatch.dylib                   0x00007fff201236de _dispatch_workloop_worker_thread + 772
    25  libsystem_pthread.dylib             0x00007fff6bff208f _pthread_wqthread + 326
    26  libsystem_pthread.dylib             0x00007fff6bff101b start_wqthread + 15
)

  44 |     .tap()
  45 |
> 46 | export const tapElement = targetId => element(by.id(targetId)).tap()

`

detox[63662] ERROR: [WS_ERROR] The app has crashed, see the details below:

Signal 11 was raised
(
        0   Detox                               0x000000010bee56c5 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 37
        1   Detox                               0x000000010bee8250 __DTXHandleCrash + 464
        2   Detox                               0x000000010bee8991 __DTXHandleSignal + 59
        3   libsystem_platform.dylib            0x00007fff6bfe7e2d _sigtramp + 29
        4   ???                                 0x0000000300580720 0x0 + 12890670880
        5   CoreFoundation                      0x00007fff2046ccdf -[__NSDictionaryM dealloc] + 128
        6   libobjc.A.dylib                     0x00007fff2019c9f7 objc_object::sidetable_release(bool, bool) + 177
        7   libobjc.A.dylib                     0x00007fff20198cb3 _object_remove_assocations + 578
        8   libobjc.A.dylib                     0x00007fff20196207 objc_destructInstance + 84
        9   libobjc.A.dylib                     0x00007fff2019c187 -[NSObject dealloc] + 21
        10  Foundation                          0x00007fff207dcd86 -[NSOperation dealloc] + 280
        11  libobjc.A.dylib                     0x00007fff2019c9f7 objc_object::sidetable_release(bool, bool) + 177
        12  Adore Beauty                        0x0000000107755145 __destroy_helper_block_e8_32s40s + 53
        13  libsystem_blocks.dylib              0x00007fff2008a434 _Block_release + 130
        14  Adore Beauty                        0x000000010775dd1d __destroy_helper_block_e8_32s + 29
        15  libsystem_blocks.dylib              0x00007fff2008a434 _Block_release + 130
        16  Adore Beauty                        0x0000000107755145 __destroy_helper_block_e8_32s40s + 53
        17  libsystem_blocks.dylib              0x00007fff2008a434 _Block_release + 130
        18  Adore Beauty                        0x0000000107756223 __destroy_helper_block_e8_32s40s48s + 51
        19  libsystem_blocks.dylib              0x00007fff2008a434 _Block_release + 130
        20  libsystem_blocks.dylib              0x00007fff2008a434 _Block_release + 130
        21  libdispatch.dylib                   0x00007fff20111a56 _dispatch_client_callout + 8
        22  libdispatch.dylib                   0x00007fff201181ab _dispatch_lane_serial_drain + 1006
        23  libdispatch.dylib                   0x00007fff20118c31 _dispatch_lane_invoke + 400
        24  libdispatch.dylib                   0x00007fff201236de _dispatch_workloop_worker_thread + 772
        25  libsystem_pthread.dylib             0x00007fff6bff208f _pthread_wqthread + 326
        26  libsystem_pthread.dylib             0x00007fff6bff101b start_wqthread + 15
)
curtismgt commented 2 years ago

We are also encountering this issue. Any attempt to run Detox in iOS release mode and the app crashes on startup consistently. This is what we're getting in the Detox logs (I've redacted some names but that's it):

detox[23251] DEBUG: [EXEC_CMD, #8] SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/<USER>/Library/Detox/ios/075c709bde4bb6c6740557752544a1647af51933/Detox.framework/Detox" /usr/bin/xcrun simctl launch 5F030634-40CD-4EF7-BC09-589294B9A616 <APP_NAME> --args -detoxServer ws://localhost:53073 -detoxSessionId f63bb79c-ccc9-877e-c388-32d930e34685 -detoxDisableHierarchyDump YES
detox[23251] DEBUG: [EXEC_TRY, #8] Launching <APP_NAME>...
detox[23251] TRACE: [EXEC_TRY_FAIL, #8] An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=5):
The request to open "<APP_NAME>" failed.
Unexpected error type.
Underlying error (domain=BSServiceConnectionErrorDomain, code=3):
    The operation couldn’t be completed. XPC error received on message reply handler
    XPC error received on message reply handler

It then goes on to attempt launching the app again and says it succeeds, but the app crashes.

asafkorem commented 2 years ago

Regarding the Signal 11 crashes when Firebase/Performace is integrated, see my comment on another related issue: https://github.com/wix/Detox/issues/3000#issuecomment-991940966.

If your app crashes on DetoxSync without Firebase/Performance integrated, this might be still relevant if you are using another framework / component that does ISA Swizzling. Hopefully we'll solve this issue from DetoxSync's end soon.

asafkorem commented 2 years ago

https://github.com/wix/Detox/pull/3135 was merged, it should solve the issue of DetoxSync crashes when Firebase/Performance is integrated, it was tested on the example apps that reproduced this issue.

We will release a version with this change soon.

Once you have updated a version (to the latest/next version), if any of you are still having Signal 11 crashes on DetoxSync, please open a new bug report with the required details.

francois-spectre commented 2 years ago

I got one

 detox test --configuration ios
14:08:51.278 detox[7398] INFO:  [test.js] DETOX_CONFIGURATION="ios" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1647522531274 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern '^((?!:android:).)*$' e2e
14:08:54.073 detox[7399] INFO:  Example is assigned to 67BCB574-19E2-4DBA-A372-E8072B2803D0 (iPhone 12)
14:08:54.365 detox[7399] INFO:  [AppleSimUtils.js] com.spectre.player.martini.dev launched. To watch simulator logs, run:
        /usr/bin/xcrun simctl spawn 67BCB574-19E2-4DBA-A372-E8072B2803D0 log stream --level debug --style compact --predicate 'process == "Martini Dev"'
14:08:56.017 detox[7399] INFO:  Example: should have welcome screen
14:09:01.062 detox[7399] INFO:  Example: should have welcome screen [FAIL]

 FAIL  e2e/firstTest.e2e.js (9.214 s)
  Example
    ✕ should have welcome screen (5042 ms)

  ● Example › should have welcome screen

    DetoxRuntimeError: The pending request #-1000 ("reactNativeReload") has been rejected due to the following error:

    The app has crashed, see the details below:

    Signal 11 was raised
    (
        0   Detox                               0x0000000107daf630 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 44
        1   Detox                               0x0000000107db2470 __DTXHandleCrash + 492
        2   Detox                               0x0000000107db2bac __DTXHandleSignal + 80
        3   libsystem_platform.dylib            0x00000001c99c2760 _sigtramp + 52
        4   DetoxSync                           0x0000000107bbb404 +[DTXRunLoopSyncResource _existingSyncResourceWithRunLoop:clear:] + 144
        5   DetoxSync                           0x0000000107bbb404 +[DTXRunLoopSyncResource _existingSyncResourceWithRunLoop:clear:] + 144
        6   DetoxSync                           0x0000000107bb5cf8 +[DTXSyncManager _untrackCFRunLoop:] + 56
        7   DetoxSync                           0x0000000107bb5c84 +[DTXSyncManager untrackCFRunLoop:] + 104
        8   DetoxSync                           0x0000000107bb154c swz_runRunLoopThread + 148
        9   Foundation                          0x000000018083b97c __NSThread__start__ + 788
        10  libsystem_pthread.dylib             0x00000001c99ce68c _pthread_start + 116
        11  libsystem_pthread.dylib             0x00000001c99c9898 thread_start + 8
    )

       5 |
       6 |   beforeEach(async () => {
    >  7 |     await device.reloadReactNative();
         |                  ^
       8 |   });
       9 |
      10 |   it('should have welcome screen', async () => {

      at _callee2$ (firstTest.e2e.js:7:18)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:63:40)
      at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:294:22)
      at Generator.next (../node_modules/regenerator-runtime/runtime.js:119:21)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:63:40)
      at invoke (../node_modules/regenerator-runtime/runtime.js:155:20)
      at ../node_modules/regenerator-runtime/runtime.js:190:11

14:09:01.217 detox[7398] ERROR: [cli.js] Command failed: jest --config e2e/config.json --testNamePattern '^((?!:android:).)*$' e2e

with "detox": "^19.5.3",

francois-spectre commented 2 years ago

Finally I realized that I had to manually open the IOS simulator on macos to see what's happening. (btw it is a weird behavior to get the IOS simulator headless by default since on Android the emulator is opened by default). So the issue happens because I didn't build the app with the js and the app was expecting the react-native dev server to be running.

rajathrao commented 2 years ago

I am getting similar issues too put a bug already !! I am getting Signal 6. I upgraded from Detox 17.x to 19.1 . Getting issues on debug version on local. Release version seems fine.

mazr422 commented 2 years ago

Hi, I am getting the issue again (Detox 19.6.9, react-native 0.64.3). It works first time when I restart my mac. but it fails after first successimage

mazr422 commented 2 years ago

It seems I didn't exit from the previous test. Can anyone help me?

ball-hayden commented 2 years ago

This error continues to be a mystery @mazr422 - see https://github.com/wix/Detox/issues/3207

If you're able to shed any extra light, I'm sure it would be appreciated.

mazr422 commented 2 years ago

@ball-hayden I can not share my package.json file, but I started with expo and ejected later. "detox": "^19.6.9", "jest": "^27.5.1", "sentry-expo": "^4.0.0", "react-native": "0.64.3", "expo-firebase-analytics": "~5.0.3", "expo-analytics-segment": "~11.0.3", ios: 15.4 macos: 12.4 Xcode: 13.3.1

mazr422 commented 2 years ago

image

d4vidi commented 2 years ago

@asafkorem (re @mazr422's case specifically) untrackCFRunLoop sounds like some deallocation has managed to explode during a cleanup attempt. Any leads on that?

ball-hayden commented 2 years ago

^ actually, that's something I'd wondered.

I wonder whether this is happening following a failed test assertion?

fatlinesofcode commented 2 years ago

fyi, we're not seeing this issue anymore,

detox 19.6.9 react-native 0.64 (also tested on rn68) @react-native-firebase/perf 13.0.0 & Firebase/Performance (8.9.1) pod

asafkorem commented 2 years ago

@asafkorem (re @mazr422's case specifically) untrackCFRunLoop sounds like some deallocation has managed to explode during a cleanup attempt. Any leads on that?

@d4vidi This looks like a classic expo crash on Detox, this is likely to be a deallocation issue. No leads on that.

sekitaka commented 1 year ago

How can I fix it in github actions?

ball-hayden commented 1 year ago

@sekitaka we'd all appreciate any debugging you are able to do regarding this issue - it's proving very hard to reproduce, particularly outwith CI runners.

You may find that you have a more stable suite by setting retires to one or two, but this is obviously a workaround and does result in longer run times.

Janaka-Steph commented 1 year ago

I am experiencing this issue trying to run tests on one of the Detox demo example on next branch, detox: "^20.0.13-prerelease.0" .

cd ./examples/demo-react-native npm run test:ios-debug

 Signal 11 was raised
    (
        0   Detox                               0x00000001047439f0 +[NSThread(DetoxUtils) dtx_demangledCallStackSymbols] + 44
        1   Detox                               0x00000001047466e0 __DTXHandleCrash + 492
        2   Detox                               0x0000000104746e1c __DTXHandleSignal + 80
        3   libsystem_platform.dylib            0x00000001bca38560 _sigtramp + 52
        4   DetoxSync                           0x00000001048df404 +[DTXRunLoopSyncResource _existingSyncResourceWithRunLoop:clear:] + 144
        5   DetoxSync                           0x00000001048df404 +[DTXRunLoopSyncResource _existingSyncResourceWithRunLoop:clear:] + 144
        6   DetoxSync                           0x00000001048d9cf8 +[DTXSyncManager _untrackCFRunLoop:] + 56
        7   DetoxSync                           0x00000001048d9c84 +[DTXSyncManager untrackCFRunLoop:] + 104
        8   DetoxSync                           0x00000001048d554c swz_runRunLoopThread + 148
        9   Foundation                          0x0000000180837ca0 __NSThread__start__ + 848
        10  libsystem_pthread.dylib             0x00000001bca444e4 _pthread_start + 116
        11  libsystem_pthread.dylib             0x00000001bca3f6cc thread_start + 8
    )
▶ npx react-native info                  
info Fetching system and libraries information...
System:
    OS: macOS 13.0
    CPU: (10) x64 Apple M1 Max
    Memory: 2.46 GB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.21.1 - /usr/local/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 8.1.4 - /opt/homebrew/bin/npm
    Watchman: 2022.10.31.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
    Android SDK:
      API Levels: 28, 30, 31, 32, 33
      Build Tools: 28.0.3, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 33.0.0
      System Images: android-32 | Google APIs ARM 64 v8a, android-32 | Google Play ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: 14.1/14B47b - /usr/bin/xcodebuild
  Languages:
    Java: javac 19 - /opt/homebrew/opt/openjdk/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0 
    react-native: 0.69.5 => 0.69.5 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found