Bug 61271 - Incorrect mutex handling in libmpeglib/lib/decoder/decoderPlugin.cpp causes artsd to core with NetBSD's libpthread
Summary: Incorrect mutex handling in libmpeglib/lib/decoder/decoderPlugin.cpp causes a...
Status: RESOLVED FIXED
Alias: None
Product: mpeglib
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: NetBSD pkgsrc NetBSD
: NOR crash
Target Milestone: ---
Assignee: Martin Vogt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-15 13:07 UTC by Nick Hudson
Modified: 2004-02-05 17:38 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 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: