NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/56276: exit hangs with vfork waiting



>Number:         56276
>Category:       kern
>Synopsis:       exit hangs with vfork waiting
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 25 04:30:01 +0000 2021
>Originator:     Michael van Elst
>Release:        NetBSD 9.99.85
>Organization:
	
>Environment:
System: NetBSD slowpoke 9.99.85 NetBSD 9.99.85 (SLOWPOKE) #13: Tue Jun 15 22:51:58 UTC 2021 mlelstv@slowpoke:/scratch2/obj.amd64/scratch/netbsd-current/src/sys/arch/amd64/compile/SLOWPOKE amd64
Architecture: x86_64
Machine: amd64
>Description:

When a process calls vfork(), it is suspended until the child exits
or calls execve().

When in this situation, a second thread of the parent calls exit()
the parent doesn't exit but waits uninterruptibly for the child.

 UID   PID PPID  CPU   PRI NI VSZ        RSS WCHAN   STAT TTY        TIME COMMAND
9997 26124 8261  29702 95  0  1074208864 716 lwpwait DEl+ pts/3 240:17.87 (ghc)
9997 15381 26124 29702 29  0  1074208864 716 parked  IV+  pts/3   0:00.00 /usr/pk

In this particular case the child also waits for a parent thread before calling
execve which results in a deadlock.

>How-To-Repeat:
Regularly happens when building ghc packages.

>Fix:
The parent thread that called vfork() should just be woken up and exit
with the process.

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index