From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Dec 28 12:30:30 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BF7516A4CE for ; Tue, 28 Dec 2004 12:30:30 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6189843D1F for ; Tue, 28 Dec 2004 12:30:30 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iBSCUTFG045950 for ; Tue, 28 Dec 2004 12:30:29 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id iBSCUTbo045941; Tue, 28 Dec 2004 12:30:29 GMT (envelope-from gnats) Date: Tue, 28 Dec 2004 12:30:29 GMT Message-Id: <200412281230.iBSCUTbo045941@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: Drazen Kacar Subject: Re: ports/62377: strace hangs when running programs from command line X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Drazen Kacar List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Dec 2004 12:30:30 -0000 The following reply was made to PR ports/62377; it has been noted by GNATS. From: Drazen Kacar To: freebsd-gnats-submit@FreeBSD.org, nge@cs.hmc.edu Cc: Subject: Re: ports/62377: strace hangs when running programs from command line Date: Sun, 26 Dec 2004 17:15:21 +0100 --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Happened to me too, with 5.2.1 and 5.3. Attached patch fixes the problem. I didn't test on 4.x systems. -- .-. .-. Yes, I am an agent of Satan, but my duties are largely (_ \ / _) ceremonial. | | dave@fly.srk.fer.hr --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="strace-4.5.1.diff" --- strace.c.orig Sun Dec 26 14:49:34 2004 +++ strace.c Sun Dec 26 16:33:21 2004 @@ -539,6 +539,23 @@ cleanup(); exit(1); } +#ifdef FREEBSD + { + int status; + pid_t err; + + do { + err = waitpid(pid, &status, WUNTRACED); + } while (err == -1 && errno == EINTR); + if (err == -1) { + fprintf(stderr, + "waitpid() failed: %s\n", + strerror(errno)); + cleanup(); + exit(1); + } + } +#endif #ifdef USE_PROCFS if (proc_open(tcp, 0) < 0) { fprintf(stderr, "trouble opening proc file\n"); --gBBFr7Ir9EOA20Yy--