Subject: bug in rcs 5.7
From: John Wiersba <[email-masked]>
To: "[email-masked]'" <[email-masked]>
Cc: "'cygwin'" <[email-masked]>, "[email-masked]'" <[email-masked]>, "'Andrew Markebo'" <[email-masked]>, "'Gary'" <[email-masked]>, John Wiersba <[email-masked]>
Date: Wed, 4 Jul 2001 00:32:02 -0400

Hi!  I believe I've found in bug in rcs 5.7 running under the latest cygwin.
The fix is to src/ci.c on line 725.
   old:        if (lseek(wfd, wfd_off, SEEK_CUR) == -1)
   new:        if (lseek(wfd, wfd_off, SEEK_SET) == -1)

Thanks to Gary L. Filipski, [email-masked] for a good description of
how to create a reproducible test case.

I built my rcs from clean sources modified as specified in the cygwin
documentation:
After ./configure:
  - in src/conf.sh line 1039 change has_mmap=1 to has_mmap=0
  - in src/Makefile change line 90 to look like x = .exe
Then, make; make install

The bug can be reproduced with the following script running under the latest
cygwin:

#!/bin/bash
rm -f asdf asdf,v
cat <<EOF >asdf
01 fffffffffffffffffffffffffffffffffffffff end
02 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
03 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
04 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
05 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
06 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
07 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
08 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
09 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
10 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
11 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
12 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
13 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
14 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
15 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
16 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
17 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
18 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
19 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
20 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
21 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
22 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
23 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
24 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
25 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
26 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
27 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
28 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
29 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
30 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
31 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
32 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
33 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
34 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
35 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
36 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
37 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
EOF
ci -t- asdf >/dev/null 2>&1
co -l  asdf >/dev/null 2>&1
tail +2 asdf >fdsa
cp -f fdsa asdf
rm -f fdsa
ci -mx -u asdf
ls -l
# END OF SCRIPT

which gives the following output:

asdf,v  <--  asdf
new revision: 1.2; previous revision: 1.1
done
total 8
-rwxr-xr-x    1 jrw      JRW          2883 Jul  4 00:28 RCS_BUG
-r--r--r--    1 jrw      JRW          2412 Jul  4 00:28 asdf
-r--r--r--    1 jrw      JRW          1349 Jul  4 00:28 asdf,v    <=
truncated size!

The bug is that asdf,v has a bad copy of the second revision, truncated
after 1024 bytes:

...
1.2
log
@x
@
text
@02 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
03 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
04 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
05 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
06 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
07 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
08 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
09 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
10 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
11 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
12 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
13 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
14 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
15 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
16 fasfasdffffffffffffffffffffffffffffffffffffffffffffffffffff end
17 fasfasdfffffffff@                                               <=
truncated here
...

-- John Wiersba

P.S. Thanks for your free (GNU) rcs!!!!

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/