Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

React Native fix #401

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/signalhandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void* GetPC(void* ucontext_in_void) {
#if (defined(HAVE_UCONTEXT_H) || defined(HAVE_SYS_UCONTEXT_H)) && defined(PC_FROM_UCONTEXT)
if (ucontext_in_void != NULL) {
ucontext_t *context = reinterpret_cast<ucontext_t *>(ucontext_in_void);
return (void*)context->PC_FROM_UCONTEXT;
return NULL;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still work on other systems as expected? I'd say you need to check using CMake whether ucontext_t contains the PC_FROM_UCONTEXT member first and only if it is not the case return NULL.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sergiud @Alec13355 Hey guys, any progress with PR? This fix is really needed on a few real projects.... Please decide the best way and merge it

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you a lot

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So are you saying something to the effect of if
((void*)context->PC_FROM_UCONTEXT!= NULL)) return Null;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oleksandr-dziuban @Alec13355 This PR is most likely not needed, as react-native has a patch to make this work. I had trouble with it many times and turns out all you need is to correctly configure third-party dependencies. Have a look here facebook/react-native#20774
There is a workaround in the issue description, important steps are 4 and 5. Some people recommend to configure glog manually (via. node_modules/react-native/scripts/third-party/glog-x.x.x/configure) but you need to give it parameters as stated here: facebook/react-native#19839 (comment)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomaskallup You shouldn't have to go in and manually configure a dependency of a dependency. That's the issue and that's why I made the PR.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Alec13355 This PR wouldn't prevent that tho... you would still need to go in node_modules and run the script to configure third-party dependencies, as it downloads glog and sets it up. I understand, that it's not convenient, but I think that's still issue on react-native part and should be solved there. As far as I know, Xcode should handle this configuration during build, but the new build system broke that part.
The issue I linked facebook/react-native#20774 is about this problem.

}
#endif
return NULL;
Expand Down