-
Notifications
You must be signed in to change notification settings - Fork 627
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
Revert "Return error when exception was raised after main thread fini… #2524
Conversation
…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.
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
Is that because a return from main gets compiled to |
how a return from main should behave is defined by C standard. |
@eloparco Is the PR good to you? Shall we merge it? |
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
Actually no, that's not the case, that's why the test was returning 1. The wasi-threads proposal doesn't state that the process ends if the main thread ends (as for phtreads). So in the test in the PR I would expect the main thread to end and the process to terminate after the spawned thread finishes. Since the thread raises a trap, I would expect it to be propagated. |
see WebAssembly/wasi-threads#21 |
So wasi-libc doesn't compile the return from main as In this scenario, shouldn’t the exception from the spawned thread be propagated and returned even if the main thread has already finished? That's what #2524 is reverting. |
Ok not sure that's what's currently implemented, last time I checked |
see also #2529 we should test how it should be, not what it happens to be implemented. |
But this is WAMR repository not the wasi-threads one. I think if we decide for a specific implementation we have to document it and test it, otherwise users wouldn't know what to expect. |
i'm not sure if i follow your logic. |
That whatever we implement we should update the test to check it.
The original commit was working as What I see from #2529 is that you want to implement it as |
it's broken. |
On posix-like platforms, the rest of wasi-threads tests should pass after the recent changes including the following PRs: bytecodealliance#2516 bytecodealliance#2524 bytecodealliance#2529
On posix-like platforms, the rest of wasi-threads tests should pass after the recent changes including the following PRs: bytecodealliance#2516 bytecodealliance#2524 bytecodealliance#2529
On posix-like platforms, the rest of wasi-threads tests should pass after the recent changes including the following PRs: bytecodealliance#2516 bytecodealliance#2524 bytecodealliance#2529
On posix-like platforms, the rest of wasi-threads tests should pass after the recent changes including the following PRs: bytecodealliance#2516 bytecodealliance#2524 bytecodealliance#2529
…shes" (bytecodealliance#2524) This reverts commit 71d43f3.
On posix-like platforms, the rest of wasi-threads tests should pass after the recent changes including the following PRs: bytecodealliance#2516, bytecodealliance#2524, bytecodealliance#2529, bytecodealliance#2571, bytecodealliance#2576 and bytecodealliance#2582.
…shes (#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.