From owner-freebsd-bugs Sat Mar 9 3:40:17 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 277F937B416 for ; Sat, 9 Mar 2002 03:40:04 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g29Be4r97337; Sat, 9 Mar 2002 03:40:04 -0800 (PST) (envelope-from gnats) Received: from mailoutvl21.berlin.de (mail.berlin.de [195.243.105.33]) by hub.freebsd.org (Postfix) with ESMTP id A40AA37B404 for ; Sat, 9 Mar 2002 03:33:05 -0800 (PST) Received: from herceg.de ([213.7.184.60]) by mailoutvl21.berlin.de (InterMail vK.4.03.05.00 201-232-132 license c0e4b842f1eddc5308d584e55543c802) with ESMTP id <20020309113508.GRUF27460.mailoutvl21@herceg.de> for ; Sat, 9 Mar 2002 12:35:08 +0100 Received: (from eserte@localhost) by vran.herceg.de (8.11.4/8.9.3) id g29BS7103320; Sat, 9 Mar 2002 12:28:07 +0100 (CET) (envelope-from eserte) Message-Id: <200203091128.g29BS7103320@vran.herceg.de> Date: Sat, 9 Mar 2002 12:28:07 +0100 (CET) From: Slaven Rezic Reply-To: Slaven Rezic To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: kern/35703: /proc/curproc/file returns unknown Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 35703 >Category: kern >Synopsis: /proc/curproc/file returns unknown >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Mar 09 03:40:04 PST 2002 >Closed-Date: >Last-Modified: >Originator: Slaven Rezic >Release: FreeBSD 4.3-STABLE i386 >Organization: www.rezic.de >Environment: System: FreeBSD vran.herceg.de 4.3-STABLE FreeBSD 4.3-STABLE #6: Mon Jul 9 11:49:47 CEST 2001 root@vran.herceg.de:/vran/home/src/FreeBSD-4/src/sys/compile/VRAN i386 >Description: Under some circumstances, the symbolic link /proc//file points to "unknown". In my experiments it seems that this is the case if a directory is created and/or removed in the as the executable and the executable is called with a relative path. Some of the sysctl variables vfs.cache.numfullpathfail[1-4] are increased. This problem causes one test failure in perl5.7.3. >How-To-Repeat: Compile the program below: ---------------------------------------------------------------------- #include main() { char buf[1024]; int len = readlink("/proc/curproc/file", buf, 1024); if (!len) exit(1); buf[len]=0; printf("<%s>\n", buf); } ---------------------------------------------------------------------- If run as ./a.out, it works OK. However, if a subdirectory in the same directory is deleted, then the program returns "unknown": mkdir foo ; rmdir foo ; ./a.out This works again: mkdir foo ; rmdir foo ; `pwd`/a.out >Fix: ??? >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message