Red Hat Bugzilla – Bug 958575
mkfs.btrfs segfaults
Last modified: 2013-05-02 06:22:10 EDT
Description of problem: mkfs.btrfs segfaults. See steps to reproduce. Version-Release number of selected component (if applicable): # rpm -q fedora-release btrfs-progs fedora-release-18-1.noarch btrfs-progs-0.20.rc1.20121017git91d9eec-1.fc18.x86_64 How reproducible: always Steps to Reproduce: # dd if=/dev/zero of=diskbtrfs.img bs=1M count=1000 1000+0 records in 1000+0 records out 1048576000 bytes (1.0 GB) copied, 10.2057 s, 103 MB/s # mkfs.btrfs diskbtrfs.img WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL WARNING! - see http://btrfs.wiki.kernel.org before using SMALL VOLUME: forcing mixed metadata/data groups Segmentation fault # echo $? 139 Actual results: segmentation fault Expected results: created filesystem Additional info: On Fedora 17 with package btrfs-progs-0.19-18.fc17.x86_64 it's working as expected. So maybe Regression?
The stack when reproducing this mkfs.btrfs segfault on the 1g file of zeros shows this to be the null device strrchr() that was fixed in bug 871778. > Program received signal SIGSEGV, Segmentation fault. > 0x0000003ceca87bca in __strrchr_sse2 () from /lib64/libc.so.6 > (gdb) bt > #0 0x0000003ceca87bca in __strrchr_sse2 () from /lib64/libc.so.6 > #1 0x000000000042074d in is_ssd () > #2 0x00000000004023fa in main () The fix is in the btrfs-progs f19 git branch: commit 96158b59ff7249e60dc53631a0dec5f133622860 Author: Josef Bacik <josef@toxicpanda.com> Date: Thu Nov 1 09:51:07 2012 -0400 - fix a bug when mkfs'ing a file (rhbz# 871778) [...] > @@ -82,7 +103,12 @@ diff -up btrfs-progs-0.20.rc1.20121017git91d9eec/mkfs.c.patch4 btrfs-progs-0.20. > + * reason on F17 at least so we'll do this trickery > + */ > + disk = blkid_probe_get_wholedisk_devno(probe); > ++ if (!disk) > ++ return 0; > ++ > + devname = blkid_devno_to_devname(disk); > ++ if (!devname) > ++ return 0; > + > + dev = strrchr(devname, '/'); > + dev++;
A newer version should already be available for F19. Can you do a yum update to btrfs-progs-0.20.rc1.20130308git704a08c-1.fc19 and see if things are better?
(the bug is filed against f19, so I assume you *are* on f19?)
oh, rpm -q fedora-release says f18? Hum this was originally filed back in October but never pushed. Sigh. Duping to that one, rebuilding, and pushing out. -Eric *** This bug has been marked as a duplicate of bug 871778 ***
Sorry, of course I am on F18. Thank you for the fix.