Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 365291 - dev-libs/libusb-1.0.8: lsusb: double free or corruption (!prev)
Summary: dev-libs/libusb-1.0.8: lsusb: double free or corruption (!prev)
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-29 09:55 UTC by Andreis Vinogradovs ( slepnoga )
Modified: 2011-06-06 10:17 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
lsusb output with debug use flag (lsusb,7.10 KB, text/plain)
2011-04-29 10:04 UTC, Andreis Vinogradovs ( slepnoga )
Details
core file (core.gz,260.51 KB, application/x-gzip)
2011-04-29 10:09 UTC, Andreis Vinogradovs ( slepnoga )
Details
kernel error (dmesg,4.51 KB, text/plain)
2011-05-02 18:26 UTC, Andreis Vinogradovs ( slepnoga )
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreis Vinogradovs ( slepnoga ) 2011-04-29 09:55:32 UTC
dev-libs/libusb crashes if the kernel can not read the usb device descriptor

Reproducible: Always

Steps to Reproduce:
1.install dev-libs/libusb-1.0.8
2.run libusb
3.
Actual Results:  
backtrace:

*** glibc detected *** lsusb: double free or corruption (!prev): 0x00000000025f5010 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x72985)[0x7f338affc985]
/lib64/libc.so.6(cfree+0x6c)[0x7f338b0018bc]
lsusb[0x40a197]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x7f338afa8ebd]
lsusb[0x401aa9]
======= Memory map: ========
00400000-00419000 r-xp 00000000 09:01 1426688                            /usr/bin/lsusb
00618000-00619000 r--p 00018000 09:01 1426688                            /usr/bin/lsusb
00619000-0061a000 rw-p 00019000 09:01 1426688                            /usr/bin/lsusb
025f5000-026dc000 rw-p 00000000 00:00 0                                  [heap]
7f3384000000-7f3384021000 rw-p 00000000 00:00 0 
7f3384021000-7f3388000000 ---p 00000000 00:00 0 
7f338a94e000-7f338a963000 r-xp 00000000 09:01 369354                     /lib64/libgcc_s.so.1
7f338a963000-7f338ab62000 ---p 00015000 09:01 369354                     /lib64/libgcc_s.so.1
7f338ab62000-7f338ab63000 r--p 00014000 09:01 369354                     /lib64/libgcc_s.so.1
7f338ab63000-7f338ab64000 rw-p 00015000 09:01 369354                     /lib64/libgcc_s.so.1
7f338ab64000-7f338ab7c000 r-xp 00000000 09:01 16332598                   /lib64/libpthread-2.13.so
7f338ab7c000-7f338ad7b000 ---p 00018000 09:01 16332598                   /lib64/libpthread-2.13.so
7f338ad7b000-7f338ad7c000 r--p 00017000 09:01 16332598                   /lib64/libpthread-2.13.so
7f338ad7c000-7f338ad7d000 rw-p 00018000 09:01 16332598                   /lib64/libpthread-2.13.so
7f338ad7d000-7f338ad81000 rw-p 00000000 00:00 0 
7f338ad81000-7f338ad89000 r-xp 00000000 09:01 16332074                   /lib64/librt-2.13.so
7f338ad89000-7f338af88000 ---p 00008000 09:01 16332074                   /lib64/librt-2.13.so
7f338af88000-7f338af89000 r--p 00007000 09:01 16332074                   /lib64/librt-2.13.so
7f338af89000-7f338af8a000 rw-p 00008000 09:01 16332074                   /lib64/librt-2.13.so
7f338af8a000-7f338b10c000 r-xp 00000000 09:01 16332656                   /lib64/libc-2.13.so
7f338b10c000-7f338b30b000 ---p 00182000 09:01 16332656                   /lib64/libc-2.13.so
7f338b30b000-7f338b30f000 r--p 00181000 09:01 16332656                   /lib64/libc-2.13.so
7f338b30f000-7f338b310000 rw-p 00185000 09:01 16332656                   /lib64/libc-2.13.so
7f338b310000-7f338b315000 rw-p 00000000 00:00 0 
7f338b315000-7f338b322000 r-xp 00000000 09:01 25368870                   /usr/lib64/libusb-1.0.so.0.0.0
7f338b322000-7f338b521000 ---p 0000d000 09:01 25368870                   /usr/lib64/libusb-1.0.so.0.0.0
7f338b521000-7f338b522000 r--p 0000c000 09:01 25368870                   /usr/lib64/libusb-1.0.so.0.0.0
7f338b522000-7f338b523000 rw-p 0000d000 09:01 25368870                   /usr/lib64/libusb-1.0.so.0.0.0
7f338b523000-7f338b542000 r-xp 00000000 09:01 16332655                   /lib64/ld-2.13.so
7f338b736000-7f338b73a000 rw-p 00000000 00:00 0 
7f338b741000-7f338b742000 rw-p 00000000 00:00 0 
7f338b742000-7f338b743000 r--p 0001f000 09:01 16332655                   /lib64/ld-2.13.so
7f338b743000-7f338b744000 rw-p 00020000 09:01 16332655                   /lib64/ld-2.13.so
7f338b744000-7f338b745000 rw-p 00000000 00:00 0 
7fff6eef0000-7fff6ef05000 rw-p 00000000 00:00 0                          [stack]
7fff6efff000-7fff6f000000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Comment 1 Andreis Vinogradovs ( slepnoga ) 2011-04-29 09:57:27 UTC
tail -10 /var/log/kern.log
Apr 29 12:09:53 ashgabad kernel: usb 7-5: new high speed USB device using ehci_hcd and address 6
Apr 29 12:09:58 ashgabad kernel: usb 7-5: unable to read config index 0 descriptor/start: -110
Apr 29 12:09:58 ashgabad kernel: usb 7-5: chopping to 0 config(s)
Apr 29 12:10:08 ashgabad kernel: usb 7-5: string descriptor 0 read error: -110
Apr 29 12:10:08 ashgabad kernel: usb 7-5: no configuration chosen from 0 choices
Comment 2 Andreis Vinogradovs ( slepnoga ) 2011-04-29 09:57:47 UTC
emerge --info
Portage 2.2.0_alpha30 (default/linux/amd64/10.0, gcc-4.5.2, libc-0-r0, 2.6.32-openvz-feoktistov.1-ovz-prod-kvm-ups x86_64)
=================================================================
System uname: Linux-2.6.32-openvz-feoktistov.1-ovz-prod-kvm-ups-x86_64-Intel-R-_Core-TM-_i3_CPU_540_@_3.07GHz-with-gentoo-2.0.2
Timestamp of tree: Thu, 28 Apr 2011 23:45:01 +0000
app-shells/bash:     4.2_p8
dev-lang/python:     2.7.1-r1, 3.1.3-r1
dev-util/cmake:      2.8.4-r1
sys-apps/baselayout: 2.0.2
sys-apps/openrc:     0.8.2-r1
sys-apps/sandbox:    2.5
sys-devel/autoconf:  2.68
sys-devel/automake:  1.9.6-r3, 1.11.1-r1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.5.2
sys-devel/gcc-config: 1.4.1-r1
sys-devel/libtool:   2.4-r1
sys-devel/make:      3.82
sys-kernel/linux-headers: 2.6.38
virtual/os-headers:  0
Repositories: gentoo rion
Installed sets: 
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -mtune=native -msse4.2 -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -mtune=native -msse4.2 -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs buildpkg distlocks fixlafiles fixpackages metadata-transfer news nostrip parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.tups.lv/source"
LANG="ru_RU.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="ru"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS="lzma"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/rion"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="acl amd64 bash-completion berkdb bzip2 caps cli cracklib crypt cups cxx device-mapper dri fortran fuse gdbm gpm hpn iconv idn ipv6 ithreads lvm lxc macvtap mercurial mmx modules mudflap multilib ncurses nfs nls nptl nptlonly openvz pam parted pcap pcre perl pppd python qemu readline sasl session sqlite sse sse2 sse3 ssl sysfs tcpd threads udev unicode usb vim-syntax virt-network xattr xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog apache bind disk libvirt mysql network nginx notify_email ntpd perl processes sensors uptime users" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Andreis Vinogradovs ( slepnoga ) 2011-04-29 10:04:52 UTC
Created attachment 271545 [details]
lsusb output with debug use flag
Comment 4 Andreis Vinogradovs ( slepnoga ) 2011-04-29 10:09:00 UTC
Created attachment 271547 [details]
core file
Comment 5 Andreis Vinogradovs ( slepnoga ) 2011-04-29 10:11:52 UTC
backtrace:

