Bug 958575 - mkfs.btrfs segfaults
Summary: mkfs.btrfs segfaults
Keywords:
Status: CLOSED DUPLICATE of bug 871778
Alias: None
Product: Fedora
Classification: Fedora
Component: btrfs-progs
Version: 18
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Josef Bacik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-01 20:58 UTC by Branislav Blaškovič
Modified: 2013-05-02 10:22 UTC (History)
4 users (show)

Fixed In Version: btrfs-progs-0.20.rc1.20121017git91d9eec-2.fc18
Clone Of:
Environment:
Last Closed: 2013-05-02 00:58:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Branislav Blaškovič 2013-05-01 20:58:04 UTC
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?

Comment 1 Zach Brown 2013-05-01 21:56:06 UTC
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>
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++;

Comment 2 Eric Sandeen 2013-05-01 22:52:28 UTC
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?

Comment 3 Eric Sandeen 2013-05-01 22:53:02 UTC
(the bug is filed against f19, so I assume you *are* on f19?)

Comment 4 Eric Sandeen 2013-05-02 00:58:42 UTC
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 ***

Comment 5 Branislav Blaškovič 2013-05-02 10:22:10 UTC
Sorry, of course I am on F18.

Thank you for the fix.


Note You need to log in before you can comment on or make changes to this bug.