Package: btrfs-progs
Version: 4.19.1-1
Severity: normal

--- Please enter the report below this line. ---
Hi,

btrfsck --help includes:
           -E|--subvol-extents <subvolid>
                                       print subvolume extents and sharing state

btrfsck -E and btrfsck -E <id> /dev/something always segfault, see
attached backtraces in 'btrfsck -E.txt' and 'btrfsck -E 263 dev-
sdc1.txt'.

Running btrfsck --subvol-extents <id> /dev/something prints some
messages and then segfaults, see attached backtrace 'btrfsck --subvol-
extents 263 dev-sdc1.txt'.

The used input /dev/sdc1 and subvolume id 263 are valid in my test
setup, and I unmounted the filesystem before running btrfsck.

I'm aware that btrfsck is under development. However, I'd still expect
it to print useful error message instead of just crashing.

Cheers - Bruno

--- System information. ---
Architecture: 
Kernel:       Linux 4.18.0-3-amd64

Debian Release: buster/sid
  500 unstable-debug  deb.debian.org 
  500 unstable        deb.debian.org 
    1 experimental-debug deb.debian.org 
    1 experimental    deb.debian.org 

--- Package information. ---
Depends          (Version) | Installed
==========================-+-=============
libblkid1      (>= 2.17.2) | 2.33-0.2
libc6             (>= 2.8) | 2.28-2
liblzo2-2                  | 2.10-0.1
libuuid1         (>= 2.16) | 2.33-0.2
zlib1g        (>= 1:1.2.0) | 1:1.2.11.dfsg-1


Package's Recommends field is empty.

Suggests        (Version) | Installed
=========================-+-===========
duperemove                | 





(0)fuddl@flutschi:~$ sudo gdb btrfsck core
GNU gdb (Debian 8.2-1) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from btrfsck...Reading symbols from 
/usr/lib/debug/.build-id/be/495c9f9b35a2174fb0fa5151a765bcc608da48.debug...done.
done.

