Closed dolorosus closed 12 months ago
It fails in every case:
#btrfs --version
btrfs-progs v6.5.2
#btrfs check /dev/sda3
Opening filesystem to check...
Segmentation fault
It makes me doubt the reliability of the file system, if the verification is already broken.
Any gdb backtrace
output?
Sorry, I forgot... ...since I could reproduce it on two different machines (arm64 and x64), I assumed it would be reproducible
(gdb) r check /dev/sda3
Starting program: /usr/local/bin/btrfs check /dev/sda3
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
Opening filesystem to check...
Program received signal SIGSEGV, Segmentation fault.
0x00000055555a58e4 in blk_file_in_dev_list (file=0x5555692a48 "/dev/sda3", fs_devices=0x55556926b0) at common/open-utils.c:48
48 if((ret = is_same_loop_file(device->name, file)))
(gdb) bt
#0 0x00000055555a58e4 in blk_file_in_dev_list (file=0x5555692a48 "/dev/sda3", fs_devices=0x55556926b0) at common/open-utils.c:48
#1 check_mounted_where (fd=fd@entry=3, file=file@entry=0x7ffffff7cd "/dev/sda3", where=where@entry=0x0, size=size@entry=0, fs_dev_ret=fs_dev_ret@entry=0x0,
sbflags=sbflags@entry=0, noscan=noscan@entry=false) at common/open-utils.c:87
#2 0x00000055555a59dc in check_mounted (file=0x7ffffff7cd "/dev/sda3") at common/open-utils.c:138
#3 0x00000055555e39bc in cmd_check (cmd=0x5555687d08 <cmd_struct_check>, argc=<optimized out>, argv=0x7ffffff540) at check/main.c:10175
#4 0x000000555556be28 in cmd_execute (argv=0x7ffffff540, argc=2, cmd=0x5555687d08 <cmd_struct_check>) at cmds/commands.h:125
#5 main (argc=2, argv=0x7ffffff540) at btrfs.c:449
41 static int blk_file_in_dev_list(struct btrfs_fs_devices* fs_devices, │
│ 42 const char* file) │
│ 43 { │
│ 44 int ret; │
│ 45 struct btrfs_device *device; │
│ 46 │
│ 47 list_for_each_entry(device, &fs_devices->devices, dev_list) { │
│ >48 if((ret = is_same_loop_file(device->name, file))) │
│ 49 return ret; │
│ 50 } │
│ 51 │
│ 52 return 0;
Unfortunately I tried to reproduce it with exactly v6.3.3 and failed to reproduce on a mounted LVM LV.
The same for all the newer progs.
Mind to print fs_devices->device
and device
?
The crash site is a little weird, unless fs_devices->devices
is uninitialized, we should get a proper device
pointer.
Even if device->name
is NULL, it should not crash here.
Ok, after inserting the print statement and recompile of open-utils.c
I can't reproduce the error either...