-
Notifications
You must be signed in to change notification settings - Fork 576
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
Return error when exception encountered after main thread finishes #2169
Return error when exception encountered after main thread finishes #2169
Conversation
if (wasm_runtime_get_exception(wasm_module_inst)) { | ||
/* got an exception in spawned thread */ | ||
ret = 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also apply similar changes in file product-mini/platforms/windows/main.c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, done
e531a9f
to
17b6825
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…shes (bytecodealliance#2169)" This reverts commit 71d43f3. for some reasons, the original commit assumes a trap should win over exit even if the former is 1 second later. i don't see any reason it should.
…shes (bytecodealliance#2169)" This reverts commit 71d43f3. for some reasons, the original commit assumes a trap should win over an exit even if the former is 1 second behind the latter. i don't see any reason it should. in that case, the expected behavior is that the exit likely wins and the other thread won't even reach the code to raise a trap.
…shes (bytecodealliance#2169)" This reverts commit 71d43f3. for some reasons, the original commit assumes a trap should win over an exit even if the former is 1 second behind the latter. i don't see any reason it should. in that case, the expected behavior is that the exit likely wins and the other thread won't even reach the code to raise a trap.
…shes (bytecodealliance#2169)" This reverts commit 71d43f3. for some reasons, the original commit assumes a trap should win over an exit even if the former is 1 second behind the latter. i don't see any reason it should. in that case, the expected behavior is that the exit likely wins and the other thread won't even reach the code to raise a trap.
…tecodealliance#2169) Currently, if a thread is spawned and raises an exception after the main thread has finished, iwasm returns with success instead of returning 1 (i.e. error). Since wasm_runtime_get_wasi_exit_code waits for all threads to finish and only returns the wasi exit code, this PR performs the exception check again and returns error if an exception was raised.
Currently, if a thread is spawned and raises an exception after the main thread has finished already,
iwasm
returns with success, instead of returning1
(i.e. error).Since
wasm_runtime_get_wasi_exit_code
waits for all threads to finished, the exception check has to performed again after all threads have finished.