[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Trouble outdating revisions
From: |
Romain Francoise |
Subject: |
Trouble outdating revisions |
Date: |
Mon, 16 May 2005 19:30:30 +0200 |
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,
--
,''`.
: :' : Romain Francoise <address@hidden>
`. `' http://people.debian.org/~rfrancoise/
`-
- Trouble outdating revisions,
Romain Francoise <=