Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cvs admin -u bug

0 views
Skip to first unread message

Marc Prewitt

unread,
Feb 18, 2003, 3:54:01 PM2/18/03
to bug...@gnu.org

>Submitter-Id: net
>Originator: Marc Prewitt
>Organization:
Wall Street Source
>Confidential: no
>Synopsis: core dump on 'cvs admin -u foo' on a file which isn't in the repository
>Severity: non-critical
>Priority: low
>Category: cvs
>Class: support
>Release: 1.11.5
>Environment:

System: SunOS bohemia 5.8 Generic_108528-18 sun4u sparc SUNW,Sun-Blade-1000
Architecture: sun4

>Description:
When running 'cvs admin -u' on a file which doesn't exist in the repository
generates a core dump. Also, a lock file is left in the repository. Here's a
trace of the core dump:

Core was generated by `/usr/local/bin/cvs admin -u module_500.pm.tmp'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libxnet.so.1...done.
Loaded symbols for /usr/lib/libxnet.so.1
Reading symbols from /usr/lib/libnsl.so.1...done.
Loaded symbols for /usr/lib/libnsl.so.1
Reading symbols from /usr/lib/libc.so.1...done.
Loaded symbols for /usr/lib/libc.so.1
Reading symbols from /usr/lib/libdl.so.1...done.
Loaded symbols for /usr/lib/libdl.so.1
Reading symbols from /usr/lib/libmp.so.2...done.
Loaded symbols for /usr/lib/libmp.so.2
Reading symbols from /usr/platform/SUNW,Sun-Blade-1000/lib/libc_psr.so.1...done.
Loaded symbols for /usr/platform/SUNW,Sun-Blade-1000/lib/libc_psr.so.1
Reading symbols from /usr/lib/libsocket.so.1...done.
Loaded symbols for /usr/lib/libsocket.so.1
#0 admin_fileproc (callerdat=0xffbefa58, finfo=0xffbef820) at admin.c:571
571 if (rcs->flags & PARTIAL)
(gdb) bt
#0 admin_fileproc (callerdat=0xffbefa58, finfo=0xffbef820) at admin.c:571
#1 0x00050940 in do_file_proc (p=0xb40f8, closure=0xffbef818) at recurse.c:832
#2 0x00031c48 in walklist (list=0xb40f8, proc=0x5087c <do_file_proc>, closure=0xffbef818)
at hash.c:370
#3 0x00050528 in do_recursion (frame=0xffbef998) at recurse.c:736
#4 0x00051134 in unroll_files_proc (p=0xb4080, closure=0xffbef998) at recurse.c:1209
#5 0x00031c48 in walklist (list=0x0, proc=0x51040 <unroll_files_proc>, closure=0xffbef998)
at hash.c:370
#6 0x0004fed8 in start_recursion (fileproc=0xb3ed8, filesdoneproc=0, direntproc=0xb1fc0,
dirleaveproc=0, callerdat=0xb2000, argc=1, argv=0xb3ec8, local=0, which=1, aflag=0,
locktype=0, update_preload=0x0, dosrcs=1) at recurse.c:347
#7 0x00019580 in admin (argc=1, argv=0xffbefb88) at admin.c:520
#8 0x0003e648 in main (argc=3, argv=0xffbefb80) at main.c:991
(gdb)

>How-To-Repeat:
$ touch foon
$ cvs admin -u foon
>Fix:


Mark D. Baushke

unread,
Feb 18, 2003, 4:58:13 PM2/18/03
to mpre...@wssource.com, bug...@gnu.org
Marc Prewitt <mpre...@wssource.com> writes:

> >Description:
> When running 'cvs admin -u' on a file which doesn't exist in the repository
> generates a core dump. Also, a lock file is left in the repository. Here's a
> trace of the core dump:
>

...elided...


> #0 admin_fileproc (callerdat=0xffbefa58, finfo=0xffbef820) at admin.c:571
> 571 if (rcs->flags & PARTIAL)

...elided...

The patch for this problem would seem to be as follows.
If someone with commit access would do the honors?

Enjoy!
-- Mark

ChangeLog entry:
2003-02-18 Mark D. Baushke <m...@cvshome.org>

* admin.c (admin_fileproc): Check that the file is cvs-controlled
to avoid core dumps.
* sanity.sh (reserved-16): Test it.

Index: src/admin.c
===================================================================
RCS file: /cvs/ccvs/src/admin.c,v
retrieving revision 1.81
diff -u -p -r1.81 admin.c
--- admin.c 7 Feb 2003 19:53:30 -0000 1.81
+++ admin.c 18 Feb 2003 21:55:18 -0000
@@ -568,6 +568,12 @@ admin_fileproc (callerdat, finfo)
}

rcs = vers->srcfile;
+ if (rcs == NULL)
+ {
+ error (0, 0, "cannot admin non-cvs file `%s'", finfo->file);
+ goto exitfunc;
+ }
+


if (rcs->flags & PARTIAL)

RCS_reparsercsfile (rcs, (FILE **) NULL, (struct rcsbuffer *) NULL);

Index: src/sanity.sh
===================================================================
RCS file: /cvs/ccvs/src/sanity.sh,v
retrieving revision 1.758
diff -u -p -r1.758 sanity.sh
--- sanity.sh 15 Feb 2003 05:29:38 -0000 1.758
+++ sanity.sh 18 Feb 2003 21:55:01 -0000
@@ -20871,6 +20871,9 @@ ${CVSROOT_DIRNAME}/first-dir/a-lock,v <
new revision: 1\.2; previous revision: 1\.1
done"

+ dotest reserved-16 "${testcvs} admin -u foo" \
+"${PROG} [a-z]*: cannot admin non-cvs file .foo."
+
# Now test for a bug involving branches and locks
sed -e 's/locks; strict;/locks fred:1.2; strict;/' ${CVSROOT_DIRNAME}/first-dir/a-lock,v > a-lock,v
chmod 644 ${CVSROOT_DIRNAME}/first-dir/a-lock,v


0 new messages