From enami@sys.ptg.sony.co.jp Wed Feb 14 06:08:45 1996 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 Subject: processes dead lock if parent uses vfork and child gets control terminal and both are comunicates using pty and write it before exit. X-Send-Pr-Version: 3.2 >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: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Feb 14 06:10:01 PST 1996 >Closed-Date: Thu Sep 18 23:37:15 PDT 1997 >Last-Modified: Thu Sep 18 23:37:29 PDT 1997 >Originator: enami tsugutomo >Release: FreeBSD 2.2-CURRENT i386 >Organization: one of hackers in japan >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. >Release-Note: >Audit-Trail: State-Changed-From-To: open->feedback State-Changed-By: scrappy State-Changed-When: Mon Oct 21 23:19:35 PDT 1996 State-Changed-Why: Dust off the cobwebs - Confirm Status State-Changed-From-To: feedback->closed State-Changed-By: phk State-Changed-When: Thu Sep 18 23:37:15 PDT 1997 State-Changed-Why: timed out >Unformatted: