[RFC PATCH v4 3/5] support record failure: flush stdout, use _exit ()

Florian Weimer fweimer@redhat.com
Wed Nov 21 18:55:00 GMT 2018


* Mathieu Desnoyers:

> ----- On Nov 21, 2018, at 1:50 PM, Florian Weimer fweimer@redhat.com wrote:
>
>> * Mathieu Desnoyers:
>> 
>>> Using "exit ()" from pthread_atfork handlers hangs the process. It is
>>> therefore not a good way to exit when reporting a testing error.
>>>
>>> Use _exit () instead, which directly exits the process. However,
>>> considering that the buffered stdout is used to output test failure
>>> messages, we first need to flush stdout before exiting.
>> 
>> This is not correct; we need the atexit handlers for cleaning up
>> temporary files.
>> 
>> It should be possible to call support_record_failure and rely on the
>> shared memory segment to register the test failure, so that it is
>> eventually reflected in the exit state (even if the failure happens in
>> the subprocess).
>
> Calling exit() from a pthread_atfork handler unfortunately seems to hang
> the process :-/
>
> What would you recommend to deal with that situation ?

Why do you want to terminate the process there?  Is this part of the
test?

Thanks,
Florian



More information about the Libc-alpha mailing list