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

Completely disable signal handler on 32-bit #1488

Merged
merged 4 commits into from
Jul 21, 2020
Merged

Conversation

binji
Copy link
Member

@binji binji commented Jul 16, 2020

The previous change prevented WASM_RT_MEMCHECK_SIGNAL_HANDLER_POSIX
from being defined, but WASM_RT_MEMCHECK_SIGNAL_HANDLER was still
defined, which would prevent the memory bounds check.

The previous change prevented `WASM_RT_MEMCHECK_SIGNAL_HANDLER_POSIX`
from being defined, but `WASM_RT_MEMCHECK_SIGNAL_HANDLER` was still
defined, which would prevent the memory bounds check.
wasm2c/wasm-rt.h Outdated
@@ -47,6 +47,8 @@ extern "C" {
#if defined(__linux__) || defined(__unix__) || defined(__APPLE__)
#if defined(__WORDSIZE) && __WORDSIZE != 64
#warning "Signal handler is only supported on 64-bit architectures"
#undef WASM_RT_MEMCHECK_SIGNAL_HANDLER
#define WASM_RT_MEMCHECK_SIGNAL_HANDLER 0
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps better not to enable it in the first place just above?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, but that's only done if it's not already defined, so it could be defined externally too. Though in that case, I guess we'd want to error out instead of warn.

Copy link
Member

Choose a reason for hiding this comment

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

I think an error would make more sense yeah. undef seems little odd.

Obviously this just a nit.

@binji
Copy link
Member Author

binji commented Jul 20, 2020

@sbc100 PTAL

wasm2c/wasm-rt.h Outdated
@@ -39,24 +39,32 @@ extern "C" {
*
* This is usually 10%-25% faster, but requires OS-specific support.
* */
// #define WASM_RT_MEMCHECK_SIGNAL_HANDLER 1
Copy link
Member

Choose a reason for hiding this comment

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

remove comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was using it as documentation of what the flag is. Maybe I could make that more clear?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe it inside the docstring? without the 1?

Something like Set the default value for WASM_RT_MEMCHECK_SIGNAL_HANDLER which determines ...?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@binji binji merged commit cd5ff13 into master Jul 21, 2020
@binji binji deleted the disable-sighandler branch July 21, 2020 20:39
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.

None yet

2 participants