Detox: std::__1::bad_function_call (crash when using RN >= 0.48)

Detox stopped working after upgrading to react-native 0.48.3

Description

detox test --configuration ios.sim.debug                     
    node_modules/.bin/mocha specs/e2e --opts specs/e2e/mocha.opts --configuration ios.sim.debug  
    [...]

App starts then App crash. <HANGS for 12000 secs>

2017-09-15 09:50:51.764 myApp[90013:21708181] ☣️ Adding idling resource for queue: <OS_dispatch_queue: com.facebook.react.AccessibilityManagerQueue[0x6080000e6a80]>
2017-09-15 09:50:51.765 [info][tid:main][RCTRootView.m:301] Running application MyApp ({
    initialProps =     {
    };
    rootTag = 1;
})
libc++abi.dylib: terminating with unexpected exception of type std::__1::bad_function_call
Signal caught: Abort trap: 6
0   EarlGrey                            0x000000011d382009 grey_signalHandler + 249
1   libsystem_platform.dylib            0x00000001115f3b3a _sigtramp + 26
2   libsystem_pthread.dylib             0x00000001116112c8 _pthread_keys + 9720
3   libsystem_c.dylib                   0x000000011136288f abort + 127
4   libc++abi.dylib                     0x0000000111141ce5 __cxa_bad_cast + 0
5   libc++abi.dylib                     0x000000011115ccbd _ZL26default_unexpected_handlerv + 0
6   libobjc.A.dylib                     0x000000010ed013cf _ZL15_objc_terminatev + 114
7   libc++abi.dylib                     0x0000000111159f29 _ZSt11__terminatePFvvE + 8
8   libc++abi.dylib                     0x0000000111159fa3 _ZSt9terminatev + 51
9   libc++abi.dylib                     0x0000000111159ef4 _ZSt12__unexpectedPFvvE + 6
10  libc++abi.dylib                     0x000000011115a90f __cxa_call_unexpected + 137
11  myApp                               0x00000001088fe110 _ZN8facebook5react11JSCExecutor16initOnJSVMThreadEv + 1872

Node, Device, Xcode and macOS Versions

  • Node: 8.5.0
  • Device: iPhone 6 sim iOS 10.3
  • Xcode: 8.3.3
  • macOS: 10.12.6

“react”: “^16.0.0-rc.2”, “react-dom”: “^16.0.0-rc.2”, “react-native”: “0.48.3”, “detox”: “^5.6.2”,

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 80 (61 by maintainers)

Commits related to this issue

Most upvoted comments

Guys, we’re in the process of adding a test suite for modern RN versions (48,49). There currently is no support for these versions on Detox iOS. There’s no more need for examples, I think we have enough of them.

Stay tuned…

@kacgrzes , 5.8.2 is out

I will

It works again because when you launch the app using the icon, Detox is not injected in the app.

Sorry guys, I have not had time to look into this—working hard on DetoxInstruments. Hopefully, will have some time soon.

Found the issue. It’s a slight difference of how runloops run in iOS 10 and iOS 11. I am looking for an alternative solution.

Extreme programming at its best ‼️

Wow, it works! 🤣 🚀

Ok, first findings: it fails at initOnJSVMThread image

I’ll take a deeper look now.

If you wish to help debug this in native, upgrade the test project to 0.48 or 0.49, set the target to “none” in package json, add exception breakpoint in Xcode and run the test suite. It should reproduce and show where something has broken. We will be able to debug this early next week.

@simonracz @alexcfaber I have just pushed a proposed fix for 0.48. Could you please test? It’s not included in 5.9.3 release.

@rotemmiz sir, when can we expect this patch?

Ok, so to workaround (yep, it is a temporary hack) this issue you can go to JSCExecutor.cpp file and comment out JSCNativeHooks::installPerfHooks(m_context); line.

Although, keep in mind that you also need to workaround https://github.com/wix/detox/issues/267 (no solution found so far).

Could you break point there and run once with Detox and once without? See if there is a change of flow?

JSCExecutor.cpp:L231 JSCNativeHooks::installPerfHooks(m_context); crashes the app. Going deeper.

5.8.1 has not yet been fixed to support 0.48.X issues. We’ll be investigating soon.