OpenSolaris

Printable Version Enter a New Search
Bug ID 6494569
Synopsis zfs recv -d pool/<doesn't exist> core dumps for top-level filesystem backups
State 10-Fix Delivered (Fix available in build)
Category:Subcategory utility:zfs
Keywords
Responsible Engineer Matthew Ahrens
Reported Against snv_52
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_69
Fixed In snv_69
Release Fixed solaris_nevada(snv_69) , solaris_10u6(s10u6_01) (Bug ID:2156269)
Related Bugs 6494573 , 6572808 , 6576089
Submit Date 16-November-2006
Last Update Date 29-April-2008
Description
Using stock snv_52 bits, I created a pool, and took a snapshot of it.
I then zfs sended (sent, sorry) this to a datafile. I removed the original
data in the pool and did a zfs destroy -r pool to clear the snapshots.

# zfs list extra
NAME    USED  AVAIL  REFER  MOUNTPOINT
extra    96K  9.60G  24.5K  /extra
# mkfile 10m /extra/file1
# zfs snapshot extra@original
# zfs send extra@original > /tmp/extra-original.dat
# zfs destroy -r extra

On doing zfs recv -d pool/new (where pool/new doesn't exist), we get a coredump:

# zfs receive -d extra/restore < /tmp/extra-original.dat
Segmentation Fault - core dumped
# mdb core
Loading modules: [ libumem.so.1 libuutil.so.1 libnvpair.so.1 libc.so.1 libavl.so.1 ld.so.1 ]
> $c
libzfs.so.1`create_parents+0x30(80b5548, 8045d84, d)
libzfs.so.1`zfs_receive+0x693(80b5548, 8046dcf, 1, 0, 0, 0)
zfs_do_receive+0x17e(3, 8046c1c)
main+0xa0(4, 8046c18, 8046c2c)
_start+0x7a(4, 8046dc0, 8046dc4, 8046dcc, 8046dcf, 0)
> $q

I've attached the core. The command issued was user error, we should be getting
an error message to say that the destination filesystem specified by -d
doesn't exist in this case.

Now, interestingly enough, if the original archive file was taken of a
*child filesystem* of the top level filesystem, this works as expected, 
and we get an error message, not a coredump:

# zfs list -r extra
NAME    USED  AVAIL  REFER  MOUNTPOINT
extra    92K  9.60G  24.5K  /extra
# zfs create extra/child
#  mkfile 10m /extra/child/file1
# zfs snapshot extra/child@snap1
# zfs send extra/child@snap1 > /tmp/backup.dat
# zfs destroy -r extra
# zfs recv -d extra/not-there < /tmp/backup.dat
cannot open 'extra/not-there': dataset does not exist
cannot receive: unable to restore to destination

# zfs recv  -d extra/nanoo/nanoo  <  /tmp/backup.dat
# zfs recv  -d extra/nanoo/nanoo  < /tmp/extra-original.dat
Segmentation Fault - core dumped

This bug seems particular to top-level filesystems, and something in the
archived backup differs when we have a top-level backup, vs. a child
filesystem backup.  I've attached these backup archives as well, if that
helps.
Work Around
N/A
Comments
N/A