Bug 1026 - deadlocks if parent vfork and child has cntrl terminal and write through it and exit.
Summary: deadlocks if parent vfork and child has cntrl terminal and write through it a...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 2.2-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1996-02-14 14:10 UTC by enami
Modified: 1997-09-19 07:37 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description enami 1996-02-14 14:10:01 UTC
	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.

Fix: 

NetBSD is recently changed to wakeup the parent earlier if PPWAIT flag
	is set.
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).
Comment 1 scrappy freebsd_committer freebsd_triage 1996-10-22 07:19:35 UTC
State Changed
From-To: open->feedback


Dust off the cobwebs - Confirm Status 
Comment 2 Poul-Henning Kamp freebsd_committer freebsd_triage 1997-09-19 07:37:15 UTC
State Changed
From-To: feedback->closed

timed out