From owner-freebsd-questions@FreeBSD.ORG Thu Jan 26 17:53:24 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 1A1AE16A420 for ; Thu, 26 Jan 2006 17:53:24 +0000 (GMT) (envelope-from patrick.proniewski@univ-lyon2.fr) Received: from smtp4-g19.free.fr (smtp4-g19.free.fr [212.27.42.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id AED0B43D46 for ; Thu, 26 Jan 2006 17:53:23 +0000 (GMT) (envelope-from patrick.proniewski@univ-lyon2.fr) Received: from [10.0.2.2] (boleskine.patpro.net [82.235.12.223]) by smtp4-g19.free.fr (Postfix) with ESMTP id 560B04F262; Thu, 26 Jan 2006 18:53:22 +0100 (CET) In-Reply-To: <20060126171333.GB52542@dan.emsphone.com> References: <6F2F4E06-712A-4E3D-9124-7AC7E1B964BD@univ-lyon2.fr> <20060126171333.GB52542@dan.emsphone.com> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: Proniewski Patrick Date: Thu, 26 Jan 2006 18:53:46 +0100 To: freebsd-questions@freebsd.org X-Mailer: Apple Mail (2.746.2) Cc: Dan Nelson 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:53:24 -0000 Hi, On 26 janv. 06, at 18:13, Dan Nelson wrote: >> $ 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). hmmm I see. In fact, I have the "cannot open" error for a normal =20 truss usage, and if I repeat the truss command very fast, I got the =20 second error (PIOCWAIT: Input/output error). Slowing down the process =20= is an interesting workaround : truss ls -> fails 100% of the time ktrace truss ls -> fail most of the time truss `which ls` -> works great. > I have no idea why the PIOCWAIT ioctl would fail like that neither have I... In fact, the 128 items limitation of my procfs =20 puzzles me even more. thanks Patrick PRONIEWSKI --=20 Administrateur Syst=E8me - SENTIER - Universit=E9 Lumi=E8re Lyon 2