Re: Bug#814028: btrfs-tools: btrfs filesystem usage - BUS error

2016-02-07 Thread John Paul Adrian Glaubitz
Hi Anatoly!

On 02/07/2016 06:42 PM, Anatoly Pugachev wrote:
> Package: btrfs-tools
> Version: 4.4-1
> Severity: normal

Thanks for looking at this!

Would you mind reporting this bug upstream as well?

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#814028: btrfs-tools: btrfs filesystem usage - BUS error

2016-02-07 Thread Anatoly Pugachev
Package: btrfs-tools
Version: 4.4-1
Severity: normal
Tags: sparc64
X-Debbugs-Cc: debian-sparc@lists.debian.org

Dear Maintainer,

/mnt is being mounted as btrfs:

mator@deb4g:/srv/1/linux-2.6$ findmnt /mnt
TARGET SOURCE   FSTYPE OPTIONS
/mnt   /dev/vdiskd1 btrfs  rw,relatime,space_cache,subvolid=5,subvol=/

command "btrfs fi usage /mnt" run as unprivileged user works as expected,
but with elevated privileges, it crashes with BUS error:

mator@deb4g:/srv/1/linux-2.6$ sudo btrfs fi usage /mnt
Bus error

since I'm on unstable/sid, getting btrfs-progs from git and trying to reproduce:

mator@deb4g:/srv/1$ git clone https://github.com/kdave/btrfs-progs.git
mator@deb4g:/srv/1$ cd btrfs-progs && ./autogen.sh && CFLAGS="-g" ./configure 
&& make -j
mator@deb4g:/srv/1/btrfs-progs$ ./btrfs --version
btrfs-progs v4.4
mator@deb4g:/srv/1/btrfs-progs$ ./btrfs fi usage /mnt
WARNING: cannot read detailed chunk info, RAID5/6 numbers will be incorrect, 
run as root
Overall:
Device size:   3.00GiB
Device allocated:331.00MiB
Device unallocated:2.67GiB
Device missing:3.00GiB
Used:384.00KiB
Free (estimated):  2.68GiB  (min: 1.34GiB)
Data ratio:   1.00
Metadata ratio:   2.00
Global reserve:   16.00MiB  (used: 0.00B)
mator@deb4g:/srv/1/btrfs-progs$ sudo ./btrfs fi usage /mnt
Bus error   
mator@deb4g:/srv/1/btrfs-progs$ sudo -s
root@deb4g:/srv/1/btrfs-progs# ulimit -c unlimited
root@deb4g:/srv/1/btrfs-progs# ./btrfs fi usage /mnt
Bus error (core dumped)
root@deb4g:/srv/1/btrfs-progs# gdb -c core
Core was generated by `./btrfs fi usage /mnt'.
Program terminated with signal SIGUSR1, User defined signal 1.
#0  0x00174730 in ?? ()
(gdb) bt
#0  0x00174730 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)   
(gdb) set args fi usage /mnt  
(gdb) file ./btrfs
Load new symbol table from "./btrfs"? (y or n) y
Reading symbols from ./btrfs...done.
(gdb) run
Starting program: /srv/1/btrfs-progs/btrfs fi usage /mnt
BFD: /usr/lib/debug/.build-id/10/2220230fb152bed171674ffb66092972cf0276.debug: 
unable to initialize decompress status for section .debug_aranges
BFD: /usr/lib/debug/.build-id/10/2220230fb152bed171674ffb66092972cf0276.debug: 
unable to initialize decompress status for section .debug_aranges
warning: File 
"/usr/lib/debug/.build-id/10/2220230fb152bed171674ffb66092972cf0276.debug" has 
no build-id, file skipped
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/sparc64-linux-gnu/libthread_db.so.1".
BFD: /usr/lib/debug/.build-id/27/97a1230a6c622a2d0362aace029b5fda6c3474.debug: 
unable to initialize decompress status for section .debug_aranges
BFD: /usr/lib/debug/.build-id/27/97a1230a6c622a2d0362aace029b5fda6c3474.debug: 
unable to initialize decompress status for section .debug_aranges
warning: File 
"/usr/lib/debug/.build-id/27/97a1230a6c622a2d0362aace029b5fda6c3474.debug" has 
no build-id, file skipped

Program received signal SIGBUS, Bus error.
0x00174730 in load_chunk_info (fd=3, info_ptr=0x7fef0f0, 
info_count=0x7fef0e4) at cmds-fi-usage.c:188
188 off += sh->len;
(gdb) bt
#0  0x00174730 in load_chunk_info (fd=3, info_ptr=0x7fef0f0, 
info_count=0x7fef0e4) at cmds-fi-usage.c:188
#1  0x00175dac in load_chunk_and_device_info (fd=3, 
chunkinfo=0x7fef0f0, chunkcount=0x7fef0e4, devinfo=0x7fef0e8, 
devcount=0x7fef0e0) at cmds-fi-usage.c:577
#2  0x00177418 in cmd_filesystem_usage (argc=2, argv=0x7fef6f8) at 
cmds-fi-usage.c:961
#3  0x0010996c in handle_command_group (grp=0x324560 
, argc=2, argv=0x7fef6f8) at btrfs.c:135
#4  0x0011197c in cmd_filesystem (argc=3, argv=0x7fef6f0) at 
cmds-filesystem.c:1294
#5  0x00109d54 in main (argc=3, argv=0x7fef6f0) at btrfs.c:243
(gdb) 


-- System Information:
Debian Release: stretch/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'experimental'), (500, 'unstable')
Architecture: sparc64

Kernel: Linux 4.4.0-trunk-sparc64-smp (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages btrfs-tools depends on:
ii  e2fslibs1.43~WIP-2015-05-18-1
ii  libblkid1   2.27.1-3
ii  libc6   2.21-7
ii  libcomerr2  1.42.13-1
ii  liblzo2-2   2.08-1.2
ii  libuuid12.27.1-3
ii  zlib1g  1:1.2.8.dfsg-2+b1

btrfs-tools recommends no packages.

btrfs-tools suggests no packages.

-- no debconf information



Re: Bug#814028: btrfs-tools: btrfs filesystem usage - BUS error

2016-02-07 Thread Anatoly Pugachev
On Sun, Feb 7, 2016 at 8:50 PM, John Paul Adrian Glaubitz <
glaub...@physik.fu-berlin.de> wrote:

> Hi Anatoly!
>
> On 02/07/2016 06:42 PM, Anatoly Pugachev wrote:
> > Package: btrfs-tools
> > Version: 4.4-1
> > Severity: normal
>
> Thanks for looking at this!
>
> Would you mind reporting this bug upstream as well?
>
>
done, https://bugzilla.kernel.org/show_bug.cgi?id=112131