[iOS] Crash: NSRegularExpression(NSMatching) firstMatchInString:options:range:
See original GitHub issue- Review the documentation: https://facebook.github.io/react-native
- Search for existing issues: https://github.com/facebook/react-native/issues
- Use the latest React Native release: https://github.com/facebook/react-native/releases
Environment
OS: macOS High Sierra 10.13.4 Node: 6.11.3 Yarn: 1.3.2 npm: 3.10.10 Watchman: 4.9.0 Xcode: Xcode 9.0 Build version 9A235 Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed) react: ^16.3.0-alpha.1 => 16.4.1 react-native: 0.54.4 => 0.54.4
Description
Our project has much crash and the crash log has same information as follows:
Crash reason: EXC_BAD_ACCESS / KERN_INVALID_ADDRESS Crash Thread: 17
0 libicucore.A.dylib!icu::RegexMatcher::find(UErrorCode&) + 0x56c Found by: given as instruction pointer in context 1 libicucore.A.dylib!icu::RegexMatcher::find(UErrorCode&) + 0x5ac Found by: previous frame’s frame pointer 2 Foundation!-[NSRegularExpression(NSMatching) enumerateMatchesInString:options:range:usingBlock:] + 0x2c4 Found by: previous frame’s frame pointer 3 Foundation!-[NSRegularExpression(NSMatching) firstMatchInString:options:range:] + 0x7c Found by: previous frame’s frame pointer 4 React + 0x7351c Found by: previous frame’s frame pointer 5 React + 0x95414 Found by: previous frame’s frame pointer 6 React + 0x99048 Found by: previous frame’s frame pointer 7 React + 0x97bfc Found by: previous frame’s frame pointer 8 React + 0x99370 Found by: previous frame’s frame pointer 9 libdispatch.dylib!_dispatch_call_block_and_release + 0x14 Found by: previous frame’s frame pointer 10 libdispatch.dylib!_dispatch_client_callout + 0xc Found by: previous frame’s frame pointer 11 libdispatch.dylib!_dispatch_queue_serial_drain$VARIANT$armv81 + 0x234 Found by: previous frame’s frame pointer 12 libdispatch.dylib!_dispatch_queue_invoke$VARIANT$armv81 + 0x144 Found by: previous frame’s frame pointer 13 libdispatch.dylib!_dispatch_root_queue_drain_deferred_wlh$VARIANT$armv81 + 0x148 Found by: previous frame’s frame pointer 14 libdispatch.dylib!_dispatch_workloop_worker_thread$VARIANT$armv81 + 0x260 Found by: previous frame’s frame pointer 15 libsystem_pthread.dylib!_pthread_wqthread + 0x358 Found by: previous frame’s frame pointer 16 libsystem_pthread.dylib!start_wqthread + 0x0 Found by: previous frame’s frame pointer
I guess this crash will occur when react calls the native method
such as
NativeModules.RNLogger.*
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Image fetch maybe has multi-thread problem,you should change to this
@guoyabiniOS have you fixed this problem by using the code above?