Date: Sat, 11 Jan 1997 19:30:06 -0800 (PST) From: David Conran <lucifer@maths.uq.oz.au> To: freebsd-bugs Subject: Re: bin/2446: Problem in interactive restore. Message-ID: <199701120330.TAA28001@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/2446; it has been noted by GNATS.
From: David Conran <lucifer@maths.uq.oz.au>
To: joerg_wunsch@uriah.heep.sax.de
Cc: lucifer@xyzzy.net.au, FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/2446: Problem in interactive restore.
Date: Sun, 12 Jan 1997 13:24:06 +1000 (EST)
J Wunsch writes ...
>
> As David Conran wrote:
>
> > orac:/tmp$ restore ivf /dev/nrst1
> > Verify tape and initialize maps
> > Tape block size is 32
> > Dump date: Mon Jan 6 00:39:10 1997
> > Dumped from: the epoch
> > Level 0 dump of /usr on orac.xyzzy.net.au:/dev/sd0e
> > Label: none
> > Extract directories from tape
> > Initialize symbol table.
> > restore > cd include
> > canonname: not enough bufferspace
>
> Can you perhaps track this with gdb? Interactive restore works fine
> for me (and worked all the time), so i probably have a hard time to
> reproduce this.
>
> (Hint: send followups to your PR to freebsd-gnats-submit@freebsd.org,
> using the same subject.)
Well .. I just re-suped and recompiled restore .. and did it off a very
recent (ie. 3.0-current) dump
I am no gdb expert .. so .. here is my stuff.
(if there is something else to do .. let me know.)
Thanks.
orac:/tmp$ gdb /home/src/sbin/restore/restore
GDB is free software and you are welcome to 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.
GDB 4.13 (i386-unknown-freebsd),
Copyright 1994 Free Software Foundation, Inc...
(gdb) set args ivf /dev/nrst1
(gdb) break canon
Breakpoint 1 at 0x2821: file interactive.c, line 447.
(gdb) run
Starting program: /home/src/sbin/restore/restore ivf /dev/nrst1
Verify tape and initialize maps
Tape block size is 32
Dump date: Sun Jan 12 01:14:28 1997
Dumped from: the epoch
Level 0 dump of /usr on orac.xyzzy.net.au:/dev/sd0e
Label: none
Extract directories from tape
Initialize symbol table.
Breakpoint 1, canon (rawname=0x1b00 "/", canonname=0xefbfcd5c "", len=1024)
at interactive.c:447
447 if (strcmp(rawname, ".") == 0 || strncmp(rawname, "./", 2) == 0)
(gdb) step
449 else if (rawname[0] == '/')
(gdb) step
450 (void) strcpy(canonname, ".");
(gdb) step
453 if (strlen(canonname) + strlen(rawname) >= len) {
(gdb) step
458 (void) strcat(canonname, rawname);
(gdb) step
462 for (cp = np = canonname; *np != '\0'; cp++) {
(gdb) step
463 *cp = *np++;
(gdb) step
464 while (*cp == '/' && *np == '/')
(gdb) step
462 for (cp = np = canonname; *np != '\0'; cp++) {
(gdb) step
463 *cp = *np++;
(gdb) step
464 while (*cp == '/' && *np == '/')
(gdb) step
462 for (cp = np = canonname; *np != '\0'; cp++) {
(gdb) step
467 *cp = '\0';
(gdb) step
468 if (*--cp == '/')
(gdb) step
469 *cp = '\0';
(gdb) step
473 for (np = canonname; *np != '\0'; ) {
(gdb) step
474 np++;
(gdb) step
475 cp = np;
(gdb) step
476 while (*np != '/' && *np != '\0')
(gdb) step
478 if (np - cp == 1 && *cp == '.') {
(gdb) step
483 if (np - cp == 2 && strncmp(cp, "..", 2) == 0) {
(gdb) step
491 }
(gdb) step
runcmdshell () at interactive.c:114
114 if (setjmp(reset) != 0) {
(gdb) step
123 runshell = 1;
(gdb) step
124 getcmd(curdir, cmd, name, &arglist);
(gdb) step
getcmd (curdir=0xefbfcd5c ".", cmd=0xefbfc55c "", name=0xefbfc95c "",
ap=0xefbfd15c) at interactive.c:315
315 if (ap->argcnt > 0)
(gdb) step
317 if (nextarg != NULL)
(gdb) step
323 fprintf(stderr, "restore > ");
(gdb) step
324 (void) fflush(stderr);
(gdb) step
restore > 325 (void) fgets(input, BUFSIZ, terminal);
(gdb) step
cd include
326 } while (!feof(terminal) && input[0] == '\n');
(gdb) c
Continuing.
Breakpoint 1, canon (rawname=0xefbfc13c "./include", canonname=0xefbfc95c "",
len=4) at interactive.c:447
447 if (strcmp(rawname, ".") == 0 || strncmp(rawname, "./", 2) == 0)
(gdb) step
448 (void) strcpy(canonname, "");
(gdb) step
453 if (strlen(canonname) + strlen(rawname) >= len) {
(gdb) step
454 fprintf(stderr, "canonname: not enough bufferspace\n");
(gdb) step
canonname: not enough bufferspace
455 done(1);
(gdb) step
done (exitcode=1) at dirs.c:765
765 closemt();
(gdb) quit
The program is running. Quit anyway (and kill it)? (y or n) y
orac:/tmp$
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701120330.TAA28001>
