From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23945 invoked by alias); 18 Jul 2007 02:40:09 -0000 Received: (qmail 23607 invoked by uid 48); 18 Jul 2007 02:39:59 -0000 Date: Wed, 18 Jul 2007 02:40:00 -0000 Message-ID: <20070718023959.23606.qmail@sourceware.org> From: "cagney at redhat dot com" To: frysk-bugzilla@sourceware.org In-Reply-To: <20070712203353.4788.pmuldoon@redhat.com> References: <20070712203353.4788.pmuldoon@redhat.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug general/4788] Exe.get() Exceptions are not being thrown X-Bugzilla-Reason: AssignedTo Mailing-List: contact frysk-bugzilla-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: frysk-bugzilla-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00120.txt.bz2 List-Id: ------- Additional Comments From cagney at redhat dot com 2007-07-18 02:39 ------- (In reply to comment #4) > Replaced Exe.get() with standard File.getCanonicalPath(): > > frysk-core/frysk/proc/live/ChangeLog > 2007-07-16 Mark Wielaard > > * LinuxProc.java (sendrecExe): Use File.getCanonicalPath(). > > frysk-imports/frysk/sys/proc/ChangeLog > 2007-07-16 Mark Wielaard > > * Exe.java: Removed. > * cni/Exe.cxx: Likewise. > > Please report if the problem manifests itself even with this patch applied. This isn't the problem. frysk.sys.proc.Exe.get() returns the _contents_ of the link /proc/$$/exe, while File.getCanonicalPath() attempts to resolve a chain of links, using something like repeated stat and readlink(2) calls to determine a final path. This leads to Exe.get() returning strings such as "/bin/bash (deleted)", or occasionally, what appears to be a corrupt string, while getCanonicalPath will throw an IOException. The apparently corrupt string is caused by a kernel "feature" where it is trying to track the executable as it is renamed. The "feature" can lead to some strange sequences. vis, how things should work: $ cp /bin/bash /tmp $ mkdir /tmp/x $ /tmp/bash bash$ mv /tmp/bash /tmp/x bash$ ls -l /proc/$$/exe -> /tmp/x/bash and when something is deleted: $ cp /bin/bash /tmp $ /tmp/bash bash$ rm /tmp/bash bash$ ls -l /proc/$$/exe -> /bin/bash (deleted) how things get confused: $ cp /bin/bash /tmp $ cp /bin/bash /tmp/a-really-long-file $ /bin/bash bash$ mv /tmp/a-really-long-file /tmp/bash bash$ ls -l /proc/$$/exe -> /bin/bash a dump of the contents of the link shows it in fact contains something like: /bin/bash^@lly-long-file (deleted) and this will occur after pre-link as been run. The existing frysk.sys.proc.Exe was working as designed. -- http://sourceware.org/bugzilla/show_bug.cgi?id=4788 ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.