emscripten-core / emscripten-core/posixtestsuite
conformance/interfaces/pthread_create/10-1.c is broken in several ways.
- Dominant language
- C
- Stars
- 67
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
Firstly, relies on uninitialized stack data to create a (hopefully-invalid and crash-causing pthread_attr_t:
https://github.com/emscripten-core/posixtestsuite/blob/869e266b090a8d44e51bb040904c942556b1e4ab/conformance/interfaces/pthread_create/10-1.c#L97
Secondly it calls pthread_exit() with an error code from a signal handler installed on the main thread:
https://github.com/emscripten-core/posixtestsuite/blob/869e266b090a8d44e51bb040904c942556b1e4ab/conformance/interfaces/pthread_create/10-1.c#L89
The author seems to think that calling pthead_exit() like this will cause the overall test to return the error code, but that is now how it works. Calling pthead_exit form the main thread always exist with code 0.. the value passed to pthread_exit is *only* used when the thread is being joined.. not when exiting the process. This means the test will print that it failed `Test FAILED: Did not receive segmentation fault signal, waited 10 seconds` but actually return zero as the process exit code.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.