Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Mar 2003 15:32:23 -0500
From:      parv <parv_fm@emailgroups.net>
To:        Thomas David Rivers <rivers@dignus.com>
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>
In-Reply-To: <200303161153.h2GBrk620041@lakes.dignus.com>
References:  <20030316113452.GA309@thai-aec.org> <200303161153.h2GBrk620041@lakes.dignus.com>

next in thread | previous in thread | raw e-mail | index | archive | help
in message <200303161153.h2GBrk620041@lakes.dignus.com>, wrote
Thomas David Rivers thusly...
>
> pirat <pirat@access.inet.co.th> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030316203223.GA34213>