Skip to content

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

@sbc100

Description

@sbc100

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions