Date: Sat, 9 Mar 2002 12:28:07 +0100 (CET) From: Slaven Rezic <eserte@vran.herceg.de> To: FreeBSD-gnats-submit@freebsd.org Subject: kern/35703: /proc/curproc/file returns unknown Message-ID: <200203091128.g29BS7103320@vran.herceg.de>
next in thread | raw e-mail | index | archive | help
>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/<anything>/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 <unistd.h> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203091128.g29BS7103320>