bug-rcs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble outdating revisions


From: Aaron S. Hawley
Subject: Re: Trouble outdating revisions
Date: Wed, 18 May 2005 10:05:04 -0400 (EDT)

I verified the bug with the following script.  The segmentation fault also
creates a deadlock, with RCS's internal locking mechanism, on the RCS
file.

#!/bin/bash

file=foo
echo Hello, world >${file}
ci -t-'' '-m1.1 revision' ${file}
rcs -o1.1 ${file}
echo Hello, world >${file}
ci '-msecond 1.1 revision' ${file}
echo 42 >>${file}
rcs -l ${file}
ci '-m1.2 revision' ${file}
rcs -o1.2 ${file}
rm -f ${file} RCS/${file},v

On Mon, 16 May 2005, Romain Francoise wrote:

> Hi,
>
> a Debian user reported that when you try to outdate the 1.1 revision, it
> remains in the RCS file and doesn't actually get deleted.  If you then
> commit another 1.1 revision, you get both revisions in the RCS file.
> See <URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=69193> for
> more information.
>
>
> While investigating this, I found a more serious problem in rcs, in some
> conditions it segfaults when you try to outdate a revision.  See the
> following transcript:
>
> ,----
> | $ echo Hello, world >foo
> | $ ci foo
> | foo,v  <--  foo
> | enter description, terminated with single '.' or end of file:
> | NOTE: This is NOT the log message!
> | >> .
> | initial revision: 1.1
> | done
> | $ rcs -o1.1 foo
> | RCS file: foo,v
> | deleting revision 1.1
> | Do you really want to delete all revisions? [ny](n): y
> | done
> | $ echo Hello, world >foo
> | $ ci foo
> | foo,v  <--  foo
> | initial revision: 1.1
> | done
> | $ echo 42 >>foo
> | $ rcs -l foo
> | RCS file: foo,v
> | 1.1 locked
> | done
> | $ ci foo
> | foo,v  <--  foo
> | new revision: 1.2; previous revision: 1.1
> | enter log message, terminated with single '.' or end of file:
> | >> .
> | done
> | $ rcs -o1.2 foo
> | RCS file: foo,v
> | deleting revision 1.2
> | Segmentation fault (core dumped)
> `----
>
> The bug is pretty obvious:
>
> ,----
> | $ gdb /usr/bin/rcs core
> | GNU gdb 6.3-debian
> | Copyright 2004 Free Software Foundation, Inc.
> | GDB is free software, covered by the GNU General Public License, and you are
> | welcome to change it and/or distribute copies of it under certain 
> conditions.
> | Type "show copying" to see the conditions.
> | There is absolutely no warranty for GDB.  Type "show warranty" for details.
> | This GDB was configured as "i386-linux"...Using host libthread_db library 
> "/lib/tls/i686/cmov/libthread_db.so.1".
> |
> | Core was generated by `rcs -o1.2 foo'.
> | Program terminated with signal 11, Segmentation fault.
> |
> | Reading symbols from /lib/tls/i686/cmov/libc.so.6...done.
> | Loaded symbols for /lib/tls/i686/cmov/libc.so.6
> | Reading symbols from /lib/ld-linux.so.2...done.
> | Loaded symbols for /lib/ld-linux.so.2
> | #0  scanlogtext (delta=0x0, edit=0) at rcs.c:919
> | 919                         if (!delta->log.string)
> | (gdb)
> `----
>
> So I suggest the following (also obvious) patch:
>
> ,----
> | --- rcs-5.7/src/rcs.c       1995-06-16 08:19:24.000000000 +0200
> | +++ rcs-5.7/src/rcs.c       2005-05-16 18:52:42.000000000 +0200
> | @@ -897,6 +897,9 @@
> |     struct hshentry const *nextdelta;
> |     struct cbuf cb;
> |
> | +   if (!delta)
> | +           return;
> | +
> |     for (;;) {
> |             foutptr = 0;
> |             if (eoflex()) {
> `----
>
> Thanks,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]