From owner-freebsd-stable Sun Mar 16 12:30:37 2003 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D31E37B401; Sun, 16 Mar 2003 12:30:34 -0800 (PST) Received: from avocet.mail.pas.earthlink.net (avocet.mail.pas.earthlink.net [207.217.120.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7642643F85; Sun, 16 Mar 2003 12:30:33 -0800 (PST) (envelope-from parv_fm@mailsent.net) Received: from sdn-ap-018dcwashp0239.dialsprint.net ([63.188.176.239] helo=moo.holy.cow) by avocet.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 18uelx-0005eZ-00; Sun, 16 Mar 2003 12:30:22 -0800 Received: by moo.holy.cow (Postfix, from userid 1001) id 0ADB0A298; Sun, 16 Mar 2003 15:32:23 -0500 (EST) Date: Sun, 16 Mar 2003 15:32:23 -0500 From: parv To: Thomas David Rivers Cc: pirat@access.inet.co.th, stable@FreeBSD.ORG, doc@FreeBSD.ORG Subject: Re: uuencode takes very long time Message-ID: <20030316203223.GA34213@moo.holy.cow> Mail-Followup-To: Thomas David Rivers , pirat@access.inet.co.th, stable@FreeBSD.ORG, doc@FreeBSD.ORG References: <20030316113452.GA309@thai-aec.org> <200303161153.h2GBrk620041@lakes.dignus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200303161153.h2GBrk620041@lakes.dignus.com> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG in message <200303161153.h2GBrk620041@lakes.dignus.com>, wrote Thomas David Rivers thusly... > > pirat wrote: > > unfortunately, i had been stuck at a step of uuencoding. it > > took a tremendious long time. i was waiting for 18 hours for > > nothing. > > > > uuencode my-pr.tar.gz > my-pr.uue ... > you see, when you had "uuencode my-pr.tar.gz", you were not > trying to uuencode the file "my-pr.tar.gz" - that parameter > provides the name to use when uudecoding (on the "other side", as > it were.) > > Thus, the uuencode encode command was waiting for 18 hours trying > to read something from stdin... > > There are several ways to handle this: > > cat my-pr.tar.gz | uuencode my-pr.tar.gz ... > uuencode my-pr.tar.gz my-pr.tar.gz Are you mad, man? It is certainly possible that in the 2d case, encoded file & the original would be corrupted/incomplete due to race conditions. In case of a (very) large file, the same thing would happen in the 1st case too. It is much safer to use a temporary/other name for a file to store the (encoded) output. Mind you w/o -o option uuencode sends output to stdout (from uuencode(1)), which is what OP was doing. I tried the -o option on a small (3 kB) file... uuencode -o p.uue p ...the process hanged like above. I also tried redirecting the output of uuencode, process hanged. Just like OP. Another thing, after first run of... uuencode p ...encoded output was presented on stdout/err. Subsequent runs showed only "begin 600 p" & hanged; had to press C-c. Below is the bottom part of parsed ktrace output by kdump... 34748 uuencode NAMI "/etc/malloc.conf" 34748 uuencode RET readlink -1 errno 2 No such file or directory 34748 uuencode CALL mmap(0,4096,3,4098,-1,0,0,0) 34748 uuencode RET mmap 672141312/0x28101000 34748 uuencode CALL break(134529024) 34748 uuencode RET break 0 34748 uuencode CALL break(134533120) 34748 uuencode RET break 0 34748 uuencode CALL ioctl(1,TIOCGETA,-1077939208) 34748 uuencode RET ioctl 0 34748 uuencode CALL write(1,134529024,12) 34748 uuencode GIO fd 1 wrote 12 bytes "begin 600 p " 34748 uuencode RET write 12/0xc 34748 uuencode CALL fstat(0,-1077938668) 34748 uuencode RET fstat 0 34748 uuencode CALL break(134537216) 34748 uuencode RET break 0 34748 uuencode CALL ioctl(0,TIOCGETA,-1077938616) 34748 uuencode RET ioctl 0 34748 uuencode CALL read(0,134533120,4096) 34748 uuencode PSIG SIGINT SIG_DFL My Freebsd version is 4.7-Release-p6; interactive shell was bash2 I suppose OP should file a pr. - parv -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message