Skip to content

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

Merged
spoonincode merged 2 commits intomainfrom
macos_sigbus_overlap
Feb 4, 2025
Merged

expect SIGBUS for PROT_NONE access on macOS/*BSD due to overlapped timer#34
spoonincode merged 2 commits intomainfrom
macos_sigbus_overlap

Conversation

@spoonincode
Copy link
Contributor

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
Contributor 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants