All of lore.kernel.org
 help / color / mirror / Atom feed
* segmentation fault in btrfs tool v4.15
@ 2018-02-06  7:56 Ralph Gauges
  2018-02-06  8:04 ` Qu Wenruo
  0 siblings, 1 reply; 3+ messages in thread
From: Ralph Gauges @ 2018-02-06  7:56 UTC (permalink / raw)
  To: linux-btrfs

Hi,

I recently started using the btrfs file system on my backup disk and 
until a power failure during a backup everything seemed to work well.
Due a power failure however, the file systems seems to have become 
corrupted and all trials to check or repair it so far have lead to a 
segmentation fault.

Normally I am using Ubuntu 17.10 and the btrfs version that goes along 
with it, but for testing purposes, I compiled my own version 
(btrfs-progs v4.15).
Unfortunately the segmentation fault is also present in this latest 
version. At the end of this email, you can see the output from btrfs 
when I try to check the partition as well as the backtrace from gdb. I 
hope that helps.

My system is running kernel 4.13.0-32-generic on x86_64.

If you need any additional information please contace me directly since 
I don't subscribe to the mailing list.

Sincerily

Ralph Gauges






(gdb) set args check /dev/sdf1
(gdb) run
Starting program: /home/gauges/Applications/bin/btrfs check /dev/sdf1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
parent transid verify failed on 266195058688 wanted 1857 found 1864
parent transid verify failed on 266195058688 wanted 1857 found 1864
parent transid verify failed on 266195058688 wanted 1857 found 1864
parent transid verify failed on 266195058688 wanted 1857 found 1864
Ignoring transid failure
Checking filesystem on /dev/sdf1
UUID: 9ccb1eaa-a9ae-46f3-8885-fba4799d6e85
parent transid verify failed on 266196516864 wanted 1858 found 1864
parent transid verify failed on 266196516864 wanted 1858 found 1864
parent transid verify failed on 266196516864 wanted 1858 found 1864
parent transid verify failed on 266196516864 wanted 1858 found 1864
Ignoring transid failure
parent transid verify failed on 266196205568 wanted 1858 found 1864
parent transid verify failed on 266196205568 wanted 1858 found 1864
parent transid verify failed on 266196205568 wanted 1858 found 1864
parent transid verify failed on 266196205568 wanted 1858 found 1864
Ignoring transid failure

Program received signal SIGSEGV, Segmentation fault.
0x00005555555bf7a7 in btrfs_extent_flags (s=0xcc344065, 
eb=0x5555584acce0) at ctree.h:1694
1694    BTRFS_SETGET_FUNCS(extent_flags, struct btrfs_extent_item, 
flags, 64);
(gdb) bt
#0  0x00005555555bf7a7 in btrfs_extent_flags (s=0xcc344065, 
eb=0x5555584acce0) at ctree.h:1694
#1  build_roots_info_cache (info=0x555555821a00) at cmds-check.c:14285
#2  repair_root_items (info=0x555555821a00) at cmds-check.c:14450
#3  cmd_check (argc=<optimized out>, argv=<optimized out>) at 
cmds-check.c:14965
#4  0x0000555555566320 in main (argc=2, argv=0x7fffffffde30) at btrfs.c:302
(gdb)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: segmentation fault in btrfs tool v4.15
  2018-02-06  7:56 segmentation fault in btrfs tool v4.15 Ralph Gauges
@ 2018-02-06  8:04 ` Qu Wenruo
       [not found]   ` <15274509-75d4-af47-46ea-8ac048b58ba9@googlemail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Qu Wenruo @ 2018-02-06  8:04 UTC (permalink / raw)
  To: Ralph Gauges, linux-btrfs


[-- Attachment #1.1: Type: text/plain, Size: 3339 bytes --]



On 2018年02月06日 15:56, Ralph Gauges wrote:
> Hi,
> 
> I recently started using the btrfs file system on my backup disk and
> until a power failure during a backup everything seemed to work well.
> Due a power failure however, the file systems seems to have become
> corrupted and all trials to check or repair it so far have lead to a
> segmentation fault.
> 
> Normally I am using Ubuntu 17.10 and the btrfs version that goes along
> with it, but for testing purposes, I compiled my own version
> (btrfs-progs v4.15).
> Unfortunately the segmentation fault is also present in this latest
> version. At the end of this email, you can see the output from btrfs
> when I try to check the partition as well as the backtrace from gdb. I
> hope that helps.
> 
> My system is running kernel 4.13.0-32-generic on x86_64.
> 
> If you need any additional information please contace me directly since
> I don't subscribe to the mailing list.
> 
> Sincerily
> 
> Ralph Gauges
> 
> 
> 
> 
> 
> 
> (gdb) set args check /dev/sdf1
> (gdb) run
> Starting program: /home/gauges/Applications/bin/btrfs check /dev/sdf1
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
> parent transid verify failed on 266195058688 wanted 1857 found 1864
> parent transid verify failed on 266195058688 wanted 1857 found 1864
> parent transid verify failed on 266195058688 wanted 1857 found 1864
> parent transid verify failed on 266195058688 wanted 1857 found 1864
> Ignoring transid failure
> Checking filesystem on /dev/sdf1
> UUID: 9ccb1eaa-a9ae-46f3-8885-fba4799d6e85
> parent transid verify failed on 266196516864 wanted 1858 found 1864
> parent transid verify failed on 266196516864 wanted 1858 found 1864
> parent transid verify failed on 266196516864 wanted 1858 found 1864
> parent transid verify failed on 266196516864 wanted 1858 found 1864
> Ignoring transid failure
> parent transid verify failed on 266196205568 wanted 1858 found 1864
> parent transid verify failed on 266196205568 wanted 1858 found 1864
> parent transid verify failed on 266196205568 wanted 1858 found 1864
> parent transid verify failed on 266196205568 wanted 1858 found 1864
> Ignoring transid failure
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x00005555555bf7a7 in btrfs_extent_flags (s=0xcc344065,
> eb=0x5555584acce0) at ctree.h:1694
> 1694    BTRFS_SETGET_FUNCS(extent_flags, struct btrfs_extent_item,
> flags, 64);
> (gdb) bt
> #0  0x00005555555bf7a7 in btrfs_extent_flags (s=0xcc344065,
> eb=0x5555584acce0) at ctree.h:1694
> #1  build_roots_info_cache (info=0x555555821a00) at cmds-check.c:14285

Would you please show the value of eb->start?

And possible function call of btrfs_print_tree(info->extent_root, eb, 1)
and its result.

Thanks,
Qu

> #2  repair_root_items (info=0x555555821a00) at cmds-check.c:14450
> #3  cmd_check (argc=<optimized out>, argv=<optimized out>) at
> cmds-check.c:14965
> #4  0x0000555555566320 in main (argc=2, argv=0x7fffffffde30) at btrfs.c:302
> (gdb)
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 520 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: segmentation fault in btrfs tool v4.15
       [not found]                   ` <0e0755f1-b97e-1256-5a7f-231c2e851b1b@googlemail.com>
