kdave / btrfs-progs

Development of userspace BTRFS tools
GNU General Public License v2.0
536 stars 239 forks source link

[mkfs-tests] 001-basic-profiles: UB: misaligned pointer, division by zero, inf to unsigned long long #34

Closed matthiaskrgr closed 10 months ago

matthiaskrgr commented 7 years ago

compiled with clang 4.0 CFLAGS: -g3 -O0 -Wall -fno-omit-frame-pointer -fsanitize-address-use-after-scope -fno-optimize-sibling-calls -fsanitize=address,undefined based on master branch / btrfs progs 4.10.1 / 15d37febbce1255c1042764690a5e5375d014616 run command (as root): UBSAN_OPTIONS=print_stacktrace=1 make test -k

mkfs-tests-results.txt

=== Entering /home/matthias/vcs/github/btrfs-progs/tests/mkfs-tests/001-basic-profiles
############### losetup --find --show img1
/dev/loop4
############### losetup --find --show img2
/dev/loop5
############### losetup --find --show img3
/dev/loop6
############### losetup --find --show img4
/dev/loop7
############### /home/matthias/vcs/github/btrfs-progs/mkfs.btrfs -f /dev/loop4
btrfs-progs v4.10.1-dirty
See http://btrfs.wiki.kernel.org for more information.

Performing full device TRIM /dev/loop4 (2.00GiB) ...
Label:              (null)
UUID:               ff839761-b969-4fc0-96d5-439de7e7eb4e
Node size:          16384
Sector size:        4096
Filesystem size:    2.00GiB
Block group profiles:
  Data:             single            8.00MiB
  Metadata:         DUP             102.38MiB
  System:           DUP               8.00MiB
SSD detected:       no
Incompat features:  extref, skinny-metadata
Number of devices:  1
Devices:
   ID        SIZE  PATH
    1     2.00GiB  /dev/loop4

############### /home/matthias/vcs/github/btrfs-progs/btrfs inspect-internal dump-super /dev/loop4
superblock: bytenr=65536, device=/dev/loop4
---------------------------------------------------------
csum_type       0 (crc32c)
csum_size       4
csum            0xcc25a630 [match]
bytenr          65536
flags           0x1
            ( WRITTEN )
magic           _BHRfS_M [match]
fsid            ff839761-b969-4fc0-96d5-439de7e7eb4e
label           
generation      5
root            29491200
sys_array_size      129
chunk_root_generation   5
root_level      0
chunk_root      20987904
chunk_root_level    0
log_root        0
log_root_transid    0
log_root_level      0
total_bytes     2147483648
bytes_used      114688
sectorsize      4096
nodesize        16384
leafsize        16384
stripesize      4096
root_dir        6
num_devices     1
compat_flags        0x0
compat_ro_flags     0x0
incompat_flags      0x141
            ( MIXED_BACKREF |
              EXTENDED_IREF |
              SKINNY_METADATA )
cache_generation    18446744073709551615
uuid_tree_generation    0
dev_item.uuid       d8f6429b-f567-4af7-ab8b-79e47d5a3a57
dev_item.fsid       ff839761-b969-4fc0-96d5-439de7e7eb4e [match]
dev_item.type       0
dev_item.total_bytes    2147483648
dev_item.bytes_used 239861760
dev_item.io_align   4096
dev_item.io_width   4096
dev_item.sector_size    4096
dev_item.devid      1
dev_item.dev_group  0
dev_item.seek_speed 0
dev_item.bandwidth  0
dev_item.generation 0

############### /home/matthias/vcs/github/btrfs-progs/btrfs check /dev/loop4
checking extents
checking free space cache
checking fs roots
checking csums
checking root refs
Checking filesystem on /dev/loop4
UUID: ff839761-b969-4fc0-96d5-439de7e7eb4e
found 114688 bytes used, no error found
total csum bytes: 0
total tree bytes: 114688
total fs tree bytes: 32768
total extent tree bytes: 16384
btree space waste bytes: 109471
file data blocks allocated: 0
 referenced 0
