BTRFS - btrfsck: Segmentation fault (core dumped)

Bug #1438032 reported by bugproxy
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
btrfs-tools (Ubuntu)
Fix Released
High
Dimitri John Ledkov
Trusty
Fix Released
High
Dimitri John Ledkov

Bug Description

[Impact]

 * fsck fails and uses incorrect sector size

[Test Case]

 * see below

[Regression Potential]

 * low, upstream patch used and tested in all later releases

== Comment: #0 - ABDUL HALEEM <email address hidden> - 2015-02-13 01:50:18 ==
*** Problem description ***
btrfs/060 test of xfstests segfaults with unhandled signal 11 at 00003fff88820000 nip 0000000010065ac0 lr 0000000010065b18 code 30001 messages in dmesg.

*** uname output ***
Linux ubuntu 3.18.0-13-generic #14-Ubuntu SMP Fri Feb 6 09:57:41 UTC 2015 ppc64le ppc64le ppc64le GNU/Linux

*** Steps to reproduce ***
1. Power8 Machine installed Ubuntu 15.04 on a PowerVM LPAR.
2. Download git://oss.sgi.com/xfs/cmds/xfstests.git , compile and build
3. create 6 loop devices with btrfs file system on it.
4. local.config file will look like this:
export TEST_DEV=/dev/loop0
export TEST_DIR=/mnt/test
export SCRATCH_DEV_POOL="/dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5"
export SCRATCH_MNT=/mnt/scratch

5. run the test : ./check btrfs/060
6. test failed with errors in dmesg and the command btrfsck core dumped.

root@ubuntu:~/xfstests# cat /root/xfstests/results/btrfs/060.out.bad
QA output created by 060
Silence is golden
./common/rc: line 1932: 3378 Segmentation fault btrfsck $device > $tmp.fsck 2>&1
_check_btrfs_filesystem: filesystem on /dev/loop1 is inconsistent (see /root/xfstests/results//btrfs/060.full)

Core file, tests logs and syslogs are attached.

dmesg logs:
[ 717.146506] BTRFS info (device loop5): disk space caching is enabled
[ 717.150413] BTRFS: creating UUID tree
[ 717.939847] BTRFS info (device loop5): relocating block group 1676083200 flags 9
[ 720.914279] BTRFS info (device loop5): relocating block group 37683200 flags 12
[ 723.476025] BTRFS info (device loop5): found 7 extents
[ 725.093216] BTRFS info (device loop5): relocating block group 20971520 flags 10
[ 726.615751] BTRFS info (device loop5): found 1 extents
[ 727.151299] BTRFS info (device loop5): relocating block group 12582912 flags 1
[ 727.808751] BTRFS info (device loop5): relocating block group 4194304 flags 4
[ 728.294908] BTRFS info (device loop5): relocating block group 0 flags 2
[ 728.780977] BTRFS info (device loop5): found 1 extents
[ 730.204584] btrfsck[3378]: unhandled signal 11 at 00003fff88820000 nip 0000000010065ac0 lr 0000000010065b18 code 30001
[ 1483.937916] btrfsck[3640]: unhandled signal 11 at 00003fffaa030000 nip 0000000010065ac0 lr 0000000010065b18 code 30001
[ 1525.291669] btrfsck[3644]: unhandled signal 11 at 00003fffaf300000 nip 0000000010065ac0 lr 0000000010065b18 code 30001

Thanks

== Comment: #5 - Chandan B. Rajendra <email address hidden> - 2015-02-18 10:11:23 ==
The following upstream commit will fix the issue:

2c0e02a568c7db99922e9080407f8fc22d1991bd
Author: David Sterba <email address hidden>
Date: Wed May 28 11:25:24 2014 +0200

    btrfs-progs: make free space checker work on non-4k sectorsize filesystems

    The value of sector for space cache was hardcoded to 4k, and used to
    calculate bitmap sizes. In kernel, the BITS_PER_BITMAP is derived from
    PAGE_CACHE_SIZE which is not available for userspace, that can also deal
    with filesystem of varying sectorsize.

    Signed-off-by: David Sterba <email address hidden>

Without this patch, In io_ctl_check_crc(), we end up passing an incorrect "length" value to the crc32c_le() function.

The patch (2c0e02a568c7db99922e9080407f8fc22d1991bd) needs to picked to help resolve this issue on Ubuntu.

Revision history for this message
bugproxy (bugproxy) wrote : testlogs

Default Comment by Bridge

tags: added: architecture-ppc64le bugnameltc-121747 severity-medium targetmilestone-inin---
Revision history for this message
bugproxy (bugproxy) wrote : syslogs

Default Comment by Bridge

Revision history for this message
bugproxy (bugproxy) wrote : core file

Default Comment by Bridge

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1438032/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
affects: ubuntu → btrfs (Ubuntu)
Revision history for this message
Luciano Chavez (lnx1138) wrote :

Given there has been a patch attached for a while that fixes this problem, assigning to the taco-screen-team for their review of it for inclusion.

Changed in btrfs (Ubuntu):
assignee: nobody → Taco Screen team (taco-screen-team)
status: New → Confirmed
Steve Langasek (vorlon)
Changed in btrfs (Ubuntu):
assignee: Taco Screen team (taco-screen-team) → Dimitri John Ledkov (xnox)
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Correcting package name.

This commit is present in vivid and up, thus I understand the request is to SRU this fix into Ubuntu 14.04 LTS (trusty).

affects: btrfs (Ubuntu) → btrfs-tools (Ubuntu)
Changed in btrfs-tools (Ubuntu Trusty):
assignee: nobody → Dimitri John Ledkov (xnox)
status: New → Confirmed
importance: Undecided → High
Changed in btrfs-tools (Ubuntu):
status: Confirmed → Fix Released
importance: Undecided → High
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Currently under review by Ubuntu Release Team, after which a call for testing, validation and feedback will be made here as a comment.

https://launchpad.net/ubuntu/trusty/+queue?queue_state=1&queue_text=btrfs-tools

description: updated
Changed in btrfs-tools (Ubuntu Trusty):
status: Confirmed → In Progress
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello bugproxy, or anyone else affected,

Accepted btrfs-tools into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/btrfs-tools/3.12-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in btrfs-tools (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package btrfs-tools - 3.12-1ubuntu0.1

---------------
btrfs-tools (3.12-1ubuntu0.1) trusty; urgency=high

  * Cherry-pick upstream fix for btrfsck tool to work on non-4k sectorsize
    filesystems, e.g. on ppc64el. (LP: #1438032)

 -- Dimitri John Ledkov <email address hidden> Fri, 11 Dec 2015 13:28:33 +0000

Changed in btrfs-tools (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for btrfs-tools has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

bugproxy (bugproxy)
tags: added: targetmilestone-inin1604
removed: targetmilestone-inin---
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

@bugproxy we believe this bug report is fully complete and done. Is there anything else expected to be done in 16.04 for this bug report?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.