LC_ALL=C gdb /usr/bin/lsusb --core /tmp/core.3678-1304071879 
GNU gdb (Gentoo 7.2 p1) 7.2
Copyright (C) 2010 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".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /usr/bin/lsusb...done.
[New Thread 3678]

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /usr/lib64/libusb-1.0.so.0...done.
Loaded symbols for /usr/lib64/libusb-1.0.so.0
Reading symbols from /lib64/libc.so.6...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/librt.so.1...done.
Loaded symbols for /lib64/librt.so.1
Reading symbols from /lib64/libpthread.so.0...done.
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib64/libgcc_s.so.1...done.
Loaded symbols for /lib64/libgcc_s.so.1
Core was generated by `lsusb'.
Program terminated with signal 6, Aborted.
#0  0x00007f51604c28a5 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
        in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) bt
#0  0x00007f51604c28a5 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007f51604c3ba5 in abort () at abort.c:92
#2  0x00007f51604fd502 in __libc_message (do_abort=2, fmt=0x7f51605db008 "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:186
#3  0x00007f5160502985 in malloc_printerr (action=3, str=0x7f51605db3a8 "double free or corruption (!prev)", ptr=<value optimized out>) at malloc.c:6283
#4  0x00007f51605078bc in __libc_free (mem=<value optimized out>) at malloc.c:3738
#5  0x000000000040a197 in main (argc=1, argv=<value optimized out>) at lsusb.c:4059
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-05-02 01:26:35 UTC
dsd:
this one is for you.

slepnoga:
what USB device was this? I can't reproduce on any of my USB hardware.
Comment 7 Andreis Vinogradovs ( slepnoga ) 2011-05-02 18:26:24 UTC
Created attachment 271897 [details]
kernel error

My apologies for my haste. I checked the kernel logs and found
 problems in the module ext2, who worked through the usb drive.
 Directly to the problem is incorrectly input to lsub,
 even though I was hoping that verify the input data - ABC programming:)
if you feel it necessary to close the bug, do it.