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

[Crash] EXC_BAD_INSTRUCTION (SIGILL) RCTLog.m:37 #2423

Closed
paramaggarwal opened this issue Aug 24, 2015 · 15 comments
Closed

[Crash] EXC_BAD_INSTRUCTION (SIGILL) RCTLog.m:37 #2423

paramaggarwal opened this issue Aug 24, 2015 · 15 comments
Assignees
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@paramaggarwal
Copy link
Contributor

The crash report points to this line: __attribute__((constructor)) in RCTLog.m:37. Looks like a very cryptic issue deep within the system internals and not really with the code itself. Anyone else hitting this? Any way we can avoid this?

Hardware Model:      iPhone7,2
Code Type:           ARM-64 (Native)
Parent Process:      launchd [1]

Date/Time:           2015-08-21 08:51:08.887 +0530
Launch Time:         2015-08-21 08:51:08.691 +0530
OS Version:          iOS 8.4 (12H143)
Report Version:      105

Exception Type:  EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x00000000e9d55821
Triggered by Thread:  0

Thread 0 name:
Thread 0 Crashed:
0   AppName                          0x00000001002c8728 RCTLogSetup + 0 (RCTLog.m:37)
1   dyld                            0x00000001200b93ec ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 32 (ImageLoaderMachO.cpp:1811)
2   dyld                            0x00000001200b5688 ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 328 (ImageLoader.cpp:1017)
3   dyld                            0x00000001200b54d8 ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 136 (ImageLoader.cpp:489)
4   dyld                            0x00000001200b57a0 ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 80 (ImageLoader.cpp:504)
5   dyld                            0x00000001200aa150 dyld::initializeMainExecutable() + 196 (dyld.cpp:1122)
6   dyld                            0x00000001200ad8bc dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 2664 (dyld.cpp:4864)
7   dyld                            0x00000001200a9040 _dyld_start + 64 (dyldStartup.s:301)
@paramaggarwal
Copy link
Contributor Author

On http://stackoverflow.com/a/28652346 someone mentions that:

BTW the attribute(constructor) is more useful in C than in C++. In C++ you don't really need it, since you could have static data with some explicitly defined constructor in its class to achieve the same result.

Could we use the static data approach instead then? This is also the only place we use __attribute__((constructor)) in the entire React Native project.

@ide
Copy link
Contributor

ide commented Aug 24, 2015

cc @nicklockwood

@henrylilei
Copy link

We are using 0.9.0-rc in our production app and from the crash logs downloaded by Xcode our app is crashing a lot due to this exception. Is there any way we can get a fix on this? Thanks!

@paramaggarwal
Copy link
Contributor Author

We are seeing this in all stable releases since at least 0.7.

@nicklockwood
Copy link
Contributor

cc @javache

@javache
Copy link
Member

javache commented Aug 25, 2015

We haven't seen this crash ourselves so far. My suspicion would be that this is not being symbolicated exactly to the right source location, since RCTLogSetup isn't doing crazy memory-wise.

@henrylilei
Copy link

Thanks, any hints on how to get more information about this crash in production app? One thing I could try in our next release is to remove the RCTLog from the code base.

@paramaggarwal
Copy link
Contributor Author

@javache This was not showing up in Crashlytics for us - and only in the new Crashes pane of Xcode. @henrylilei Removing calls to RCTLog won't help. This is something that happens before the code has a chance to run.

@henrylilei
Copy link

Understood, how about removing the RCTLog entirely from the code base?

@mikeycaldwell
Copy link

We're seeing quite a lot of this exact crash as well through xcode crash reporter. Any update or suggestions?

@paramaggarwal
Copy link
Contributor Author

@javache Could you please check in the new Xcode Crash Logs (introduced in Xcode 6.3) once? Or any suggestions on how to 'symbolicate it to the right source location' as you mention. The number of crashes are significant for us as per Xcode - right since we first introduced RN into our app back in April.

@paramaggarwal
Copy link
Contributor Author

@nicklockwood I'm just exploring and trying to understand what might be the reason. What change does this particular diff effect? 0b21df4#diff-a18482c63473b7044f5c7afdabcb297aL34

It changes

void RCTLogSetup(void) __attribute__((constructor));
void RCTLogSetup()

to

__attribute__((constructor))
static void RCTLogSetup()

anything relevant to the crash here?

@javache
Copy link
Member

javache commented Aug 27, 2015

@paramaggarwal: that shouldn't make any difference as far as I'm aware, it just makes the function's definition local to the file.

I'll try moving all of this setup code to a dispatch_once.

@javache javache self-assigned this Aug 27, 2015
@paramaggarwal
Copy link
Contributor Author

@javache dispatch_once would be awesome, currently the whole file is all C. Looking forward to it, thanks!

@paramaggarwal
Copy link
Contributor Author

@javache Could you please take a look at this PR, we'll be shipping it to production to see if it fixes our crashes - need your help to see that I haven't broken anything with this change. Thanks!

@ghost ghost closed this as completed in b998e5a Sep 13, 2015
MattFoley pushed a commit to skillz/react-native that referenced this issue Nov 9, 2015
Summary: As per discussion in facebook#2423 - possible fix for crash. (cc: @​javache)

Please share feedback regarding the PR, we are going to be using this diff in production to see if it fixes the crashes we are seeing.

(fixes facebook#2423)
Closes facebook#2494

Reviewed By: @javache

Differential Revision: D2433515

Pulled By: @nicklockwood
@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants