Strange hang when calling signal()

Eric van Gyzen eric at vangyzen.net
Fri Aug 24 19:38:49 UTC 2018


On 8/24/18 2:23 PM, Konstantin Belousov wrote:
> On Fri, Aug 24, 2018 at 02:10:36PM -0500, Eric van Gyzen wrote:
>> On 8/24/18 1:53 PM, Konstantin Belousov wrote:
>>> Since then, we started locking most of that locks in parent around fork(2),
>>> all the code in lib/libthr/thread/thr_fork.c.  In particular, we lock rtld,
>>> malloc, and disable cancellation around fork.  So if your program used fork(2)
>>> but ended with the broken rtld it is worrying.
>>>
>>> On the other hand, we do not do that for vfork(2).  So yes, the minimal
>>
>> We also do not do that for rfork(2).  I think we should, but I have not
>> done any research into it.
> 
> I do not see how would it be correct to do that locking for vfork(2) because
> the address space is shared between parent and child.  For the similar reason,
> sometimes rfork(2) also leaves the address space shared and then we have
> the problem.

I wasn't suggesting that we do it for vfork(2).  I was only suggesting 
that we do it for rfork(2), and obviously only if !RFMEM (and certain 
other flag conditions).

Eric


More information about the freebsd-hackers mailing list