Bug 1060204 - [abrt] btrfs-progs: btrfs_super_csum_size(): btrfs-show-super killed by SIGABRT
Summary: [abrt] btrfs-progs: btrfs_super_csum_size(): btrfs-show-super killed by SIGABRT
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: btrfs-progs
Version: 20
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Eric Sandeen
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:e6e6cb20615968ddf002365f0d1...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-31 13:01 UTC by Garry T. Williams
Modified: 2014-06-17 02:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-17 02:27:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (8.17 KB, text/plain)
2014-01-31 13:02 UTC, Garry T. Williams
no flags Details
File: cgroup (172 bytes, text/plain)
2014-01-31 13:02 UTC, Garry T. Williams
no flags Details
File: core_backtrace (2.31 KB, text/plain)
2014-01-31 13:02 UTC, Garry T. Williams
no flags Details
File: dso_list (643 bytes, text/plain)
2014-01-31 13:02 UTC, Garry T. Williams
no flags Details
File: environ (2.04 KB, text/plain)
2014-01-31 13:02 UTC, Garry T. Williams
no flags Details
File: limits (1.29 KB, text/plain)
2014-01-31 13:02 UTC, Garry T. Williams
no flags Details
File: maps (3.68 KB, text/plain)
2014-01-31 13:02 UTC, Garry T. Williams
no flags Details
File: open_fds (139 bytes, text/plain)
2014-01-31 13:02 UTC, Garry T. Williams
no flags Details
File: proc_pid_status (909 bytes, text/plain)
2014-01-31 13:02 UTC, Garry T. Williams
no flags Details
File: var_log_messages (844 bytes, text/plain)
2014-01-31 13:02 UTC, Garry T. Williams
no flags Details

Description Garry T. Williams 2014-01-31 13:01:56 UTC
Description of problem:
btrfs-show-super -a /dev/<not-btrfs>

Version-Release number of selected component:
btrfs-progs-3.12-1.fc20

Additional info:
reporter:       libreport-2.1.11
backtrace_rating: 4
cmdline:        btrfs-show-super -a /dev/sda1
crash_function: btrfs_super_csum_size
executable:     /usr/sbin/btrfs-show-super
kernel:         3.12.8-300.fc20.x86_64
runlevel:       N 5
type:           CCpp
uid:            0

Truncated backtrace:
Thread no. 1 (3 frames)
 #4 btrfs_super_csum_size at ctree.h:1969
 #6 dump_superblock at btrfs-show-super.c:172
 #7 load_and_dump_sb at btrfs-show-super.c:149

Comment 1 Garry T. Williams 2014-01-31 13:02:01 UTC
Created attachment 857830 [details]
File: backtrace

Comment 2 Garry T. Williams 2014-01-31 13:02:05 UTC
Created attachment 857831 [details]
File: cgroup

Comment 3 Garry T. Williams 2014-01-31 13:02:06 UTC
Created attachment 857832 [details]
File: core_backtrace

Comment 4 Garry T. Williams 2014-01-31 13:02:08 UTC
Created attachment 857833 [details]
File: dso_list

Comment 5 Garry T. Williams 2014-01-31 13:02:10 UTC
Created attachment 857834 [details]
File: environ

Comment 6 Garry T. Williams 2014-01-31 13:02:12 UTC
Created attachment 857836 [details]
File: limits

Comment 7 Garry T. Williams 2014-01-31 13:02:14 UTC
Created attachment 857837 [details]
File: maps

Comment 8 Garry T. Williams 2014-01-31 13:02:16 UTC
Created attachment 857838 [details]
File: open_fds

Comment 9 Garry T. Williams 2014-01-31 13:02:26 UTC
Created attachment 857839 [details]
File: proc_pid_status

Comment 10 Garry T. Williams 2014-01-31 13:02:31 UTC
Created attachment 857840 [details]
File: var_log_messages

Comment 11 Eric Sandeen 2014-05-13 16:39:07 UTC
btrfs-progs-3.14.1 has been pushed to Fedora 19 and 20 for testing.

I frankly have no idea if this will resolve your bug or not, but if you test it and find that it does, please take the opportunity to close this bug.  :)

Thanks,
-Eric

Comment 12 Eric Sandeen 2014-05-14 01:39:32 UTC
superblock: bytenr=274877906944, device=/dev/sdc2
---------------------------------------------------------
btrfs-show-super: ctree.h:1984: btrfs_super_csum_size: Assertion `!(t >= (sizeof(btrfs_csum_sizes) / sizeof((btrfs_csum_sizes)[0])))' failed.
csum			0xAborted

Comment 13 Eric Sandeen 2014-05-14 02:03:53 UTC
sent a patch to the list to not print superblocks w/ bad magic, it should avoid most of the non-existent error handling ASSERT problems down this path.

Comment 14 Eric Sandeen 2014-06-17 02:27:10 UTC
This is now in the integration branch at
http://repo.or.cz/w/btrfs-progs-unstable/devel.git/commit/9deac281a66cd3907dc86529a98467c4c46705ac

btrfs-show-super: don't try to print not-superblocks

If we point btrfs-show-super at a not-btrfs-device and
try to print all superblocks, bad things are apt to happen:

superblock: bytenr=274877906944, device=/dev/sdc2
---------------------------------------------------------
btrfs-show-super: ctree.h:1984: btrfs_super_csum_size: \
Assertion `!(t >= (sizeof(btrfs_csum_sizes) / sizeof((btrfs_csum_sizes)[0])))' failed.
csum 0xAborted

Don't try to print superblocks that don't look like superblocks,
and add an "-f" (force) option to try anyway, if the user
really wants to give it a shot.

Fix some spelling & capitalization while we're at it.

The manpage says that if any problem happens, 1 will
be returned, but that's already not true today LOL, so
I didn't bother to make it true when we detect bad
sb magic, either...

I figure it's worth continuing and trying all superblocks
in case just one has a corrupt magic.

Signed-off-by: Eric Sandeen <sandeen>
[renamed -f to -F due to clash with existing option, converted
relevant docs to asciidoc]
Signed-off-by: David Sterba <dsterba>

so I'll close this as UPSTREAM; if you really need it in a Fedora release before the next btrfs-progs rebase let me know, and I can spin up a build.


Note You need to log in before you can comment on or make changes to this bug.