From owner-freebsd-questions Fri Nov 8 1:47:40 2002 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 CC33D37B401 for ; Fri, 8 Nov 2002 01:47:37 -0800 (PST) Received: from grummit.biaix.org (213-97-212-86.uc.nombres.ttd.es [213.97.212.86]) by mx1.FreeBSD.org (Postfix) with SMTP id F105F43E3B for ; Fri, 8 Nov 2002 01:47:35 -0800 (PST) (envelope-from joan@grummit.biaix.org) Received: (qmail 3711 invoked by uid 1000); 8 Nov 2002 09:46:43 -0000 Date: Fri, 8 Nov 2002 10:46:43 +0100 From: Joan Picanyol i Puig To: freebsd-questions@freebsd.org Subject: trouble with perl writing to pipes :( Message-ID: <20021108094643.GA3590@grummit.biaix.org> Mail-Followup-To: freebsd-questions@freebsd.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline User-Agent: Mutt/1.4i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I'm noticing some weird behaviour having perl writing to pipes (they eat my output): grummit:~/tmp/runwhen/dirs/root/runwhen/cvsup$ cat shownextrun #!/usr/bin/perl -w print('sleeping; next run at: ', scalar(localtime(time()+$ENV{'DELAY'})), "\n"); exec({ $ARGV[0] } @ARGV); grummit:~/tmp/runwhen/dirs/root/runwhen/cvsup$ DELAY=1 ./shownextrun true sleeping; next run at: Fri Nov 8 10:44:21 2002 grummit:~/tmp/runwhen/dirs/root/runwhen/cvsup$ DELAY=1 ./shownextrun true | cat grummit:~/tmp/runwhen/dirs/root/runwhen/cvsup$ Attached is the diff of the two ktrace outputs, one sending the output through the pipe, one without doing so. As showed above, running with the pipe eats my output. The diff was obtained by ripping the pid by "kdump -f ktrace.out.nopipe | cut -d ' ' -f 4- > ktrace.out.nopipe.nopid". The original dump's are available (as text) at http://biaix.org/pk/debug/ tks -- pica --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ktrace.diff" *** ktrace.out.pipe.nopid Fri Nov 8 10:22:18 2002 --- ktrace.out.nopipe.nopid Fri Nov 8 10:22:01 2002 *************** *** 1356,1366 **** perl CALL break(0x8058000) perl RET break 0 perl CALL break(0x8059000) perl RET break 0 perl CALL getpid ! perl RET getpid 3416/0xd58 perl CALL break(0x805a000) perl RET break 0 perl CALL fstat(0x3,0xbfbfd29c) perl RET fstat 0 perl CALL break(0x805c000) --- 1356,1366 ---- perl CALL break(0x8058000) perl RET break 0 perl CALL break(0x8059000) perl RET break 0 perl CALL getpid ! perl RET getpid 3410/0xd52 perl CALL break(0x805a000) perl RET break 0 perl CALL fstat(0x3,0xbfbfd29c) perl RET fstat 0 perl CALL break(0x805c000) *************** *** 1418,1429 **** perl RET read 624/0x270 perl CALL close(0x3) perl RET close 0 perl CALL fstat(0x1,0xbfbff83c) perl RET fstat 0 ! perl CALL break(0x8061000) ! perl RET break 0 perl CALL execve(0xbfbff5cc,0x8050080,0xbfbffb64) perl NAMI "/command/true" perl RET execve -1 errno 2 No such file or directory perl CALL execve(0xbfbff5cc,0x8050080,0xbfbffb64) perl NAMI "/bin/true" --- 1418,1434 ---- perl RET read 624/0x270 perl CALL close(0x3) perl RET close 0 perl CALL fstat(0x1,0xbfbff83c) perl RET fstat 0 ! perl CALL ioctl(0x1,TIOCGETA,0xbfbff870) ! perl RET ioctl 0 ! perl CALL write(0x1,0x8059000,0x30) ! perl GIO fd 1 wrote 48 bytes ! "sleeping; next run at: Fri Nov 8 10:16:29 2002 ! " ! perl RET write 48/0x30 perl CALL execve(0xbfbff5cc,0x8050080,0xbfbffb64) perl NAMI "/command/true" perl RET execve -1 errno 2 No such file or directory perl CALL execve(0xbfbff5cc,0x8050080,0xbfbffb64) perl NAMI "/bin/true" --azLHFNyN32YCQGCU-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message