[PATCH] malloc: Run fork handler as late as possible [BZ #19431]

Florian Weimer fweimer@redhat.com
Tue May 10 19:51:00 GMT 2016


On 05/10/2016 08:05 PM, Tulio Magno Quites Machado Filho wrote:
> Florian Weimer <fweimer@redhat.com> writes:
>
>> On 05/10/2016 03:41 PM, Tulio Magno Quites Machado Filho wrote:
>>
>>> The child is getting into a deadlock if the signal arrives before the parent
>>> is able to complete __malloc_fork_unlock_parent().
>>
>> But this could have happened before as well, right?
>
> Maybe, but I'm not able to reproduce this error before the removal of malloc
> hooks from the fork handler.

Hmm, maybe we are talking about a different failure?  I get a rare 
deadlock with an older glibc:

[fweimer@oldenburg tmp]$ x=0; while ./tst-mallocfork  ; do x=$((x + 1)) 
; done; echo $? $x
Timed out: killed the child process
0 22156
[fweimer@oldenburg tmp]$ x=0; while ./tst-mallocfork  ; do x=$((x + 1)) 
; done; echo $? $x
Timed out: killed the child process
0 10940

We looked at the test case internally a while back, and concluded it was 
invalid for several reasons.

Thanks,
Florian



More information about the Libc-alpha mailing list