############### mount /dev/loop4 /home/matthias/vcs/github/btrfs-progs/tests/mnt
############### /home/matthias/vcs/github/btrfs-progs/btrfs filesystem df /home/matthias/vcs/github/btrfs-progs/tests/mnt
Data, single: total=8.00MiB, used=64.00KiB
System, DUP: total=8.00MiB, used=16.00KiB
Metadata, DUP: total=102.38MiB, used=112.00KiB
GlobalReserve, single: total=16.00MiB, used=0.00B
############### /home/matthias/vcs/github/btrfs-progs/btrfs filesystem usage /home/matthias/vcs/github/btrfs-progs/tests/mnt
/home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9: runtime error: member access within misaligned address 0x7ffc72d78c0a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffc72d78c0a: note: pointer points here
 e7 e7  eb 4e 05 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 c0 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f27b8 in btrfs_search_header_len /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9
    #1 0x8ea71c in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:189:11
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0244e2400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9: runtime error: load of misaligned address 0x7ffc72d78c26 for type 'const __le32' (aka 'const unsigned int'), which requires 4 byte alignment
0x7ffc72d78c26: note: pointer points here
 e4 00 00 00 50 00  00 00 00 00 80 00 00 00  00 00 02 00 00 00 00 00  00 00 00 00 01 00 00 00  00 00
             ^ 
    #0 0x8f2853 in btrfs_search_header_len /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9
    #1 0x8ea71c in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:189:11
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0244e2400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9: runtime error: member access within misaligned address 0x7ffc72d78c0a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffc72d78c0a: note: pointer points here
 e7 e7  eb 4e 05 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 c0 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f28f8 in btrfs_search_header_objectid /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9
    #1 0x8ea73a in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:191:23
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0244e2400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9: runtime error: load of misaligned address 0x7ffc72d78c12 for type 'const __le64' (aka 'const unsigned long long'), which requires 8 byte alignment
0x7ffc72d78c12: note: pointer points here
 00 00  00 00 00 01 00 00 00 00  00 00 00 00 c0 00 00 00  00 00 e4 00 00 00 50 00  00 00 00 00 80 00
              ^ 
    #0 0x8f2993 in btrfs_search_header_objectid /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9
    #1 0x8ea73a in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:191:23
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0244e2400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9: runtime error: member access within misaligned address 0x7ffc72d78c0a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffc72d78c0a: note: pointer points here
 e7 e7  eb 4e 05 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 c0 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f2a18 in btrfs_search_header_type /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9
    #1 0x8ea836 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:192:19
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0244e2400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9: runtime error: load of misaligned address 0x7ffc72d78c22 for type 'const __le32' (aka 'const unsigned int'), which requires 8 byte alignment
0x7ffc72d78c22: note: pointer points here
 00 00  00 00 e4 00 00 00 50 00  00 00 00 00 80 00 00 00  00 00 02 00 00 00 00 00  00 00 00 00 01 00
              ^ 
    #0 0x8f2ab3 in btrfs_search_header_type /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9
    #1 0x8ea836 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:192:19
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0244e2400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9: runtime error: member access within misaligned address 0x7ffc72d78c0a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffc72d78c0a: note: pointer points here
 e7 e7  eb 4e 05 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 c0 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f2b58 in btrfs_search_header_offset /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9
    #1 0x8ea956 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:193:21
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0244e2400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9: runtime error: load of misaligned address 0x7ffc72d78c1a for type 'const __le64' (aka 'const unsigned long long'), which requires 8 byte alignment
0x7ffc72d78c1a: note: pointer points here
 00 00  00 00 00 00 c0 00 00 00  00 00 e4 00 00 00 50 00  00 00 00 00 80 00 00 00  00 00 02 00 00 00
              ^ 
    #0 0x8f2bf3 in btrfs_search_header_offset /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9
    #1 0x8ea956 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:193:21
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0244e2400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9 in 
Overall:
    Device size:           2.00GiB
    Device allocated:        228.75MiB
    Device unallocated:        1.78GiB
    Device missing:          0.00B
    Used:            320.00KiB
    Free (estimated):          1.78GiB  (min: 917.56MiB)
    Data ratio:               1.00
    Metadata ratio:           2.00
    Global reserve:       16.00MiB  (used: 0.00B)

Data,single: Size:8.00MiB, Used:64.00KiB
   /dev/loop4      8.00MiB

Metadata,DUP: Size:102.38MiB, Used:112.00KiB
   /dev/loop4    204.75MiB

System,DUP: Size:8.00MiB, Used:16.00KiB
   /dev/loop4     16.00MiB

Unallocated:
   /dev/loop4      1.78GiB
