Package: btrfs-tools
Version: 0.19-8
Severity: important

btrfsck tries to free an invalid memory location on armel:

flatty:~# gdb $(which btrfsck)
GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 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 "arm-linux-gnueabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /sbin/btrfsck...Reading symbols from 
/usr/lib/debug/sbin/btrfsck...done.
(no debugging symbols found)...done.
(gdb) run /dev/mmcblk0p1
Starting program: /sbin/btrfsck /dev/mmcblk0p1
warning devid 2 not found already

Program received signal SIGBUS, Bus error.
*__GI___libc_free (mem=0xbf1bd446) at malloc.c:3709
3709      if (chunk_is_mmapped(p))                       /* release mmapped 
memory. */
(gdb) where
#0  *__GI___libc_free (mem=0xbf1bd446) at malloc.c:3709
#1  0x00017b10 in close_all_devices (root=<value optimized out>) at 
disk-io.c:943
#2  close_ctree (root=<value optimized out>) at disk-io.c:986
#3  0x0000f1e8 in main (ac=<value optimized out>, av=<value optimized out>) at 
btrfsck.c:2466

Please note that the SIGBUS (misaligned memory access) is a red herring - the 
memory location that's passed to free() is invalid. I don't know exactly where 
it got corrupted (open_ctree_fd() clears fs_info using memset, so it should be 
0), but it's already invalid upon return from open_ctree_fd():

Breakpoint 6, open_ctree (filename=0xbee2ddce "/dev/mmcblk0p1", 
sb_bytenr=<value optimized out>, writes=0)
    at disk-io.c:590
590             close(fp);
(gdb) p ((struct btrfs_device*)(root->fs_info->fs_devices->devices->next))->name
$39 = 0xbf1bd446 <Address 0xbf1bd446 out of bounds>

Core dump available on request.

AFAICT this is a Debian-specific issue - without 03-valgrind.patch, free() 
won't be called at all on device->name.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: armel (armv5tel)

Kernel: Linux 2.6.34-rc7-flatty-ocf-2-00126-g835446b
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages btrfs-tools depends on:
ii  e2fslibs                1.41.11-1        ext2/ext3/ext4 file system librari
ii  libc6                   2.10.2-6         Embedded GNU C Library: Shared lib
ii  libcomerr2              1.41.11-1        common error description library
ii  libgcc1                 1:4.4.2-9        GCC support library
ii  libuuid1                2.16.2-0         Universally Unique ID library
ii  zlib1g                  1:1.2.3.4.dfsg-3 compression library - runtime

btrfs-tools recommends no packages.

btrfs-tools suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to