Bug 97021 - abort() reached in "btrfs check"
Summary: abort() reached in "btrfs check"
Status: RESOLVED CODE_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: btrfs (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Josef Bacik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-21 21:36 UTC by Lukas Lueg
Modified: 2016-09-03 18:58 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.19.3-200.fc21.x86_64
Tree: Mainline
Regression: No


Attachments
BTRFS-Image causing userland tools to crash (24.18 KB, application/gzip)
2015-04-21 21:36 UTC, Lukas Lueg
Details

Description Lukas Lueg 2015-04-21 21:36:31 UTC
Created attachment 174721 [details]
BTRFS-Image causing userland tools to crash

The btrfs-image attached to this bug causes the userland tools v3.19.1 to crash by reaching a call to abort().

(gdb) run check btrfs_fukked_abort_cmds-check:5919.bin
Starting program: /usr/sbin/btrfs check btrfs_fukked_abort_cmds-check:5919.bin
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Checking filesystem on btrfs_fukked_abort_cmds-check:5919.bin
UUID: cdd8684f-9eb1-40a4-91ec-1ed7c3cb444c
checking extents

Program received signal SIGABRT, Aborted.
0x00000032626348d7 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:55
55	  return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
#0  0x00000032626348d7 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/unix/sysv/linux/raise.c:55
#1  0x000000326263653a in __GI_abort () at abort.c:89
#2  0x0000000000425038 in run_next_block (root=root@entry=0x894b20, 
    bits=bits@entry=0x896960, last=last@entry=0x7fffffffd470, 
    pending=pending@entry=0x7fffffffd5f0, seen=seen@entry=0x7fffffffd5e0, 
    reada=reada@entry=0x7fffffffd600, nodes=0x7fffffffd610, 
    extent_cache=0x7fffffffd5d0, chunk_cache=0x7fffffffd5c0, dev_cache=0x7fffffffd5b0, 
    block_group_cache=0x7fffffffd6a0, dev_extent_cache=0x7fffffffd6c0, ri=0x894e20, 
    bits_nr=1024) at cmds-check.c:5908
#3  0x000000000042523d in deal_root_from_list (list=list@entry=0x7fffffffd640, 
    root=root@entry=0x894b20, bits=bits@entry=0x896960, 
    pending=pending@entry=0x7fffffffd5f0, seen=seen@entry=0x7fffffffd5e0, 
    reada=reada@entry=0x7fffffffd600, nodes=0x7fffffffd610, 
    extent_cache=0x7fffffffd5d0, chunk_cache=0x7fffffffd5c0, dev_cache=0x7fffffffd5b0, 
    block_group_cache=0x7fffffffd6a0, dev_extent_cache=0x7fffffffd6c0, bits_nr=1024)
    at cmds-check.c:7838
#4  0x0000000000425f3d in check_chunks_and_extents (root=root@entry=0x894b20)
    at cmds-check.c:8000
#5  0x0000000000428144 in cmd_check (argc=<optimized out>, argv=<optimized out>)
    at cmds-check.c:9431
#6  0x000000000040e5a2 in main (argc=2, argv=0x7fffffffde90) at btrfs.c:245
Comment 1 David Sterba 2016-09-03 18:58:34 UTC
Does not crash anymore with 4.7.1,

$ btrfs check image
ERROR: invalid chunk sectorsize 4096
ERROR: Superblock checksums match, but it has an invalid chunk, try btrfsck --repair -s <superblock> ie, 0,1,2
Couldn't open file system

The error message is not quite clear why it fails, it's because superblock::sectorsize is 8392704, and the chunk sectorsize must match.

Image added to testsuite. Closing, thanks.

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