############### /home/matthias/vcs/github/btrfs-progs/btrfs device usage /home/matthias/vcs/github/btrfs-progs/tests/mnt
/home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9: runtime error: member access within misaligned address 0x7ffe5ec4722a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffe5ec4722a: note: pointer points here
 e7 e7  eb 4e 05 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 c0 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f27b8 in btrfs_search_header_len /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9
    #1 0x8ea71c in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:189:11
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7f5f52ce1400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9: runtime error: load of misaligned address 0x7ffe5ec47246 for type 'const __le32' (aka 'const unsigned int'), which requires 4 byte alignment
0x7ffe5ec47246: note: pointer points here
 e4 00 00 00 50 00  00 00 00 00 80 00 00 00  00 00 02 00 00 00 00 00  00 00 00 00 01 00 00 00  00 00
             ^ 
    #0 0x8f2853 in btrfs_search_header_len /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9
    #1 0x8ea71c in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:189:11
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7f5f52ce1400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9: runtime error: member access within misaligned address 0x7ffe5ec4722a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffe5ec4722a: note: pointer points here
 e7 e7  eb 4e 05 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 c0 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f28f8 in btrfs_search_header_objectid /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9
    #1 0x8ea73a in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:191:23
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7f5f52ce1400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9: runtime error: load of misaligned address 0x7ffe5ec47232 for type 'const __le64' (aka 'const unsigned long long'), which requires 8 byte alignment
0x7ffe5ec47232: note: pointer points here
 00 00  00 00 00 01 00 00 00 00  00 00 00 00 c0 00 00 00  00 00 e4 00 00 00 50 00  00 00 00 00 80 00
              ^ 
    #0 0x8f2993 in btrfs_search_header_objectid /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9
    #1 0x8ea73a in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:191:23
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7f5f52ce1400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9: runtime error: member access within misaligned address 0x7ffe5ec4722a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffe5ec4722a: note: pointer points here
 e7 e7  eb 4e 05 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 c0 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f2a18 in btrfs_search_header_type /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9
    #1 0x8ea836 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:192:19
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7f5f52ce1400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9: runtime error: load of misaligned address 0x7ffe5ec47242 for type 'const __le32' (aka 'const unsigned int'), which requires 8 byte alignment
0x7ffe5ec47242: note: pointer points here
 00 00  00 00 e4 00 00 00 50 00  00 00 00 00 80 00 00 00  00 00 02 00 00 00 00 00  00 00 00 00 01 00
              ^ 
    #0 0x8f2ab3 in btrfs_search_header_type /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9
    #1 0x8ea836 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:192:19
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7f5f52ce1400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9: runtime error: member access within misaligned address 0x7ffe5ec4722a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffe5ec4722a: note: pointer points here
 e7 e7  eb 4e 05 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 c0 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f2b58 in btrfs_search_header_offset /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9
    #1 0x8ea956 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:193:21
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7f5f52ce1400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9: runtime error: load of misaligned address 0x7ffe5ec4723a for type 'const __le64' (aka 'const unsigned long long'), which requires 8 byte alignment
0x7ffe5ec4723a: note: pointer points here
 00 00  00 00 00 00 c0 00 00 00  00 00 e4 00 00 00 50 00  00 00 00 00 80 00 00 00  00 00 02 00 00 00
              ^ 
    #0 0x8f2bf3 in btrfs_search_header_offset /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9
    #1 0x8ea956 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:193:21
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7f5f52ce1400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9 in 
/dev/loop4, ID: 1
   Device size:             2.00GiB
   Device slack:              0.00B
   Data,single:             8.00MiB
   Metadata,DUP:          204.75MiB
   System,DUP:             16.00MiB
   Unallocated:             1.78GiB

############### umount /home/matthias/vcs/github/btrfs-progs/tests/mnt
############### /home/matthias/vcs/github/btrfs-progs/mkfs.btrfs -f -d single -m single /dev/loop4
btrfs-progs v4.10.1-dirty
See http://btrfs.wiki.kernel.org for more information.

Performing full device TRIM /dev/loop4 (2.00GiB) ...
Label:              (null)
UUID:               b6b9d334-d3e4-4013-95f6-57bc9a11d5b3
Node size:          16384
Sector size:        4096
Filesystem size:    2.00GiB
Block group profiles:
  Data:             single            8.00MiB
  Metadata:         single            8.00MiB
  System:           single            4.00MiB
