[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnu-arch-users] [BUG] serious bug in vu_write_retry?
From: |
Jeremy Shaw |
Subject: |
[Gnu-arch-users] [BUG] serious bug in vu_write_retry? |
Date: |
Thu, 08 Jul 2004 13:15:24 -0700 |
User-agent: |
Wanderlust/2.11.30 (Wonderwall) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI) |
Hello,
Some people at work were attempting to call tla from perl using popen3
and complained of corrupt output when calling 'tla cat-archive-log' on
large log files (> 200 lines).
When calling cat-archive-log, it would start printing out the log,
then all of a sudden it would output a null followed by what appears
to be some random data in memory. After printing a bunch of random
data, it would then print the archive-log correctly, starting from the
beginning.
They said that the following patch fixed the problem for them (and
passes all existing unit tests):
--- orig/vu/vu.c
+++ mod/vu/vu.c
@@ -1241,8 +1241,11 @@
return amt;
if (amt == count)
return orig_count;
- count -= amt;
- buf += amt;
+ if(amt > 0 )
+ {
+ count -= amt;
+ buf += amt;
+ }
}
}
Can anyone else comment on the validity of this bug/patch? In the
unpatched code, it looks like when vu_write returns -1 and (*errn ==
EAGAIN || *errn == EINTR), count will be incremented by 1 and bug will
be decremented by 1.
Jeremy Shaw.