Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Feb 1996 23:10:10 +0900 (JST)
From:      enami@ba2.so-net.or.jp
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/1026: processes dead lock if parent uses vfork and child gets control terminal and both are comunicates using pty and write it before exit.
Message-ID:  <199602141410.XAA25315@euphoria.sys.ptg.sony.co.jp>
Resent-Message-ID: <199602141410.GAA02962@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1026
>Category:       kern
>Synopsis:       deadlocks if parent vfork and child has cntrl terminal and write through it and exit.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 14 06:10:01 PST 1996
>Last-Modified:
>Originator:     enami tsugutomo
>Organization:
one of hackers in japan
>Release:        FreeBSD 2.2-CURRENT i386
>Environment:

	FreeBSD 2.2 current of early feb or last jan, AIR 486MI, i486 DX4/100,
	12Mb of RAM, SCSI/I and SCSI/II hard disk with AHA 1542CF,
	#9 GXE level 12 video board, nobrand NE2000 compatible Network Card, ...

>Description:

	If,
		parent process prepare pseudo terminal,
		vfork(2) a child,
		and the child calll setsid(),
		ioctl (,TIOCSTTY,) to make tty side of pty as control terminal,
		(here, suppose that child tries to exec but it failed,
		for example, there is no such file ...)
		write(2) some diag message to control terminal,
		and exit,
	then both process wait each other, i.e. dead lock.

	parent process wait child to wakeup() in vfork syscall, and child
	waits to drain tty by someone else (but unfortunately it is slept
	parent) in exit syscall (of ttywait()).

	That's why GNU Emacs hangs if pass non existient full path name to
	start-process.

>How-To-Repeat:

	write sample programs do above, or eval (start-process "hoge" nil
	"/tmp/hoge/no/n/exi/s/t/path") in GNU Emacs 19.30 (at least i tested
	on it).

>Fix:
	
	NetBSD is recently changed to wakeup the parent earlier if PPWAIT flag
	is set.
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199602141410.XAA25315>