SSD detected:       no
Incompat features:  extref, skinny-metadata
Number of devices:  1
Devices:
   ID        SIZE  PATH
    1     2.00GiB  /dev/loop4

############### /home/matthias/vcs/github/btrfs-progs/btrfs inspect-internal dump-super /dev/loop4
superblock: bytenr=65536, device=/dev/loop4
---------------------------------------------------------
csum_type       0 (crc32c)
csum_size       4
csum            0xc5d2ea69 [match]
bytenr          65536
flags           0x1
            ( WRITTEN )
magic           _BHRfS_M [match]
fsid            b6b9d334-d3e4-4013-95f6-57bc9a11d5b3
label           
generation      5
root            4210688
sys_array_size      97
chunk_root_generation   4
root_level      0
chunk_root      131072
chunk_root_level    0
log_root        0
log_root_transid    0
log_root_level      0
total_bytes     2147483648
bytes_used      114688
sectorsize      4096
nodesize        16384
leafsize        16384
stripesize      4096
root_dir        6
num_devices     1
compat_flags        0x0
compat_ro_flags     0x0
incompat_flags      0x141
            ( MIXED_BACKREF |
              EXTENDED_IREF |
              SKINNY_METADATA )
cache_generation    18446744073709551615
uuid_tree_generation    0
dev_item.uuid       a97ccd94-5f38-47f0-b774-59d874e529fb
dev_item.fsid       b6b9d334-d3e4-4013-95f6-57bc9a11d5b3 [match]
dev_item.type       0
dev_item.total_bytes    2147483648
dev_item.bytes_used 20971520
dev_item.io_align   4096
dev_item.io_width   4096
dev_item.sector_size    4096
dev_item.devid      1
dev_item.dev_group  0
dev_item.seek_speed 0
dev_item.bandwidth  0
dev_item.generation 0

############### /home/matthias/vcs/github/btrfs-progs/btrfs check /dev/loop4
checking extents
checking free space cache
checking fs roots
checking csums
checking root refs
Checking filesystem on /dev/loop4
UUID: b6b9d334-d3e4-4013-95f6-57bc9a11d5b3
found 114688 bytes used, no error found
total csum bytes: 0
total tree bytes: 114688
total fs tree bytes: 32768
total extent tree bytes: 16384
btree space waste bytes: 109681
file data blocks allocated: 0
 referenced 0
