-   Linux - Software (
-   -   Mirage photo editor gives error message about a "mutex" (

newbiesforever 05-15-2017 08:42 AM

Mirage photo editor gives error message about a "mutex"
The last few times I tried to look at some photos with Mirage, it wouldn't run--nothing visible happened. This latest time, I finally thought to try a terminal to seek more information, and saw this error message:

Attempt to unlock mutex that was not locked

That's new to me...I've never heard the word "mutex" in any Linux discussion. What does the error mean, and what should I do?

sundialsvcs 05-15-2017 10:06 AM

This indicates a bug in the application, and it should be reported to its authors as such.

- - -
FYI: a "mutex" is a "mutual exclusion" mechanism that enables multiple processes or threads to avoid trying to make competing use of a single shared resource. Only one party at a time gets to "lock" it; all others are forced to wait in line. (Think: the door to a bathroom stall. If two people tried to use the same toilet at the same time, it'd get ... kinky. ;))

The error message means that some process or thread "tried to unlock the bathroom-stall door, but it wasn't locked." This implies a subtle timing bug in the application, since such code is supposed to be designed such that "you [that is to say, the application process/thread ...] know that the door is locked, because you are the one that most-recently (successfully) locked it!"

The program's authors get to :banghead: ...

Edit: I consider "norobro's" subsequent post to be especially relevant to the present situation.

norobro 05-15-2017 11:00 AM


Since GLib ≥ 2.41, attempting to release an unlocked mutex will abort(),
as it happens on most systems already.

Given the lack of proper documentation on how to use GDK with threads,
there is code in the wild that does:

gdk_threads_init ();
gdk_init ();


gtk_main ();

instead of the idiomatically correct:

gdk_threads_init ();
gdk_threads_enter ();

gtk_init ();


gtk_main ();


gdk_threads_leave ();

Which means that gtk_main() will try to release the GDK lock, and thus
trigger an error from GLib.

we cannot really fix all the wrong code everywhere, and since it does
not cost us anything, we can work around the issue inside GDK itself, by
trying to acquire the GDK lock inside gdk_threads_leave() with
From here:

The above is what is happening in

$ grep -n "gtk."
74:            gtk.gdk.threads_init()
4578:          gtk.main()
4582:  gtk.gdk.threads_enter()
4584:  gtk.gdk.threads_leave()

This was patched in gtk+2.0-2.24.24 on Debian. Mirage runs fine on my machine:

$ dpkg -s libgtk2.0-0|grep '^Version'
Version: 2.24.31-2

newbiesforever 05-15-2017 09:12 PM

Yes, and I did try to force the version in Synaptic, but I find the version you cite is not available. Looks like I need to update at least one of my source lists.

All times are GMT -5. The time now is 01:57 PM.