Skip to content

Instantly share code, notes, and snippets.

@rhenium
Created August 21, 2016 07:09
Show Gist options
  • Save rhenium/f6f1bf30a7c7c946ed0f23342b511b45 to your computer and use it in GitHub Desktop.
Save rhenium/f6f1bf30a7c7c946ed0f23342b511b45 to your computer and use it in GitHub Desktop.
root@archiso ~/btrfs-progs/target/bin (git)-[master] # gdb --args ./btrfs-debug-tree -b 154647527424 /dev/sdc
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 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-pc-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 ./btrfs-debug-tree...done.
(gdb) r
Starting program: /root/btrfs-progs/target/bin/btrfs-debug-tree -b 154647527424 /dev/sdc
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
btrfs-progs v4.7
incorrect offsets 14192 2147497840
leaf 154647527424 items 194 free space 1151 generation 1009790 owner 2
fs uuid abd424fd-6fbb-4ec8-bd78-a6fe45d4e473
chunk uuid 6644f061-70df-4b56-b122-e8fc378445aa
item 0 key (69823897600 EXTENT_ITEM 4096) itemoff 16230 itemsize 53
extent refs 1 gen 429630 flags DATA
extent data backref root 311 objectid 41891 offset 75735040 count 1
item 1 key (69823901696 EXTENT_ITEM 4096) itemoff 16177 itemsize 53
extent refs 1 gen 429630 flags DATA
extent data backref root 311 objectid 41891 offset 75866112 count 1
item 2 key (69823905792 EXTENT_ITEM 4096) itemoff 16124 itemsize 53
extent refs 1 gen 429630 flags DATA
extent data backref root 311 objectid 41891 offset 77099008 count 1
item 3 key (69823909888 EXTENT_ITEM 4096) itemoff 16071 itemsize 53
extent refs 1 gen 429630 flags DATA
extent data backref root 311 objectid 41891 offset 77230080 count 1
item 4 key (69823913984 EXTENT_ITEM 4096) itemoff 16018 itemsize 53
extent refs 1 gen 429630 flags DATA
extent data backref root 311 objectid 41891 offset 78467072 count 1
item 5 key (69823918080 EXTENT_ITEM 4096) itemoff 15965 itemsize 53
extent refs 1 gen 429630 flags DATA
extent data backref root 311 objectid 41891 offset 78598144 count 1
item 6 key (69823922176 EXTENT_ITEM 4096) itemoff 15912 itemsize 53
extent refs 1 gen 429630 flags DATA
extent data backref root 311 objectid 41891 offset 79831040 count 1
item 7 key (69823926272 EXTENT_ITEM 4096) itemoff 15859 itemsize 53
extent refs 1 gen 429630 flags DATA
extent data backref root 311 objectid 41891 offset 79962112 count 1
item 8 key (69823930368 EXTENT_ITEM 262144) itemoff 15806 itemsize 53
extent refs 1 gen 454160 flags DATA
extent data backref root 394 objectid 463996 offset 262144 count 1
item 9 key (69824192512 EXTENT_ITEM 4096) itemoff 15753 itemsize 53
extent refs 1 gen 429630 flags DATA
extent data backref root 311 objectid 41891 offset 81195008 count 1
item 10 key (69824196608 EXTENT_ITEM 4096) itemoff 15700 itemsize 53
extent refs 1 gen 429630 flags DATA
extent data backref root 311 objectid 41891 offset 81326080 count 1
item 11 key (69824200704 EXTENT_ITEM 4096) itemoff 15647 itemsize 53
extent refs 1 gen 429630 flags DATA
extent data backref root 311 objectid 41891 offset 82558976 count 1
item 12 key (69824204800 EXTENT_ITEM 16384) itemoff -2147468054 itemsize 53
Program received signal SIGSEGV, Segmentation fault.
0x0000000000421926 in btrfs_extent_flags (eb=0x6fbb90, s=0x80003d4f) at ctree.h:1549
1549 BTRFS_SETGET_FUNCS(extent_flags, struct btrfs_extent_item, flags, 64);
(gdb) l
1544 /* struct btrfs_extent_item */
1545 BTRFS_SETGET_FUNCS(extent_refs, struct btrfs_extent_item, refs, 64);
1546 BTRFS_SETGET_STACK_FUNCS(stack_extent_refs, struct btrfs_extent_item, refs, 64);
1547 BTRFS_SETGET_FUNCS(extent_generation, struct btrfs_extent_item,
1548 generation, 64);
1549 BTRFS_SETGET_FUNCS(extent_flags, struct btrfs_extent_item, flags, 64);
1550 BTRFS_SETGET_STACK_FUNCS(stack_extent_flags, struct btrfs_extent_item, flags, 64);
1551
1552 BTRFS_SETGET_FUNCS(extent_refs_v0, struct btrfs_extent_item_v0, refs, 32);
1553
(gdb) bt
#0 0x0000000000421926 in btrfs_extent_flags (eb=0x6fbb90, s=0x80003d4f) at ctree.h:1549
#1 0x0000000000423a39 in print_extent_item (eb=0x6fbb90, slot=12, metadata=0) at print-tree.c:394
#2 0x0000000000425260 in btrfs_print_leaf (root=0x6f90c0, l=0x6fbb90) at print-tree.c:936
#3 0x0000000000425b42 in btrfs_print_tree (root=0x6f90c0, eb=0x6fbb90, follow=0) at print-tree.c:1110
#4 0x0000000000452380 in cmd_inspect_dump_tree (argc=4, argv=0x7fffffffe488) at cmds-inspect-dump-tree.c:320
#5 0x0000000000451421 in main (argc=4, argv=0x7fffffffe488) at btrfs-debug-tree.c:36
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment