From owner-freebsd-questions@FreeBSD.ORG Thu Jan 26 17:13:36 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43E0E16A420 for ; Thu, 26 Jan 2006 17:13:36 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F5A843D49 for ; Thu, 26 Jan 2006 17:13:35 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id k0QHDXNL085664; Thu, 26 Jan 2006 11:13:33 -0600 (CST) (envelope-from dan) Date: Thu, 26 Jan 2006 11:13:33 -0600 From: Dan Nelson To: Proniewski Patrick Message-ID: <20060126171333.GB52542@dan.emsphone.com> References: <6F2F4E06-712A-4E3D-9124-7AC7E1B964BD@univ-lyon2.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6F2F4E06-712A-4E3D-9124-7AC7E1B964BD@univ-lyon2.fr> X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.11 Cc: freebsd-questions@freebsd.org Subject: Re: truss and procfs strange problem. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2006 17:13:36 -0000 In the last episode (Jan 26), Proniewski Patrick said: > I experience a strange problem with truss on FreeBSD 5.4 p8 : > > $ truss ls > truss: cannot open /proc/4509/mem: No such file or directory > $ truss ls > truss: PIOCWAIT: Input/output error The child process probably hasn't been fully started by the time the parent tries to attach to it. Adding a sleep(1) inside setup_and_wait() in setup.c just before it tries to open /proc/%d/mem is a quick hack that works. A better solution would be to retry the open and ioctl calls if they fail, after a short wait (but only doing so for a couple seconds in case there was a problem starting the child process). I have no idea why the PIOCWAIT ioctl would fail like that; the code path doesn't look like it's even able to return EIO. -- Dan Nelson dnelson@allantgroup.com