Exception logging (win32): Handle error codes correctly, add some more strings#414
Merged
bors[bot] merged 3 commits intowasmerio:masterfrom May 6, 2019
Merged
Conversation
Member
|
bors try |
Contributor
xmclark
approved these changes
May 6, 2019
| } | ||
|
|
||
| out_result->code = (uint64_t)signum; | ||
| out_result->code = (uint64_t)caughtExceptionCode; |
Contributor
There was a problem hiding this comment.
Great catch! Thanks for fixing this.
| EXCEPTION_GUARD_PAGE => "guard page", | ||
| EXCEPTION_INVALID_HANDLE => "invalid handle", | ||
| EXCEPTION_POSSIBLE_DEADLOCK => "possible deadlock", | ||
| _ => "unknown exception code", |
Contributor
There was a problem hiding this comment.
Having these extra cases will help with diagnosing errors. Thanks for adding them.
Contributor
|
bors r+ |
1 similar comment
Member
|
bors r+ |
bors bot
added a commit
that referenced
this pull request
May 6, 2019
414: Exception logging (win32): Handle error codes correctly, add some more strings r=syrusakbary a=hrydgard Ran into a situation with an unknown exception from Cranelift (will probably report that one separately). Turns out the signum was "1" though which does not seem to correspond to any of the Windows error codes, except possibly STATUS_GUARD_PAGE which is 0x80000001, but only if we lost the top bit somewhere. On Windows, exceptions seemed to be trapped by callProtected, which is implemented here: https://github.com/wasmerio/wasmer/blob/cade9a666f5dfedfc9352718988aa26f21b028f4/lib/win-exception-handler/exception_handling/exception_handling.c . It did not seem to correctly store and retrieve the exception code, instead always returning 1: ```longjmp(jmpBuf, 1);``` So I fixed it. And now the log output looks like this: ``` unhandled trap at 1560d5e7bab - code #c0000005: segmentation violation ``` Co-authored-by: Henrik Rydgård <henrik.rydgard@embark-studios.com> Co-authored-by: Syrus Akbary <me@syrusakbary.com> Co-authored-by: Mackenzie Clark <mackenzie.a.z.c@gmail.com>
Contributor
26 tasks
surban
pushed a commit
to rust-wasi-web/wwrr
that referenced
this pull request
Nov 9, 2024
Update Vite config, use the bundled SDK for FFMPEG example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ran into a situation with an unknown exception from Cranelift (will probably report that one separately). Turns out the signum was "1" though which does not seem to correspond to any of the Windows error codes, except possibly STATUS_GUARD_PAGE which is 0x80000001, but only if we lost the top bit somewhere.
On Windows, exceptions seemed to be trapped by callProtected, which is implemented here: https://github.com/wasmerio/wasmer/blob/cade9a666f5dfedfc9352718988aa26f21b028f4/lib/win-exception-handler/exception_handling/exception_handling.c . It did not seem to correctly store and retrieve the exception code, instead always returning 1:
longjmp(jmpBuf, 1);So I fixed it. And now the log output looks like this: