Bug 61271

Summary: Incorrect mutex handling in libmpeglib/lib/decoder/decoderPlugin.cpp causes artsd to core with NetBSD's libpthread
Product: mpeglib Reporter: Nick Hudson <skrll>
Component: generalAssignee: Martin Vogt <mvogt>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: NetBSD pkgsrc   
OS: NetBSD   
Latest Commit: Version Fixed In:

Description Nick Hudson 2003-07-15 13:07:40 UTC
Version:            (using KDE KDE 3.1.2)
Installed from:    NetBSD pkgsrc
OS:          NetBSD

NetBSD's libpthread is quite pedantic about unlocking unlocked
mutexes and will abort() when this happens. I was seeing artsd
core when using noatun to play mp3s.

Basically when runCheck return's false it should have the
shutdown mutex locked.

The problem is fixed with the following patch:

Nick

--- mpeglib/lib/decoder/decoderPlugin.cpp.orig
+++ mpeglib/lib/decoder/decoderPlugin.cpp
@@ -337,6 +337,7 @@ int DecoderPlugin::runCheck() {
     case _RUN_CHECK_CONTINUE:
       break;
     case _RUN_CHECK_FALSE:
+      shutdownLock();
       return false;
     case _RUN_CHECK_TRUE:
       return true;
Comment 1 davidsmind 2003-12-01 17:28:04 UTC
This is a one line patch and I don't think it breaks BC, either apply or close as wontfix.
Comment 2 Waldo Bastian 2004-02-05 17:38:07 UTC
Subject: KDE_3_2_BRANCH: kdemultimedia/mpeglib/lib/decoder

CVS commit by waba: 

When runCheck() returns false it should have the shutdown mutex locked. (BR61271)
Fixes crash on netbsd
CCMAIL: 61271-done@bugs.kde.org


  M +1 -0      decoderPlugin.cpp   1.11.4.1


--- kdemultimedia/mpeglib/lib/decoder/decoderPlugin.cpp  #1.11:1.11.4.1
@@ -338,4 +338,5 @@ int DecoderPlugin::runCheck() {
       break;
     case _RUN_CHECK_FALSE:
+      shutdownLock();
       return false;
     case _RUN_CHECK_TRUE: