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

xfsrestore dumps core on cumulative restore with -B (dirattr.c:945)



Hi,

I discovered a bug in xfsrestore 1.1.14 - it dumps core when the last
level of a cumlative dump is restored using the option "-B" to set mode
on . of the dumped filesystem.

(gdb) bt
#0  0x40040d21 in __kill () from /lib/libc.so.6
#1  0x40040996 in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x400420b8 in abort () at ../sysdeps/generic/abort.c:88
#3  0x4003abae in __assert_fail () at assert.c:59
#4  0x8076ec0 in dirattr_get (dah=4294967295) at dirattr.c:945
#5  0x8076dff in dirattr_get_xflags (dah=4294967295) at dirattr.c:901
#6  0x807c52a in setdirattr (dah=4294967295, path=0x8094dc4 ".") at
tree.c:2464
#7  0x807c416 in tree_setattr (path=0x80acc48 "") at tree.c:2402
#8  0x806a154 in finalize (path1=0x80acc48 "", path2=0x80aec50 "")
    at content.c:3503
#9  0x80690cd in content_stream_restore (thrdix=0) at content.c:2490
#10 0x805c2ce in main (argc=7, argv=0xbffffaf4) at main.c:623

And here's a snippet from xfsrestore -v 4:

/home/be/bin/xfsprogs/sbin/xfsrestore: restoring non-directory files
/home/be/bin/xfsprogs/sbin/xfsrestore: media file 0 in object 0 of
stream 0
/home/be/bin/xfsprogs/sbin/xfsrestore: file 0 in stream, file 0 in dump
0 on object
/home/be/bin/xfsprogs/sbin/xfsrestore: Media_end: pos==3
/home/be/bin/xfsprogs/sbin/xfsrestore: drive_simple end_read( )
/home/be/bin/xfsprogs/sbin/xfsrestore: getting next media file for
non-dir restore
/home/be/bin/xfsprogs/sbin/xfsrestore: Media_mfile_next: purp==2 pos==0
/home/be/bin/xfsprogs/sbin/xfsrestore: tree finalize
xfsrestore: dirattr.c:945: dirattr_get: Assertion `dah != ( ( size32_t )
( ( ( 1ull << ( ( unsigned long long )sizeof( size32_t ) * ( unsigned
long long )8 - ( 0ull + 1ull ))) - 1ull ) * 2ull + 1ull ))' failed.

Please find the details in the attached README. The relevant files
(xfsrestore, it's output, the core file and the README) are ready for
download on
http://berdmann.dyndns.org/xfsdump/xfsrestore-dumps-core-on-B/
Sat Feb 02, 2002:

- xfsrestore 1.1.14 dumps core when applying level 3 of a cumulative dump

We have the following backups of the filesystem mounted to
/export/ftp.redhat.com:

$ amadmin be find ente /export/ftp.redhat.com
Scanning /dumps/amanda...

date       host disk                   lv tape or file file status
2002-01-17 ente /export/ftp.redhat.com  1 BE22            7 OK
2002-01-17 ente /export/ftp.redhat.com  1 BE21           26 [out of tape]
2002-01-18 ente /export/ftp.redhat.com  1 BE23           33 OK
2002-01-19 ente /export/ftp.redhat.com  1 BE25           28 OK
2002-01-20 ente /export/ftp.redhat.com  1 BE27           26 OK
2002-01-21 ente /export/ftp.redhat.com  0 BE29           33 [out of tape]
2002-01-21 ente /export/ftp.redhat.com  0 BE00            1 OK
2002-01-22 ente /export/ftp.redhat.com  1 BE01            7 OK
2002-01-23 ente /export/ftp.redhat.com  1 BE02            7 [out of tape]
2002-01-23 ente /export/ftp.redhat.com  1 BE03            1 OK
2002-01-24 ente /export/ftp.redhat.com  1 BE04           29 OK
2002-01-25 ente /export/ftp.redhat.com  2 BE05           24 OK
2002-01-26 ente /export/ftp.redhat.com  2 BE07           27 OK
2002-01-27 ente /export/ftp.redhat.com  3 BE10            8 OK
2002-02-01 ente /export/ftp.redhat.com  0 BE17           26 [out of tape]
2002-02-01 ente /export/ftp.redhat.com  0 BE18            1 OK
2002-02-02 ente /export/ftp.redhat.com  1 BE19            1 OK


The dumps of 01-21 (0), 01-24 (1), 01-26 (2) were restored to . with:

/usr/sbin/amrestore -p $TAPE ente /export/ftp.redhat.com | /sbin/xfsrestore -r - .

The dump of 01-27 (3) was restored to . with the following line:

/usr/sbin/amrestore -p $TAPE ente /export/ftp.redhat.com | /sbin/xfsrestore -r -B - .

xfsrestore dumped core during this operation. A debug build
(LDFLAGS="-g") of xfsdump was done and xfsrestore was installed to
~be/bin/xfsprogs/sbin/xfsrestore.

The dumps were performed using xfsdump 1.1.7.

The cumulative restore of the levels 0-2 was done once more and saved
to another filesystem (tar cf - . | (cd somewhere && tar xpf -)).

The debug build of xfsrestore was invoked with -B to restore the mode
of . to apply the level 3 dump:

/usr/sbin/amrestore -p $TAPE ente /export/ftp.redhat.com | ~be/bin/xfsprogs/sbin/xfsrestore -r -B -v 4 - . > /net/scratch/xfsrestore.debug 2>&1

See the core file (core.gz), the xfsrestore binary (xfsrestore.gz) and
xfsrestore.debug attached.

This issue does not happen when "-B" is not used during restore of
level 3.

Backtrace with gdb:

$ gdb xfsrestore core
GNU gdb 19991004
Copyright 1998 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-redhat-linux"...
Core was generated by `/home/be/bin/xfsprogs/sbin/xfsrestore -r -B -v 4 - .'.
Program terminated with signal 6, Aborted.
Reading symbols from /lib/libhandle.so.0...done.
Reading symbols from /lib/libattr.so.0...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
#0  0x40040d21 in __kill () from /lib/libc.so.6
(gdb) bt
#0  0x40040d21 in __kill () from /lib/libc.so.6
#1  0x40040996 in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x400420b8 in abort () at ../sysdeps/generic/abort.c:88
#3  0x4003abae in __assert_fail () at assert.c:59
#4  0x8076ec0 in dirattr_get (dah=4294967295) at dirattr.c:945
#5  0x8076dff in dirattr_get_xflags (dah=4294967295) at dirattr.c:901
#6  0x807c52a in setdirattr (dah=4294967295, path=0x8094dc4 ".") at tree.c:2464
#7  0x807c416 in tree_setattr (path=0x80acc48 "") at tree.c:2402
#8  0x806a154 in finalize (path1=0x80acc48 "", path2=0x80aec50 "")
    at content.c:3503
#9  0x80690cd in content_stream_restore (thrdix=0) at content.c:2490
#10 0x805c2ce in main (argc=7, argv=0xbffffaf4) at main.c:623