From owner-freebsd-bugs Wed Feb 14 06:10:03 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id GAA02970 for bugs-outgoing; Wed, 14 Feb 1996 06:10:03 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id GAA02962 Wed, 14 Feb 1996 06:10:02 -0800 (PST) Resent-Date: Wed, 14 Feb 1996 06:10:02 -0800 (PST) Resent-Message-Id: <199602141410.GAA02962@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, enami@ba2.so-net.or.jp Received: from sonyinet.sony.co.jp (sonyinet.sony.co.jp [202.238.80.17]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id GAA02706 for ; Wed, 14 Feb 1996 06:08:37 -0800 (PST) Received: from sonygw3.sony.co.jp ([43.0.1.249]) by sonyinet.sony.co.jp (8.6.10/3.3Wb-96011708) with ESMTP id XAA28244 for ; Wed, 14 Feb 1996 23:08:25 +0900 Received: from pavlov.sys.ptg.sony.co.jp by sonygw3.sony.co.jp (8.6.12+2.4W/6.4J.6) id XAA06760; Wed, 14 Feb 1996 23:08:09 +0900 Received: (from uucp@localhost) by pavlov.sys.ptg.sony.co.jp (8.7.1/3.4W2) with UUCP id XAA03407 for FreeBSD-gnats-submit@freebsd.org; Wed, 14 Feb 1996 23:08:08 +0900 (GMT+0900) Received: from euphoria.sys.ptg.sony.co.jp (euphoria [192.168.1.2]) by king-show.sys.ptg.sony.co.jp (8.7.3/3.4W2-uucp) with ESMTP id XAA09761 for ; Wed, 14 Feb 1996 23:10:11 +0900 (JST) Received: (from enami@localhost) by euphoria.sys.ptg.sony.co.jp (8.7.3/3.4W2-euphoria) id XAA25315; Wed, 14 Feb 1996 23:10:10 +0900 (JST) Message-Id: <199602141410.XAA25315@euphoria.sys.ptg.sony.co.jp> Date: Wed, 14 Feb 1996 23:10:10 +0900 (JST) From: enami@ba2.so-net.or.jp Reply-To: enami@ba2.so-net.or.jp To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 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. Sender: owner-bugs@freebsd.org Precedence: bulk >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: