Skip to content
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

conformance/interfaces/pthread_create/10-1.c is broken in several ways. #10

Open
sbc100 opened this issue Feb 2, 2022 · 0 comments
Open

Comments

@sbc100
Copy link
Contributor

sbc100 commented Feb 2, 2022

Firstly, relies on uninitialized stack data to create a (hopefully-invalid and crash-causing pthread_attr_t:

Secondly it calls pthread_exit() with an error code from a signal handler installed on the main thread:

pthread_exit((void*)PTS_FAIL);

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant