Bug 236240

Summary: Kopete crashes when opening video settings while webcam is used by another application
Product: [Unmaintained] kopete Reporter: yyyy12
Component: Audio/Video PluginAssignee: Kopete Developers <kopete-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: crash CC: fschaefer.oss
Priority: NOR    
Version: 1.0.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description yyyy12 2010-05-03 22:46:47 UTC
Application: kopete (1.0.0)
KDE Platform Version: 4.4.2 (KDE 4.4.2)
Qt Version: 4.6.2
Operating System: Linux 2.6.33-ARCH x86_64

-- Information about the crash:
The backtrace doesn't actually say Kopete, but this is how I can reproduce that crash:
1. Access webcam (in my case I opened /dev/video2 (Video for Linux 2) in vlc)
2. Start Kopete (has to be stopped before step 1)
3. Settings -> Configure
4. Immediately go to "Video"
-> Crash

If I wait a couple of seconds before step 4, Kopete doesn't crash, but freezes and shows graphical glitches (screen get's partialy black).

The crash can be reproduced every time.

 -- Backtrace:
Application: Kopete (kopete), signal: Segmentation fault
[KCrash Handler]
#5  0x00007fa83bef4649 in QX11PaintEngine::drawPixmap (this=<value optimized out>, r=<value optimized out>, px=<value optimized out>, _sr=<value optimized out>) at painting/qpaintengine_x11.cpp:1919
#6  0x00007fa83be3a0d6 in QPaintEngine::drawImage (this=0x10758f0, r=..., image=..., sr=<value optimized out>, flags=<value optimized out>) at painting/qpaintengine.cpp:624
#7  0x00007fa83bef5ee2 in QX11PaintEngine::drawImage (this=0x10758f0, r=..., image=..., sr=..., flags=) at painting/qpaintengine_x11.cpp:1893
#8  0x00007fa83be4f2bf in QPainterPrivate::draw_helper (this=0x103e920, originalPath=<value optimized out>, op=<value optimized out>) at painting/qpainter.cpp:484
#9  0x00007fa83be50215 in QPainter::drawLines (this=<value optimized out>, lines=<value optimized out>, lineCount=1) at painting/qpainter.cpp:4683
#10 0x00007fa8319a4da1 in ?? () from /usr/lib/kde4/plugins/styles/oxygen.so
#11 0x00007fa8319eb344 in ?? () from /usr/lib/kde4/plugins/styles/oxygen.so
#12 0x00007fa83cbb0177 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<value optimized out>, receiver=0xfbbee0, event=0x7fff425d3030) at kernel/qcoreapplication.cpp:819
#13 0x00007fa83bcf495c in QApplicationPrivate::notify_helper (this=0x85d7e0, receiver=0xfbbee0, e=0x7fff425d3030) at kernel/qapplication.cpp:4300
#14 0x00007fa83bcfae5b in QApplication::notify (this=0x7fff425d4540, receiver=0xfbbee0, e=0x7fff425d3030) at kernel/qapplication.cpp:4187
#15 0x00007fa83d5962b6 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#16 0x00007fa83cbb0d5c in QCoreApplication::notifyInternal (this=0x7fff425d4540, receiver=0xfbbee0, event=0x7fff425d3030) at kernel/qcoreapplication.cpp:704
#17 0x00007fa83bd52fbd in QCoreApplication::sendSpontaneousEvent (this=0xfbf8a0, pdev=<value optimized out>, rgn=..., offset=<value optimized out>, flags=<value optimized out>, sharedPainter=0x0, 
    backingStore=0xfb33a0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:218
#18 QWidgetPrivate::drawWidget (this=0xfbf8a0, pdev=<value optimized out>, rgn=..., offset=<value optimized out>, flags=<value optimized out>, sharedPainter=0x0, backingStore=0xfb33a0)
    at kernel/qwidget.cpp:5339
#19 0x00007fa83bd53c58 in QWidgetPrivate::paintSiblingsRecursive (this=<value optimized out>, pdev=<value optimized out>, siblings=..., index=2, rgn=<value optimized out>, 
    offset=<value optimized out>, flags=4, sharedPainter=0x0, backingStore=0xfb33a0) at kernel/qwidget.cpp:5452
#20 0x00007fa83bd52d1a in QWidgetPrivate::drawWidget (this=0xfaf5f0, pdev=<value optimized out>, rgn=..., offset=<value optimized out>, flags=<value optimized out>, sharedPainter=0x0, 
    backingStore=0xfb33a0) at kernel/qwidget.cpp:5388
#21 0x00007fa83bf0bb25 in QWidgetBackingStore::sync (this=0xfb33a0) at painting/qbackingstore.cpp:1291
#22 0x00007fa83bd44330 in QWidgetPrivate::syncBackingStore (this=0xfaf5f0) at kernel/qwidget.cpp:1672
#23 0x00007fa83bd4b045 in QWidget::event (this=0xfaa430, event=0xfde630) at kernel/qwidget.cpp:8291
#24 0x00007fa83bcf498c in QApplicationPrivate::notify_helper (this=0x85d7e0, receiver=0xfaa430, e=0xfde630) at kernel/qapplication.cpp:4304
#25 0x00007fa83bcfae5b in QApplication::notify (this=0x7fff425d4540, receiver=0xfaa430, e=0xfde630) at kernel/qapplication.cpp:4187
#26 0x00007fa83d5962b6 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#27 0x00007fa83cbb0d5c in QCoreApplication::notifyInternal (this=0x7fff425d4540, receiver=0xfaa430, event=0xfde630) at kernel/qcoreapplication.cpp:704
#28 0x00007fa83cbb34d7 in QCoreApplication::sendEvent (receiver=0x0, event_type=<value optimized out>, data=0x7e86b0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#29 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=<value optimized out>, data=0x7e86b0) at kernel/qcoreapplication.cpp:1345
#30 0x00007fa83cbda673 in QCoreApplication::sendPostedEvents (s=<value optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#31 postEventSourceDispatch (s=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:276
#32 0x00007fa836dd5da2 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#33 0x00007fa836dd9c18 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#34 0x00007fa836dd9dcc in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#35 0x00007fa83cbda1b3 in QEventDispatcherGlib::processEvents (this=0x7e81f0, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:412
#36 0x00007fa83bda353e in QGuiEventDispatcherGlib::processEvents (this=0x0, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#37 0x00007fa83cbaf682 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#38 0x00007fa83cbafa5c in QEventLoop::exec (this=0x7fff425d4490, flags=) at kernel/qeventloop.cpp:201
#39 0x00007fa83cbb379b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:981
#40 0x0000000000415422 in main (argc=<value optimized out>, argv=<value optimized out>) at /home/phil/kdemod/core/kdenetwork/src/kdenetwork-4.4.2/kopete/kopete/main.cpp:105

Possible duplicates by query: bug 230490.

Reported using DrKonqi
Comment 1 Frank Schaefer 2010-05-05 12:16:18 UTC
Indeed, seems to be related to bug 230490 and all its duplicates.
Smells like a Qt-issue...

Which device and driver are you using ?
I can't reproduce it at the moment (tried with two devices).
Comment 2 yyyy12 2010-05-05 15:54:03 UTC
Output of dmesg (I don't have more information about that device):

gspca: probing 0c45:613a
sonixj: Sonix chip id: 12
sonixj: Sensor ov7648
Comment 3 Frank Schaefer 2010-05-05 16:41:56 UTC
Thanks, it uses a SN9C120 bridge.
I will try to get one of those devices for testing...

Btw, what about the /dev/video0 and video1 devices on your system ?
Comment 4 yyyy12 2010-05-10 17:34:10 UTC
They're from the vloopback driver, but that device doesn't show up in Kopete. (I tried again with that module unloaded, which doesn't change anything)

Some more informations - this is the output when opening the settings:

libv4l2: error setting pixformat: Device or resource busy                                                                                                                                               
VIDIOC_ENUMSTD: Invalid argument
VIDIOC_ENUM_FMT: Invalid argument
libv4l2: error setting pixformat: Device or resource busy
VIDIOC_ENUMSTD: Invalid argument
VIDIOC_ENUM_FMT: Invalid argument
libv4l2: error setting pixformat: Device or resource busy
VIDIOC_REQBUFS error 16, Device or resource busy
QObject::connect: Cannot connect (null)::onlineStatusChanged(Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus &) to Kopete::Identity::updateOnlineStatus()
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  1  offers for  "kopete_otr"
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  1  offers for  "kopete_history"
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  1  offers for  "kopete_translator"
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  1  offers for  "kopete_nowlistening"
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  0  offers for  "kopete_contactnotes"
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  0  offers for  "kopete_statistics"
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  1  offers for  "kopete_addbookmarks"
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  1  offers for  "kopete_webpresence"
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  1  offers for  "kopete_pipes"
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  1  offers for  "kopete_privacy"
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  1  offers for  "kopete_latex"
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  1  offers for  "kopete_highlight"
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  1  offers for  "kopete_urlpicpreview"
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  1  offers for  "kopete_autoreplace"
kopete(3543)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found  1  offers for  "kopete_texteffect"
libv4l2: error allocating conversion buffer
VIDIOC_DQBUF error 22, Invalid argument
libv4l2: error allocating conversion buffer
VIDIOC_DQBUF error 22, Invalid argument
(the last two lines repeat themselves forever (if Kopete doesn't crash))
Comment 5 Frank Schaefer 2010-06-18 20:02:40 UTC
SVN commit 1139611 by fschaefer:

Fix freezing of the video configuration dialog by switching to non-blocking device access

BUG: 167011
BUG: 241507
CCBUG: 236240


 M  +3 -1      kopete/config/avdevice/avdeviceconfig.cpp  
 M  +13 -21    libkopete/avdevice/videodevice.cpp  
 M  +2 -14     libkopete/avdevice/videodevicepool.cpp  
 M  +2 -1      libkopete/ui/avatarwebcamdialog.cpp  
 M  +10 -6     protocols/qq/ui/qqwebcamdialog.cpp  
 M  +8 -5      protocols/testbed/ui/testbedwebcamdialog.cpp  
 M  +8 -4      protocols/yahoo/yahoowebcam.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1139611
Comment 6 Christoph Feck 2010-08-09 20:44:28 UTC

*** This bug has been marked as a duplicate of bug 230490 ***