@ 2018-02-09  7:34                     ` Qu Wenruo
  0 siblings, 0 replies; 3+ messages in thread
From: Qu Wenruo @ 2018-02-09  7:34 UTC (permalink / raw)
  To: Ralph Gauges, linux-btrfs


[-- Attachment #1.1: Type: text/plain, Size: 1563 bytes --]



On 2018年02月09日 15:23, Ralph Gauges wrote:
> Hi Qu,
> 
> I applied the patch to the sources of v4.15 and ran it in gdb. This is
> the result.
> 
> (gdb) set args check /dev/sdf1
> (gdb) run
> Starting program: /home/gauges/Applications/bin/btrfs check /dev/sdf1
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
> parent transid verify failed on 266195058688 wanted 1857 found 1864
> parent transid verify failed on 266195058688 wanted 1857 found 1864
> parent transid verify failed on 266195058688 wanted 1857 found 1864
> parent transid verify failed on 266195058688 wanted 1857 found 1864
> Ignoring transid failure
> ERROR: child eb corrupted: parent bytenr=247283269632 item=23 parent
> level=1 child level=2
> ERROR: cannot open file system
> [Inferior 1 (process 7149) exited with code 01]
> 
> 
> So obviously it does not crash any more. Thanks.
> Since you are an expert on the btrfs filesystem, any hints as to how I
> could fix my backup
> partition?

Guys in mail list may have better ideas, CCed to mail list.

In fact the problem all happens in extent tree, may be we could salvage
something by RO mount it?

If kernel can't mount it even RO, then "btrfs restore" may be your last
chance.

Thanks,
Qu

> This output from btrfs seems to suggest that "btrfs check"
> can't handle this error?!
> Or this this last error something else that didn't show up so far
> because of the segfault?
> 
> Thanks
> 
> Ralph
> 
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 520 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-09  7:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-06  7:56 segmentation fault in btrfs tool v4.15 Ralph Gauges
2018-02-06  8:04 ` Qu Wenruo
     [not found]   ` <15274509-75d4-af47-46ea-8ac048b58ba9@googlemail.com>
     [not found]     ` <31d87507-982c-b735-9f3a-9fbad4d247e2@gmx.com>
     [not found]       ` <c525bb95-1a17-c01e-4c15-f89a6cc68c6e@googlemail.com>
     [not found]         ` <6bb438c5-811d-d7b8-f551-a1a08be321c5@gmx.com>
     [not found]           ` <b0b40b12-1130-ad31-6ff0-e0b674a71691@googlemail.com>
     [not found]             ` <0f66e50a-520d-f565-0d2d-2411d480da05@gmx.com>
     [not found]               ` <adbe7eae-268d-fffd-4bc4-e724e26ab584@googlemail.com>
     [not found]                 ` <bfb10542-2bd3-5926-f8ac-036eef890a29@gmx.com>
     [not found]                   ` <0e0755f1-b97e-1256-5a7f-231c2e851b1b@googlemail.com>
2018-02-09  7:34                     ` Qu Wenruo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.