warning: core file may not match specified executable file.
[New LWP 29034]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `btrfsck -E'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f008e6462c6 in __GI_____strtoul_l_internal (nptr=nptr@entry=0x0, 
endptr=endptr@entry=0x7ffe0cc1a5c0, base=base@entry=0, 
    group=group@entry=0, loc=0x7f008e7c6560 <_nl_global_locale>) at 
../stdlib/strtol_l.c:283
283     ../stdlib/strtol_l.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  0x00007f008e6462c6 in __GI_____strtoul_l_internal (nptr=nptr@entry=0x0, 
endptr=endptr@entry=0x7ffe0cc1a5c0, base=base@entry=0, 
    group=group@entry=0, loc=0x7f008e7c6560 <_nl_global_locale>) at 
../stdlib/strtol_l.c:283
#1  0x00007f008e645d22 in __strtoul (nptr=nptr@entry=0x0, 
endptr=endptr@entry=0x7ffe0cc1a5c0, base=base@entry=0)
    at ../stdlib/strtol.c:106
#2  0x000056479a8ec8a3 in arg_strtou64 (str=0x0) at utils-lib.c:25
#3  0x000056479a8d02c4 in cmd_check (argc=2, argv=0x7ffe0cc1aa08) at 
check/main.c:9596
#4  0x000056479a88ee03 in main (argc=2, argv=0x7ffe0cc1aa08) at btrfs.c:302
(gdb) bt full
#0  0x00007f008e6462c6 in __GI_____strtoul_l_internal (nptr=nptr@entry=0x0, 
endptr=endptr@entry=0x7ffe0cc1a5c0, base=base@entry=0, 
    group=group@entry=0, loc=0x7f008e7c6560 <_nl_global_locale>) at 
../stdlib/strtol_l.c:283
        negative = <optimized out>
        cutoff = <optimized out>
        cutlim = <optimized out>
        i = <optimized out>
        s = 0x0
        c = <optimized out>
        save = <optimized out>
        end = <optimized out>
        overflow = <optimized out>
        cnt = <optimized out>
        current = <optimized out>
        thousands = 0x0
        thousands_len = 0
        grouping = 0x0
        j = <optimized out>
        jmax = <optimized out>
        __res = <optimized out>
        __c = <optimized out>
        __res = <optimized out>
        __c = <optimized out>
        __res = <optimized out>
        __c = <optimized out>
#1  0x00007f008e645d22 in __strtoul (nptr=nptr@entry=0x0, 
endptr=endptr@entry=0x7ffe0cc1a5c0, base=base@entry=0)
    at ../stdlib/strtol.c:106
No locals.
#2  0x000056479a8ec8a3 in arg_strtou64 (str=0x0) at utils-lib.c:25
        value = <optimized out>
        ptr_parse_end = 0x0
#3  0x000056479a8d02c4 in cmd_check (argc=2, argv=0x7ffe0cc1aa08) at 
check/main.c:9596
        long_options = {{name = 0x56479a918506 "super", has_arg = 1, flag = 
0x0, val = 115}, {name = 0x56479a91469b "repair", 
            has_arg = 0, flag = 0x0, val = 257}, {name = 0x56479a90968e 
"readonly", has_arg = 0, flag = 0x0, val = 261}, {
            name = 0x56479a9146a2 "init-csum-tree", has_arg = 0, flag = 0x0, 
val = 258}, {name = 0x56479a9146b1 "init-extent-tree", 
            has_arg = 0, flag = 0x0, val = 259}, {name = 0x56479a9146c2 
"check-data-csum", has_arg = 0, flag = 0x0, val = 260}, {
            name = 0x56479a9146d2 "backup", has_arg = 0, flag = 0x0, val = 98}, 
{name = 0x56479a9146d9 "subvol-extents", 
            has_arg = 1, flag = 0x0, val = 69}, {name = 0x56479a9146e8 
"qgroup-report", has_arg = 0, flag = 0x0, val = 81}, {
            name = 0x56479a9146f6 "tree-root", has_arg = 1, flag = 0x0, val = 
114}, {name = 0x56479a914700 "chunk-root", 
            has_arg = 1, flag = 0x0, val = 262}, {name = 0x56479a914ea6 
"progress", has_arg = 0, flag = 0x0, val = 112}, {
            name = 0x56479a9161ff "mode", has_arg = 1, flag = 0x0, val = 263}, 
{name = 0x56479a91470b "clear-space-cache", 
            has_arg = 1, flag = 0x0, val = 264}, {name = 0x56479a913a46 
"force", has_arg = 0, flag = 0x0, val = 265}, {name = 0x0, 
            has_arg = 0, flag = 0x0, val = 0}}
        c = <optimized out>
        root_cache = {root = {rb_node = 0xfbad8001}}
        root = <optimized out>
        info = <optimized out>
        bytenr = 0
        subvolid = 0
        tree_root_bytenr = 0
        chunk_root_bytenr = 0
        uuidbuf = '\000' <repeats 36 times>
        ret = 0
        err = 0
        num = <optimized out>
        init_csum_tree = 0
        readonly = 0
        clear_space_cache = 0
        qgroup_report = 0
        qgroups_repaired = 0
        qgroup_report_ret = <optimized out>
        ctree_flags = 64
        force = 0
#4  0x000056479a88ee03 in main (argc=2, argv=0x7ffe0cc1aa08) at btrfs.c:302
        cmd = 0x56479a931838 <btrfs_cmd_group+216>
        bname = <optimized out>
        ret = <optimized out>
(gdb) 

(139)fuddl@flutschi:~$ sudo gdb btrfsck core
GNU gdb (Debian 8.2-1) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from btrfsck...Reading symbols from 
/usr/lib/debug/.build-id/be/495c9f9b35a2174fb0fa5151a765bcc608da48.debug...done.
done.

warning: core file may not match specified executable file.
[New LWP 29101]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `btrfsck -E 263 /dev/sdc1'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fd49f0c02c6 in __GI_____strtoul_l_internal (nptr=nptr@entry=0x0, 
endptr=endptr@entry=0x7fff789802e0, base=base@entry=0, 
    group=group@entry=0, loc=0x7fd49f240560 <_nl_global_locale>) at 
../stdlib/strtol_l.c:283
283     ../stdlib/strtol_l.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  0x00007fd49f0c02c6 in __GI_____strtoul_l_internal (nptr=nptr@entry=0x0, 
endptr=endptr@entry=0x7fff789802e0, base=base@entry=0, 
    group=group@entry=0, loc=0x7fd49f240560 <_nl_global_locale>) at 
../stdlib/strtol_l.c:283
#1  0x00007fd49f0bfd22 in __strtoul (nptr=nptr@entry=0x0, 
endptr=endptr@entry=0x7fff789802e0, base=base@entry=0)
    at ../stdlib/strtol.c:106
