Date: Tue, 28 Dec 2004 12:30:29 GMT From: Drazen Kacar <dave@fly.srk.fer.hr> To: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/62377: strace hangs when running programs from command line Message-ID: <200412281230.iBSCUTbo045941@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/62377; it has been noted by GNATS. From: Drazen Kacar <dave@fly.srk.fer.hr> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412281230.iBSCUTbo045941>