############### mount /dev/loop4 /home/matthias/vcs/github/btrfs-progs/tests/mnt
############### /home/matthias/vcs/github/btrfs-progs/btrfs filesystem df /home/matthias/vcs/github/btrfs-progs/tests/mnt
Data, single: total=8.00MiB, used=64.00KiB
System, single: total=4.00MiB, used=16.00KiB
Metadata, single: total=216.00MiB, used=112.00KiB
GlobalReserve, single: total=16.00MiB, used=0.00B
############### /home/matthias/vcs/github/btrfs-progs/btrfs filesystem usage /home/matthias/vcs/github/btrfs-progs/tests/mnt
/home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9: runtime error: member access within misaligned address 0x7ffde84e5b8a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffde84e5b8a: note: pointer points here
 9a 11  d5 b3 06 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 00 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f27b8 in btrfs_search_header_len /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9
    #1 0x8ea71c in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:189:11
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0ebf61400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9: runtime error: load of misaligned address 0x7ffde84e5ba6 for type 'const __le32' (aka 'const unsigned int'), which requires 4 byte alignment
0x7ffde84e5ba6: note: pointer points here
 e4 00 00 00 50 00  00 00 00 00 40 00 00 00  00 00 02 00 00 00 00 00  00 00 00 00 01 00 00 00  00 00
             ^ 
    #0 0x8f2853 in btrfs_search_header_len /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9
    #1 0x8ea71c in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:189:11
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0ebf61400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9: runtime error: member access within misaligned address 0x7ffde84e5b8a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffde84e5b8a: note: pointer points here
 9a 11  d5 b3 06 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 00 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f28f8 in btrfs_search_header_objectid /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9
    #1 0x8ea73a in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:191:23
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0ebf61400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9: runtime error: load of misaligned address 0x7ffde84e5b92 for type 'const __le64' (aka 'const unsigned long long'), which requires 8 byte alignment
0x7ffde84e5b92: note: pointer points here
 00 00  00 00 00 01 00 00 00 00  00 00 00 00 00 00 00 00  00 00 e4 00 00 00 50 00  00 00 00 00 40 00
              ^ 
    #0 0x8f2993 in btrfs_search_header_objectid /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9
    #1 0x8ea73a in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:191:23
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0ebf61400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9: runtime error: member access within misaligned address 0x7ffde84e5b8a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffde84e5b8a: note: pointer points here
 9a 11  d5 b3 06 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 00 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f2a18 in btrfs_search_header_type /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9
    #1 0x8ea836 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:192:19
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0ebf61400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9: runtime error: load of misaligned address 0x7ffde84e5ba2 for type 'const __le32' (aka 'const unsigned int'), which requires 8 byte alignment
0x7ffde84e5ba2: note: pointer points here
 00 00  00 00 e4 00 00 00 50 00  00 00 00 00 40 00 00 00  00 00 02 00 00 00 00 00  00 00 00 00 01 00
              ^ 
    #0 0x8f2ab3 in btrfs_search_header_type /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9
    #1 0x8ea836 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:192:19
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0ebf61400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9: runtime error: member access within misaligned address 0x7ffde84e5b8a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffde84e5b8a: note: pointer points here
 9a 11  d5 b3 06 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 00 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f2b58 in btrfs_search_header_offset /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9
    #1 0x8ea956 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:193:21
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0ebf61400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9: runtime error: load of misaligned address 0x7ffde84e5b9a for type 'const __le64' (aka 'const unsigned long long'), which requires 8 byte alignment
0x7ffde84e5b9a: note: pointer points here
 00 00  00 00 00 00 00 00 00 00  00 00 e4 00 00 00 50 00  00 00 00 00 40 00 00 00  00 00 02 00 00 00
              ^ 
    #0 0x8f2bf3 in btrfs_search_header_offset /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9
    #1 0x8ea956 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:193:21
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7fa0ebf61400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9 in 
Overall:
    Device size:           2.00GiB
    Device allocated:        228.00MiB
    Device unallocated:        1.78GiB
    Device missing:          0.00B
    Used:            192.00KiB
    Free (estimated):          1.78GiB  (min: 1.78GiB)
    Data ratio:               1.00
    Metadata ratio:           1.00
    Global reserve:       16.00MiB  (used: 0.00B)

Data,single: Size:8.00MiB, Used:64.00KiB
   /dev/loop4      8.00MiB

Metadata,single: Size:216.00MiB, Used:112.00KiB
   /dev/loop4    216.00MiB

System,single: Size:4.00MiB, Used:16.00KiB
   /dev/loop4      4.00MiB

Unallocated:
   /dev/loop4      1.78GiB
############### /home/matthias/vcs/github/btrfs-progs/btrfs device usage /home/matthias/vcs/github/btrfs-progs/tests/mnt
/home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9: runtime error: member access within misaligned address 0x7ffd949fb18a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffd949fb18a: note: pointer points here
 9a 11  d5 b3 06 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 00 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f27b8 in btrfs_search_header_len /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9
    #1 0x8ea71c in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:189:11
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7fc091e78400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9: runtime error: load of misaligned address 0x7ffd949fb1a6 for type 'const __le32' (aka 'const unsigned int'), which requires 4 byte alignment
0x7ffd949fb1a6: note: pointer points here
 e4 00 00 00 50 00  00 00 00 00 40 00 00 00  00 00 02 00 00 00 00 00  00 00 00 00 01 00 00 00  00 00
             ^ 
    #0 0x8f2853 in btrfs_search_header_len /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9
    #1 0x8ea71c in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:189:11
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7fc091e78400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9: runtime error: member access within misaligned address 0x7ffd949fb18a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffd949fb18a: note: pointer points here
 9a 11  d5 b3 06 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 00 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f28f8 in btrfs_search_header_objectid /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9
    #1 0x8ea73a in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:191:23
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7fc091e78400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9: runtime error: load of misaligned address 0x7ffd949fb192 for type 'const __le64' (aka 'const unsigned long long'), which requires 8 byte alignment
0x7ffd949fb192: note: pointer points here
 00 00  00 00 00 01 00 00 00 00  00 00 00 00 00 00 00 00  00 00 e4 00 00 00 50 00  00 00 00 00 40 00
              ^ 
    #0 0x8f2993 in btrfs_search_header_objectid /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9
    #1 0x8ea73a in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:191:23
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7fc091e78400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9: runtime error: member access within misaligned address 0x7ffd949fb18a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffd949fb18a: note: pointer points here
 9a 11  d5 b3 06 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 00 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f2a18 in btrfs_search_header_type /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9
    #1 0x8ea836 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:192:19
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7fc091e78400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9: runtime error: load of misaligned address 0x7ffd949fb1a2 for type 'const __le32' (aka 'const unsigned int'), which requires 8 byte alignment
0x7ffd949fb1a2: note: pointer points here
 00 00  00 00 e4 00 00 00 50 00  00 00 00 00 40 00 00 00  00 00 02 00 00 00 00 00  00 00 00 00 01 00
              ^ 
    #0 0x8f2ab3 in btrfs_search_header_type /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9
    #1 0x8ea836 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:192:19
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7fc091e78400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9: runtime error: member access within misaligned address 0x7ffd949fb18a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffd949fb18a: note: pointer points here
 9a 11  d5 b3 06 00 00 00 00 00  00 00 00 01 00 00 00 00  00 00 00 00 00 00 00 00  00 00 e4 00 00 00
              ^ 
    #0 0x8f2b58 in btrfs_search_header_offset /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9
    #1 0x8ea956 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:193:21
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x70e4fb in _cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:531:8
    #4 0x70c5ca in cmd_device_usage /home/matthias/vcs/github/btrfs-progs/cmds-device.c:577:9
    #5 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #6 0x70c754 in cmd_device /home/matthias/vcs/github/btrfs-progs/cmds-device.c:607:9
    #7 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #8 0x7fc091e78400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #9 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

[...]

############### /home/matthias/vcs/github/btrfs-progs/btrfs inspect-internal dump-super /dev/loop4
superblock: bytenr=65536, device=/dev/loop4
---------------------------------------------------------
csum_type       0 (crc32c)
csum_size       4
csum            0x68801fef [match]
bytenr          65536
flags           0x1
            ( WRITTEN )
magic           _BHRfS_M [match]
fsid            8fecceaa-c1df-4436-bb41-0badd87fdda9
label           
generation      5
root            37879808
sys_array_size      193
chunk_root_generation   5
root_level      0
chunk_root      20987904
chunk_root_level    0
log_root        0
log_root_transid    0
log_root_level      0
total_bytes     8589934592
bytes_used      114688
sectorsize      4096
nodesize        16384
leafsize        16384
stripesize      4096
root_dir        6
num_devices     4
compat_flags        0x0
compat_ro_flags     0x0
incompat_flags      0x1c1
            ( MIXED_BACKREF |
              EXTENDED_IREF |
              RAID56 |
              SKINNY_METADATA )
cache_generation    18446744073709551615
uuid_tree_generation    0
dev_item.uuid       f8fdef2b-6a8c-434b-a68e-b4c0e744e2b3
dev_item.fsid       8fecceaa-c1df-4436-bb41-0badd87fdda9 [match]
dev_item.type       0
dev_item.total_bytes    2147483648
dev_item.bytes_used 437780480
dev_item.io_align   4096
dev_item.io_width   4096
dev_item.sector_size    4096
dev_item.devid      1
dev_item.dev_group  0
dev_item.seek_speed 0
dev_item.bandwidth  0
dev_item.generation 0

############### /home/matthias/vcs/github/btrfs-progs/btrfs check /dev/loop4
checking extents
checking free space cache
checking fs roots
checking csums
checking root refs
Checking filesystem on /dev/loop4
UUID: 8fecceaa-c1df-4436-bb41-0badd87fdda9
found 114688 bytes used, no error found
total csum bytes: 0
total tree bytes: 114688
total fs tree bytes: 32768
total extent tree bytes: 16384
btree space waste bytes: 108367
file data blocks allocated: 0
 referenced 0
############### mount /dev/loop4 /home/matthias/vcs/github/btrfs-progs/tests/mnt
############### /home/matthias/vcs/github/btrfs-progs/btrfs filesystem df /home/matthias/vcs/github/btrfs-progs/tests/mnt
Data, RAID6: total=409.50MiB, used=128.00KiB
System, RAID6: total=16.00MiB, used=16.00KiB
Metadata, RAID6: total=409.50MiB, used=112.00KiB
GlobalReserve, single: total=16.00MiB, used=0.00B
############### /home/matthias/vcs/github/btrfs-progs/btrfs filesystem usage /home/matthias/vcs/github/btrfs-progs/tests/mnt
/home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9: runtime error: member access within misaligned address 0x7ffcfc2f358a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffcfc2f358a: note: pointer points here
 d8 7f  dd a9 05 00 00 00 00 00  00 00 01 00 00 00 00 00  00 00 02 00 00 00 00 00  00 00 d8 00 00 00
              ^ 
    #0 0x8f27b8 in btrfs_search_header_len /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9
    #1 0x8ea71c in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:189:11
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7f5a81c5a400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9: runtime error: load of misaligned address 0x7ffcfc2f35a6 for type 'const __le32' (aka 'const unsigned int'), which requires 4 byte alignment
0x7ffcfc2f35a6: note: pointer points here
 d8 00 00 00 62 00  00 00 02 00 00 00 00 00  00 00 00 00 00 80 00 00  00 00 00 00 18 1a 00 00  00 00
             ^ 
    #0 0x8f2853 in btrfs_search_header_len /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9
    #1 0x8ea71c in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:189:11
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7f5a81c5a400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2388:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9: runtime error: member access within misaligned address 0x7ffcfc2f358a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffcfc2f358a: note: pointer points here
 d8 7f  dd a9 05 00 00 00 00 00  00 00 01 00 00 00 00 00  00 00 02 00 00 00 00 00  00 00 d8 00 00 00
              ^ 
    #0 0x8f28f8 in btrfs_search_header_objectid /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9
    #1 0x8ea73a in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:191:23
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7f5a81c5a400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9: runtime error: load of misaligned address 0x7ffcfc2f3592 for type 'const __le64' (aka 'const unsigned long long'), which requires 8 byte alignment
0x7ffcfc2f3592: note: pointer points here
 00 00  00 00 01 00 00 00 00 00  00 00 02 00 00 00 00 00  00 00 d8 00 00 00 62 00  00 00 02 00 00 00
              ^ 
    #0 0x8f2993 in btrfs_search_header_objectid /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9
    #1 0x8ea73a in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:191:23
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7f5a81c5a400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2373:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9: runtime error: member access within misaligned address 0x7ffcfc2f358a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffcfc2f358a: note: pointer points here
 d8 7f  dd a9 05 00 00 00 00 00  00 00 01 00 00 00 00 00  00 00 02 00 00 00 00 00  00 00 d8 00 00 00
              ^ 
    #0 0x8f2a18 in btrfs_search_header_type /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9
    #1 0x8ea836 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:192:19
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7f5a81c5a400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9: runtime error: load of misaligned address 0x7ffcfc2f35a2 for type 'const __le32' (aka 'const unsigned int'), which requires 8 byte alignment
0x7ffcfc2f35a2: note: pointer points here
 00 00  00 00 d8 00 00 00 62 00  00 00 02 00 00 00 00 00  00 00 00 00 00 80 00 00  00 00 00 00 18 1a
              ^ 
    #0 0x8f2ab3 in btrfs_search_header_type /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9
    #1 0x8ea836 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:192:19
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7f5a81c5a400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2383:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9: runtime error: member access within misaligned address 0x7ffcfc2f358a for type 'struct btrfs_ioctl_search_header', which requires 8 byte alignment
0x7ffcfc2f358a: note: pointer points here
 d8 7f  dd a9 05 00 00 00 00 00  00 00 01 00 00 00 00 00  00 00 02 00 00 00 00 00  00 00 d8 00 00 00
              ^ 
    #0 0x8f2b58 in btrfs_search_header_offset /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9
    #1 0x8ea956 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:193:21
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7f5a81c5a400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9 in 
/home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9: runtime error: load of misaligned address 0x7ffcfc2f359a for type 'const __le64' (aka 'const unsigned long long'), which requires 8 byte alignment
0x7ffcfc2f359a: note: pointer points here
 00 00  00 00 02 00 00 00 00 00  00 00 d8 00 00 00 62 00  00 00 02 00 00 00 00 00  00 00 00 00 00 80
              ^ 
    #0 0x8f2bf3 in btrfs_search_header_offset /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9
    #1 0x8ea956 in load_chunk_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:193:21
    #2 0x8e913a in load_chunk_and_device_info /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:590:8
    #3 0x8ed0ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:974:9
    #4 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #5 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #6 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #7 0x7f5a81c5a400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #8 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior /home/matthias/vcs/github/btrfs-progs/ctree.h:2378:9 in 
WARNING: RAID56 detected, not implemented
WARNING: RAID56 detected, not implemented
WARNING: RAID56 detected, not implemented
cmds-fi-usage.c:447:49: runtime error: division by zero
    #0 0x8ef67b in print_filesystem_usage_overall /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:447:49
    #1 0x8ed2ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:979:9
    #2 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #3 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #4 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #5 0x7f5a81c5a400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #6 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior cmds-fi-usage.c:447:49 in 
cmds-fi-usage.c:447:19: runtime error: value -nan is outside the range of representable values of type 'unsigned long long'
    #0 0x8ef6db in print_filesystem_usage_overall /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:447:19
    #1 0x8ed2ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:979:9
    #2 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #3 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #4 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #5 0x7f5a81c5a400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #6 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior cmds-fi-usage.c:447:19 in 
cmds-fi-usage.c:460:36: runtime error: division by zero
    #0 0x8ef7e4 in print_filesystem_usage_overall /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:460:36
    #1 0x8ed2ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:979:9
    #2 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #3 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #4 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #5 0x7f5a81c5a400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #6 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior cmds-fi-usage.c:460:36 in 
cmds-fi-usage.c:460:18: runtime error: value inf is outside the range of representable values of type 'unsigned long long'
    #0 0x8ef870 in print_filesystem_usage_overall /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:460:18
    #1 0x8ed2ef in cmd_filesystem_usage /home/matthias/vcs/github/btrfs-progs/cmds-fi-usage.c:979:9
    #2 0x4f828f in handle_command_group /home/matthias/vcs/github/btrfs-progs/btrfs.c:136:9
    #3 0x6fa874 in cmd_filesystem /home/matthias/vcs/github/btrfs-progs/cmds-filesystem.c:1318:9
    #4 0x4f8dd5 in main /home/matthias/vcs/github/btrfs-progs/btrfs.c:246:8
    #5 0x7f5a81c5a400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
    #6 0x423bf9 in _start (/home/matthias/vcs/github/btrfs-progs/btrfs+0x423bf9)

SUMMARY: AddressSanitizer: undefined-behavior cmds-fi-usage.c:460:18 in 
Overall:
    Device size:           8.00GiB
    Device allocated:            0.00B
    Device unallocated:        8.00GiB
    Device missing:          0.00B
    Used:                0.00B
    Free (estimated):            0.00B  (min: 8.00EiB)
    Data ratio:               0.00
    Metadata ratio:           0.00
    Global reserve:       16.00MiB  (used: 0.00B)

Data,RAID6: Size:409.50MiB, Used:128.00KiB
   /dev/loop4    204.75MiB
   /dev/loop5    204.75MiB
   /dev/loop6    204.75MiB
   /dev/loop7    204.75MiB

Metadata,RAID6: Size:409.50MiB, Used:112.00KiB
   /dev/loop4    204.75MiB
   /dev/loop5    204.75MiB
   /dev/loop6    204.75MiB
   /dev/loop7    204.75MiB

System,RAID6: Size:16.00MiB, Used:16.00KiB
   /dev/loop4      8.00MiB
   /dev/loop5      8.00MiB
   /dev/loop6      8.00MiB
   /dev/loop7      8.00MiB

Unallocated:
   /dev/loop4      1.59GiB
   /dev/loop5      1.59GiB
   /dev/loop6      1.59GiB
   /dev/loop7      1.59GiB
kdave commented 6 years ago

I can't get clang (v 5.0.1) to reproduce the reports, gcc with asan and ubsan does not report the errors for 001.

make CC=clang D=asan,ubsan EXTRA_CFLAGS='-fno-omit-frame-pointer -fsanitize-address-use-after-scope -fno-optimize-sibling-calls'

this works but prints

==25070==Your application is linked against incompatible ASan runtimes.                                                                                                                                            

with mkfs test-mkfs and the test fails. I found a suggestion to use LD_PRELOAD with the asan libraries, but this detects leaks in make. I think this should work without such tweaks, any help is appreciated. I'm going to continue with gcc asan, having clang could increase the coverage.

kdave commented 10 months ago

Clang 17 stll complains about the incompatible asan runtimes. Gcc + asan does not report the alignment problems or others I see in the list. This report is old so I'll close it but some new tests report asan problems, for that please open new reports.