#2  0x0000562c226298a3 in arg_strtou64 (str=0x0) at utils-lib.c:25
#3  0x0000562c2260d2c4 in cmd_check (argc=4, argv=0x7fff78980728) at 
check/main.c:9596
#4  0x0000562c225cbe03 in main (argc=4, argv=0x7fff78980728) at btrfs.c:302
(gdb) bt ull
No symbol "ull" in current context.
(gdb) bt full
#0  0x00007fd49f0c02c6 in __GI_____strtoul_l_internal (nptr=nptr@entry=0x0, 
endptr=endptr@entry=0x7fff789802e0, base=base@entry=0, 
    group=group@entry=0, loc=0x7fd49f240560 <_nl_global_locale>) at 
../stdlib/strtol_l.c:283
        negative = <optimized out>
        cutoff = <optimized out>
        cutlim = <optimized out>
        i = <optimized out>
        s = 0x0
        c = <optimized out>
        save = <optimized out>
        end = <optimized out>
        overflow = <optimized out>
        cnt = <optimized out>
        current = <optimized out>
        thousands = 0x0
        thousands_len = 0
        grouping = 0x0
        j = <optimized out>
        jmax = <optimized out>
        __res = <optimized out>
        __c = <optimized out>
        __res = <optimized out>
        __c = <optimized out>
        __res = <optimized out>
        __c = <optimized out>
#1  0x00007fd49f0bfd22 in __strtoul (nptr=nptr@entry=0x0, 
endptr=endptr@entry=0x7fff789802e0, base=base@entry=0)
    at ../stdlib/strtol.c:106
No locals.
#2  0x0000562c226298a3 in arg_strtou64 (str=0x0) at utils-lib.c:25
        value = <optimized out>
        ptr_parse_end = 0x0
#3  0x0000562c2260d2c4 in cmd_check (argc=4, argv=0x7fff78980728) at 
check/main.c:9596
        long_options = {{name = 0x562c22655506 "super", has_arg = 1, flag = 
0x0, val = 115}, {name = 0x562c2265169b "repair", 
            has_arg = 0, flag = 0x0, val = 257}, {name = 0x562c2264668e 
"readonly", has_arg = 0, flag = 0x0, val = 261}, {
            name = 0x562c226516a2 "init-csum-tree", has_arg = 0, flag = 0x0, 
val = 258}, {name = 0x562c226516b1 "init-extent-tree", 
            has_arg = 0, flag = 0x0, val = 259}, {name = 0x562c226516c2 
"check-data-csum", has_arg = 0, flag = 0x0, val = 260}, {
            name = 0x562c226516d2 "backup", has_arg = 0, flag = 0x0, val = 98}, 
{name = 0x562c226516d9 "subvol-extents", 
            has_arg = 1, flag = 0x0, val = 69}, {name = 0x562c226516e8 
"qgroup-report", has_arg = 0, flag = 0x0, val = 81}, {
            name = 0x562c226516f6 "tree-root", has_arg = 1, flag = 0x0, val = 
114}, {name = 0x562c22651700 "chunk-root", 
            has_arg = 1, flag = 0x0, val = 262}, {name = 0x562c22651ea6 
"progress", has_arg = 0, flag = 0x0, val = 112}, {
            name = 0x562c226531ff "mode", has_arg = 1, flag = 0x0, val = 263}, 
{name = 0x562c2265170b "clear-space-cache", 
            has_arg = 1, flag = 0x0, val = 264}, {name = 0x562c22650a46 
"force", has_arg = 0, flag = 0x0, val = 265}, {name = 0x0, 
            has_arg = 0, flag = 0x0, val = 0}}
        c = <optimized out>
        root_cache = {root = {rb_node = 0xfbad8001}}
        root = <optimized out>
        info = <optimized out>
        bytenr = 0
        subvolid = 0
        tree_root_bytenr = 0
        chunk_root_bytenr = 0
        uuidbuf = '\000' <repeats 36 times>
        ret = 0
        err = 0
        num = <optimized out>
        init_csum_tree = 0
        readonly = 0
        clear_space_cache = 0
        qgroup_report = 0
        qgroups_repaired = 0
        qgroup_report_ret = <optimized out>
        ctree_flags = 64
        force = 0
#4  0x0000562c225cbe03 in main (argc=4, argv=0x7fff78980728) at btrfs.c:302
        cmd = 0x562c2266e838 <btrfs_cmd_group+216>
        bname = <optimized out>
        ret = <optimized out>
(gdb) 

(0)fuddl@flutschi:~$ sudo btrfsck  --subvol-extents 263 /dev/sdc1
Opening filesystem to check...
Checking filesystem on /dev/sdc1
UUID: 4be19d06-3169-432e-8555-f4a0635f0288
Print extent state for subvolume 263 on /dev/sdc1
UUID: 4be19d06-3169-432e-8555-f4a0635f0288
Speicherzugriffsfehler
(139)fuddl@flutschi:~$ sudo gdb btrfsck core
GNU gdb (Debian 8.2-1) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from btrfsck...Reading symbols from 
/usr/lib/debug/.build-id/be/495c9f9b35a2174fb0fa5151a765bcc608da48.debug...done.
done.

warning: core file may not match specified executable file.
[New LWP 29149]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `btrfsck --subvol-extents 263 /dev/sdc1'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00005559bcab685c in travel_tree (info=info@entry=0x5559be722e10, 
root=0x5559be7232c0, bytenr=bytenr@entry=30654464, 
    num_bytes=16384, ref_parent=ref_parent@entry=30654464) at 
qgroup-verify.c:746
746     qgroup-verify.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  0x00005559bcab685c in travel_tree (info=info@entry=0x5559be722e10, 
root=0x5559be7232c0, bytenr=bytenr@entry=30654464, 
    num_bytes=16384, ref_parent=ref_parent@entry=30654464) at 
qgroup-verify.c:746
#1  0x00005559bcab698e in add_refs_for_implied (block=0x5559be741b80, 
bytenr=30654464, info=0x5559be722e10) at qgroup-verify.c:782
#2  map_implied_refs (info=info@entry=0x5559be722e10) at qgroup-verify.c:800
#3  0x00005559bcab7211 in print_extent_state (info=info@entry=0x5559be722e10, 
subvol=subvol@entry=263) at qgroup-verify.c:1495
#4  0x00005559bcad97af in cmd_check (argc=<optimized out>, argv=0x7ffcdf585228) 
at check/main.c:9787
#5  0x00005559bca97e03 in main (argc=4, argv=0x7ffcdf585228) at btrfs.c:302
(gdb) bt full
#0  0x00005559bcab685c in travel_tree (info=info@entry=0x5559be722e10, 
root=0x5559be7232c0, bytenr=bytenr@entry=30654464, 
    num_bytes=16384, ref_parent=ref_parent@entry=30654464) at 
qgroup-verify.c:746
        ret = 0
        nr = <optimized out>
        i = 0
        eb = 0x5559be731640
        new_bytenr = <optimized out>
        new_num_bytes = <optimized out>
#1  0x00005559bcab698e in add_refs_for_implied (block=0x5559be741b80, 
bytenr=30654464, info=0x5559be722e10) at qgroup-verify.c:782
        ret = <optimized out>
        root_id = <optimized out>
        root = <optimized out>
        key = {objectid = 2, type = 132 '\204', offset = 18446744073709551615}
        ret = <optimized out>
        root_id = <optimized out>
        root = <optimized out>
        key = <optimized out>
#2  map_implied_refs (info=info@entry=0x5559be722e10) at qgroup-verify.c:800
        ret = 0
        uiter = {cur_list = 0x5559be756a70}
        unode = <optimized out>
#3  0x00005559bcab7211 in print_extent_state (info=info@entry=0x5559be722e10, 
subvol=subvol@entry=263) at qgroup-verify.c:1495
        ret = 0
#4  0x00005559bcad97af in cmd_check (argc=<optimized out>, argv=0x7ffcdf585228) 
at check/main.c:9787
        root_cache = {root = {rb_node = 0x0}}
        root = 0x5559be752460
        info = 0x5559be722e10
        bytenr = <optimized out>
        subvolid = 263
        tree_root_bytenr = <optimized out>
        chunk_root_bytenr = 0
        uuidbuf = "4be19d06-3169-432e-8555-f4a0635f0288"
        ret = <optimized out>
        err = 0
        num = <optimized out>
        init_csum_tree = 0
        readonly = 0
        clear_space_cache = 0
        qgroup_report = 0
        qgroups_repaired = 0
        qgroup_report_ret = <optimized out>
        ctree_flags = <optimized out>
        force = <optimized out>
#5  0x00005559bca97e03 in main (argc=4, argv=0x7ffcdf585228) at btrfs.c:302
        cmd = 0x5559bcb3a838 <btrfs_cmd_group+216>
        bname = <optimized out>
        ret = <optimized out>
(gdb) 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to