Bug 108933 - Potential threading problem should be investigated
Summary: Potential threading problem should be investigated
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-11 18:46 UTC by Andrew Walker
Modified: 2005-07-12 19:01 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Walker 2005-07-11 18:46:34 UTC
Version:           HEAD (using KDE KDE 3.3.0)
Installed from:    Compiled From Sources
OS:                Linux

When kst is closed after creating a few simple plots the following message is displayed (assuming that Kst was started from the command line):

Mutex destroy failure: Device or resource busy

This would seem to indicate a threading problem, which should at least be investigated.
Comment 1 George Staikos 2005-07-11 18:56:23 UTC
   Which KDE version and Qt version do you have?  This was a problem with 
KDE/Qt in the past.
Comment 2 Andrew Walker 2005-07-11 19:05:42 UTC
This is the first time I've seen it and have not recently changed either Qt or KDE versions.

KDE version: 0x30300
Qt version:  0x30303
Comment 3 George Staikos 2005-07-11 19:09:58 UTC
On Monday 11 July 2005 13:05, Andrew Walker wrote:
> ------- This is the first time I've seen it and have not recently changed
> either Qt or KDE versions.
>
> KDE version: 0x30300
> Qt version:  0x30303


  It could still be a bug, but I do remember those KDE and Qt versions causing 
this warning message in many or all KDE apps.
Comment 4 Matthew Truch 2005-07-11 20:10:49 UTC
>   It could still be a bug, but I do remember those KDE and Qt versions causing 
> this warning message in many or all KDE apps.


I have always got this message any time I run kst while I'm not in an
active kde session (for as long as I can remember using kst, over all
versions I can think of).  For example, this is from a Fedora Core 3 machine
that I log into remotely (so there is no kde running):

[truch@marcy ~]$ kst
kbuildsycoca running...
[truch@marcy ~]$ Mutex destroy failure: Device or resource busy
ICE default IO error handler doing an exit(), pid = 1965, errno = 0
ICE default IO error handler doing an exit(), pid = 1974, errno = 0
[truch@marcy ~]$ kst --version
Qt: 3.3.4
KDE: 3.3.1-2.12.FC3 Red Hat
Kst: 1.2.0_devel
[truch@marcy ~]$
Comment 5 George Staikos 2005-07-12 04:33:43 UTC
This is actually [seems to be] new.  I'm seeing it since updating today.  Here 
is the stack trace:

#0  ~QMutexPrivate (this=0x8078fe0) at qmutex_unix.cpp:119
#1  0x41a69474 in ~QRecursiveMutexPrivate (this=0x8078fe0)
    at qmutex_unix.cpp:229
#2  0x41a6991c in ~QMutex (this=0x40a14fd4) at qmutex_unix.cpp:453
#3  0x409eea28 in ~KstRWLock (this=0x40a14fc8) at rwlock.cpp:31
#4  0x40151fd0 in ~KstObjectList (this=0x40a14fc0) at kstobject.h:93
#5  0x409de68e in __tcf_2 () at kstdatacollection.cpp:34

  It's a KstMatrixList:
$1 = (KstObjectList<KstSharedPtr<KstMatrix> > * const) 0x40a14fc0
Comment 6 Rick Chern 2005-07-12 19:01:37 UTC
SVN commit 434028 by rchern:

- use KST::matrixList instead of old matrix dataobject in some other places
- write unlock after write locking

CCMAIL: 108933-done@bugs.kde.org

 M  +1 -0      kstdataobject.cpp  
 M  +1 -1      kstmatrixdialog_i.cpp  
 M  +1 -1      kstmatrixtable.cpp  
 M  +1 -1      kstviewmatricesdialog_i.cpp  


--- trunk/extragear/graphics/kst/kst/kstdataobject.cpp #434027:434028
@@ -75,6 +75,7 @@
        ++it) {
     KST::matrixList.remove(it.data());       
   }
+  KST::matrixList.lock().writeUnlock();
   //kdDebug() << "+++ DESTROYING DATA OBJECT: " << (void*)this << endl;
   delete _curveHints;
 }
--- trunk/extragear/graphics/kst/kst/kstmatrixdialog_i.cpp #434027:434028
@@ -608,7 +608,7 @@
 
 
 bool KstMatrixDialogI::edit_I() {
-  KstMatrixList mxList = kstObjectSubList<KstDataObject,KstMatrix>(KST::dataObjectList);
+  KstMatrixList mxList = KST::matrixList;
 
   // if editing multiple objects, edit each one
   if (_editMultipleMode) {    
--- trunk/extragear/graphics/kst/kst/kstmatrixtable.cpp #434027:434028
@@ -32,7 +32,7 @@
 }
 
 void KstMatrixTable::paintCell( QPainter* painter, int row, int col, const QRect& cr, bool selected, const QColorGroup& cg ) {
-  KstMatrixList matrices = kstObjectSubList<KstDataObject, KstMatrix>(KST::dataObjectList);
+  KstMatrixList matrices = KST::matrixList;
   KstMatrixPtr matrix = *matrices.findTag(_strMatrix);
   QString str;
   double value;
--- trunk/extragear/graphics/kst/kst/kstviewmatricesdialog_i.cpp #434027:434028
@@ -64,7 +64,7 @@
 void KstViewMatricesDialogI::updateViewMatricesDialog(const QString& matrixName) {
   int needed = 0;
   
-  KstMatrixList matrices = kstObjectSubList<KstDataObject, KstMatrix>(KST::dataObjectList);
+  KstMatrixList matrices = KST::matrixList;
   KstMatrixPtr matrix = *matrices.findTag(matrixName);
   if (matrix) {
     matrix->readLock();