-
Notifications
You must be signed in to change notification settings - Fork 939
Open
Milestone
Description
Describe the bug
Calling the WASIX abort() function (which is just a wrapper around __builtin_trap) from a thread causes the wasmer to exit with code 0. The exitcode should actually be non-zero. Calling __builtin_trap from the main thread works and has a non-zero exit code.
Steps to reproduce
Compile the following code to wasix WASM
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <errno.h>
#include <pthread.h>
#ifndef NULL
#define NULL ((void*)0)
#endif
void* abort_in_thread(void* arg) {
// Abnormal termination should never result in exit code 0
abort();
}
int main() {
pthread_t thread;
pthread_create(&thread, NULL, abort_in_thread, NULL);
pthread_join(thread, NULL);
return 5;
}
Then run it with wasmer
Expected behavior
Exit with a non-zero exit code
Actual behavior
Exits with exitcode zero
Additional context
Calling abort in the main thread works as intended
Reactions are currently unavailable
Metadata
Metadata
Labels
No labels