Bug 87807 - Infocenter crashes when viewing usb devices and memorystick is removed
Summary: Infocenter crashes when viewing usb devices and memorystick is removed
Status: RESOLVED FIXED
Alias: None
Product: kcontrol
Classification: Unmaintained
Component: kcminfo (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Helge Deller
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-23 01:44 UTC by Frej Leilund
Modified: 2004-09-05 23:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
kcmusb screenshot (29.60 KB, image/png)
2004-08-29 23:16 UTC, Frej Leilund
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frej Leilund 2004-08-23 01:44:34 UTC
Version:            (using KDE KDE 3.3.0)
Installed from:    Gentoo Packages
Compiler:          gcc version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6) 
OS:                Linux

Description: Infocenter crashes when an usb memorystick is removed and infocenter is displaying usb devices. 

How to reproduce: View usb devices, then unplug the memorystick -> crash.

Expected behaviour: Update the list of connected devices.
Comment 1 Helge Deller 2004-08-29 15:19:21 UTC
Hey Frej,

could you try to reproduce this bug and send me the crashdump ?

Thanks,
Helge
Comment 2 Frej Leilund 2004-08-29 23:15:58 UTC
Hi, 
I'm not familiar with the KDE debugging process, so I'm assuming that by crashdump you're referring to the backtrace offered when an application crashes. Anyway here it is

Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 32609)]
0x4131d5d8 in waitpid () from /lib/libpthread.so.0
#0  0x4131d5d8 in waitpid () from /lib/libpthread.so.0
#1  0x408b6528 in ?? () from /usr/kde/3.3/lib/libkdecore.so.4
#2  0x407cfbaf in KCrash::defaultCrashHandler ()
   from /usr/kde/3.3/lib/libkdecore.so.4
#3  0x00000003 in ?? ()
#4  0x00000019 in ?? ()
#5  0x408bc880 in kde_malloc_is_used () from /usr/kde/3.3/lib/libkdecore.so.4
#6  0x408b6528 in ?? () from /usr/kde/3.3/lib/libkdecore.so.4
#7  0x00000014 in ?? ()
#8  0x00000001 in ?? ()
#9  0x00000000 in ?? ()
#10 0x40865db4 in malloc () from /usr/kde/3.3/lib/libkdecore.so.4
#11 0x00007ff5 in ?? ()
#12 0x00000400 in ?? ()
#13 0x00000400 in ?? ()
#14 0x00000001 in ?? ()
#15 0x0820b198 in ?? ()
#16 0x00000000 in ?? ()
#17 0x414457d4 in ?? ()
   from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.so.5
#18 0x00000004 in ?? ()
#19 0x0820b198 in ?? ()
#20 0xbfffe5d8 in ?? ()
#21 0x41422d03 in operator new ()
   from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.so.5

Another thing, plugging & unplugging my usb printer doesn't crash the usb view, so perhaps it's simply because of deleting items in the treeview in the wrong order, ie. deleting the "embedded hub" item before the "storage device" item (see attached screenshot).

I hope this helps.
Comment 3 Frej Leilund 2004-08-29 23:16:38 UTC
Created attachment 7351 [details]
kcmusb screenshot
Comment 4 Helge Deller 2004-08-30 23:21:52 UTC
Hi Frej,

the crashdump you gave is already a good start. Sadly your binaries have no debugging information and no symbol tables, that's the reason you see so many ??? in this dump.

To really fix this bug I need a full crashdump including the symbols. If you could recompile this module (kcmusbview, or all of kdebase) and get a new crashdump with all information included it should be easy to fix this bug.
Without it it's not possible for me since I can't reproduce it. 

Your idea with the deleting of items in the wrong order is not possible, since the whole list is fully regenerated every time.

Thanks,
Helge
Comment 5 Frej Leilund 2004-08-31 21:47:23 UTC
Hi,

sorry for the delay I had to rebuild both kdelibs & kdebase with debugging enabled in order to get a different backtrace than the one I submitted earlier, anyway here goes:

Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 14964)]
[KCrash handler]
#5  0x00000031 in ?? ()
#6  0x41784551 in USBViewer::refresh (this=0x812ea70) at kcmusb.cpp:156
#7  0x41782fc3 in USBViewer::qt_invoke (this=0x812ea70, _id=47, _o=0xbfffed50)
    at kcmusb.moc:88
#8  0x40cc7d6c in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#9  0x40cc7b94 in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#10 0x41008bdb in QTimer::timeout () from /usr/qt/3/lib/libqt-mt.so.3
#11 0x40ce9542 in QTimer::event () from /usr/qt/3/lib/libqt-mt.so.3
#12 0x40c6b92f in QApplication::internalNotify ()
   from /usr/qt/3/lib/libqt-mt.so.3
#13 0x40c6ac95 in QApplication::notify () from /usr/qt/3/lib/libqt-mt.so.3
#14 0x407ec047 in KApplication::notify (this=0xbffff480, receiver=0x81987c0, 
    event=0xbffff130) at kapplication.cpp:495
#15 0x40c5af95 in QEventLoop::activateTimers ()
   from /usr/qt/3/lib/libqt-mt.so.3
#16 0x40c1584b in QEventLoop::processEvents () from /usr/qt/3/lib/libqt-mt.so.3
#17 0x40c7daf8 in QEventLoop::enterLoop () from /usr/qt/3/lib/libqt-mt.so.3
#18 0x40c6bbe1 in QApplication::enter_loop () from /usr/qt/3/lib/libqt-mt.so.3
#19 0x40e50f40 in QDialog::exec () from /usr/qt/3/lib/libqt-mt.so.3
#20 0x4002ebac in kdemain (_argc=2, _argv=0xbffff624) at kcmshell.cpp:249
#21 0x08048726 in main (argc=2, argv=0xbffff624) at kcmshell.la.cpp:2

Comment 6 Helge Deller 2004-09-04 00:04:09 UTC
Hei Frej,

you were right and I was wrong. 
The bug is triggered in kcmusb.cpp:156, because the parent is deleted before the child QListViewItem is deleted.
And: Of course the list is not completely regenerated, but instead the old items are deleted from the existing list.

I even can reproduce the bug with my USB HUB, but don't know yet how to fix it.
Helge

Comment 7 Helge Deller 2004-09-04 00:13:10 UTC
Leo: Mind to look into this ? It's basically your code addition which makes troubles.... THX, Helge
Comment 8 Helge Deller 2004-09-05 14:48:00 UTC
CVS commit by deller: 

fix USB kinfocenter crash (#87807), various cleanups
CCMAIL: 87807-done@bugs.kde.org


  M +38 -22    kcmusb.cpp   1.20
  M +10 -10    usbdevices.cpp   1.10



Comment 9 Helge Deller 2004-09-05 23:24:14 UTC
CVS commit by deller: 

BACKPORT: fix for USB kinfocenter crash (#87807), 
update usb.ids
CCMAIL: 87807@bugs.kde.org


  M +38 -22    kcmusb.cpp   1.19.2.1
  M +11 -5     usb.ids   1.5.2.1
  M +10 -10    usbdevices.cpp   1.9.2.1