Issue 16270 - pthread_mutex_unlock: mutex is locked by a different thread
Summary: pthread_mutex_unlock: mutex is locked by a different thread
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: OOo 1.1 Beta2
Hardware: PC Linux, all
: P2 Trivial (vote)
Target Milestone: OOo 1.1 RC
Assignee: atr
QA Contact: issues@framework
URL: http://www.opengroup.org/onlinepubs/0...
Keywords:
: 16006 (view as issue list)
Depends on:
Blocks:
 
Reported: 2003-07-01 07:13 UTC by dankegel
Modified: 2003-07-29 18:45 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
valgrind log of main soffice when you use a 2nd soffice to load a document (6.01 KB, text/plain)
2003-07-01 07:15 UTC, dankegel
no flags Details
Shell script used to reproduce the problem (1.94 KB, text/plain)
2003-07-03 16:01 UTC, dankegel
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description dankegel 2003-07-01 07:13:04 UTC
Mutexes may only be unlocked by the thread that locked them.
However, it looks like OpenOffice breaks this rule in the following circumstance:

In one shell window, run soffice without arguments under valgrind.
In a second shell window, run "soffice foo.txt", where foo.txt is any document.

The first instance of openoffice will emit several interesting errors
(or at least it did on my dual CPU Red Hat 8 box) of the sort that
imply nasty, hard-to-repeat problems may follow.  A log is attached.
Comment 1 dankegel 2003-07-01 07:14:20 UTC
I forgot to mention that this may cause openoffice to crash.
Haven't seen it myself, but I think there's at least one 
bug in Issuezilla that might be another example of this...
Comment 2 dankegel 2003-07-01 07:15:33 UTC
Created attachment 7288 [details]
valgrind log of main soffice when you use a 2nd soffice to load a document
Comment 3 dankegel 2003-07-01 07:16:08 UTC
forgot to set target...
Comment 4 michael.bemmer 2003-07-01 08:53:01 UTC
Dan, I guess you forgot to set the _correct_ target. You don't want to
say, this is a release showstopper, do you?
Comment 5 dankegel 2003-07-01 09:23:59 UTC
Depends.  Opening just once instance of OpenOffice and then closing
it works fine.  However, this bug is probably triggered any time
you have OpenOffice open and double-click on another file in
Konqueror or the Finder or whatever.  Is that a special case?
If so, then this bug is P3, not P2. It's a nasty little programming
error of the brown-paper-bag sort if indeed it's real.

I'd like to set the target to 1.1rc2, but I don't see that choice :-)
Go ahead and reset the target to 1.1 if you think this can't
be looked at before 1.1rc1's release.  Thanks...
Comment 6 lo 2003-07-01 14:20:19 UTC
verified programming bug, will fix
Comment 7 lo 2003-07-01 14:22:18 UTC
my issue now
Comment 8 lo 2003-07-01 16:27:04 UTC
fixed in sw020
Comment 9 lo 2003-07-02 14:56:46 UTC
QA here seems to have a hard time reproducing the problem at all (on
multi processor linux machines). Dan or anyone else experiencing this
problem, could you try to build the desktop project with
/source/app/officeipcthread.cxx rev. 1.33.2.1
/source/app/officeipcthread.hxx rev. 1.12.46.1
and copy the resulting unxlngi5(.pro)/bin/soffice to your program
directory and see if the problem goes away. If you have problem
building that yourself, tell me which version you are using and I'll
prepare a binary with the fix for you to test.
Comment 10 lo 2003-07-03 12:17:04 UTC
please verify on sw020, script from Dan will be provided by me
Comment 11 atr 2003-07-03 13:44:54 UTC
ATR: checked in sw020, looks good, bug fixed.
Comment 12 atr 2003-07-03 13:46:28 UTC
.
Comment 13 atr 2003-07-03 13:46:52 UTC
..
Comment 14 dankegel 2003-07-03 16:01:11 UTC
Created attachment 7375 [details]
Shell script used to reproduce the problem
Comment 15 dankegel 2003-07-05 18:26:51 UTC
*** Issue 16006 has been marked as a duplicate of this issue. ***
Comment 16 atr 2003-07-17 09:53:41 UTC
ATR: Checked again in latest OpenOffice build (m13s1), fixed.
Comment 17 pichi 2003-07-29 13:06:47 UTC
I tested Issue: 16006 on 1.1rc2. It's work fine.
Comment 18 dankegel 2003-07-29 16:39:08 UTC
Pichi, did you test with Valgrind?  You can't see the problem
otherwise, at least on Linux.
Comment 19 pichi 2003-07-29 18:05:26 UTC
No. I tested bug described in issue 16006 on the same OS (RH9). I
don't know if this crash in cause of wrong pthread_mutex_unlock as
described here. But some behavior indicate, it can be this problem. It
dosn't crash in 1.1rc2, but crash in 1.1rc. If m13s1 is merged in
1.1rc2 it may be corected.
Comment 20 dankegel 2003-07-29 18:45:14 UTC
Oh, if you were able to reproduce issue 16006 without
valgrind, then you're probably right.  I guess the
NPTL pthreads in RH9 are touchier than the Linuxthreads pthreads
in RH8.