Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

expect SIGBUS for PROT_NONE access on macOS/*BSD due to overlapped timer #34

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

spoonincode
Copy link
Member

As I suspected at #30 (comment), now that I have my x86 macOS box updated so I can run latest XCode, indeed this needs to be a SIGBUS

#else //macos, *bsd
const int sig_on_prot_none_access = SIGBUS;
#endif
if (sig == sig_on_prot_none_access && timed_run_has_timed_out.load(std::memory_order_acquire) == false)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we check for both signals instead of having platform differences?

Suggested change
if (sig == sig_on_prot_none_access && timed_run_has_timed_out.load(std::memory_order_acquire) == false)
if ((sig == SIGSEV || sig == SIGBUS) && timed_run_has_timed_out.load(std::memory_order_acquire) == false)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we can probably do that because we never install a SIGBUS handler on Linux; so we will trade the specificity for a comment noting such nuance.

@spoonincode spoonincode merged commit 003e73f into main Feb 4, 2025
10 checks passed
@spoonincode spoonincode deleted the macos_sigbus_overlap branch February 4, 2025 15:52
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants