Bug 958575 - mkfs.btrfs segfaults
mkfs.btrfs segfaults
Status: CLOSED DUPLICATE of bug 871778
Product: Fedora
Classification: Fedora
Component: btrfs-progs (Show other bugs)
18
Unspecified Linux
unspecified Severity medium
: ---
: ---
Assigned To: Josef Bacik
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-01 16:58 EDT by Branislav Blaškovič
Modified: 2013-05-02 06:22 EDT (History)
4 users (show)

See Also:
Fixed In Version: btrfs-progs-0.20.rc1.20121017git91d9eec-2.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-05-01 20:58:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Branislav Blaškovič 2013-05-01 16:58:04 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?
Comment 1 Zach Brown 2013-05-01 17:56:06 EDT
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++;
Comment 2 Eric Sandeen 2013-05-01 18:52:28 EDT
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 18:53:02 EDT
(the bug is filed against f19, so I assume you *are* on f19?)
Comment 4 Eric Sandeen 2013-05-01 20:58:42 EDT
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 06:22:10 EDT
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.