Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spacefm won't start: Attempt to unlock mutex that was not locked error #468

Closed
riveravaldez opened this issue Sep 30, 2014 · 22 comments

Comments

Projects
None yet
6 participants
@riveravaldez
Copy link

commented Sep 30, 2014

Hi, I'm not sure (at all) if this is a SpaceFM error or came from another fount.
When I try to run SpaceFM it appears for an instant (like a flash) and then disappears.
I'm using Debian Testing:

$ uname -a
Linux user 3.16-2-amd64 #1 SMP Debian 3.16.3-2 (2014-09-20) x86_64 GNU/Linux

$ spacefm
** (spacefm:2118): WARNING **: Ningún ajuste de root encontrado en /etc/spacefm/
Establecer un editor de root en Preferencias debería remover esta advertencia al inicio.
De otra manera commandos ejecutados como root pueden presentar un riesgo de seguridad.
spacefm: No such property from XGetWindowProperty() _NET_CURRENT_DESKTOP
Attempt to unlock mutex that was not locked
Abortado

$ spacefm --version
spacefm 0.9.4
GTK2 UDEV INOTIFY DESKTOP SNOTIFY

System is partially on Spanish. Roughly translation: None root adjustment found on /etc/spacefm/ Establishing a root editor on Preferences should remove this warning at start. In other case, commands executed as root can present a security danger.

Any hint?

Thanks a lot.

@arclance

This comment has been minimized.

Copy link

commented Sep 30, 2014

This seems to be caused by a update to glib according to this Debian bug report.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762682

@mati75

This comment has been minimized.

Copy link

commented Sep 30, 2014

I know about this bug. Now I don't anything solution to fix that.

@riveravaldez

This comment has been minimized.

Copy link
Author

commented Sep 30, 2014

Thanks a lot, @arclance , the Temporal solution - install spacefm-gtk3 proposed on the link seems to work just fine. If there's any precaution I should have in the use of this version please let me know.
Thanks again!

@arclance

This comment has been minimized.

Copy link

commented Sep 30, 2014

This link seems to indicate how to fix the (very common) error people made using gdk with threads that causes the "Attempt to unlock mutex that was not locked" that crashes spacefm.
https://mail.gnome.org/archives/commits-list/2014-August/msg08240.html

It is not a large change but making it properly would require some understanding of how spacefm uses this code which I don't have.

@VastOne

This comment has been minimized.

Copy link

commented Sep 30, 2014

Exactly arclance. I have used that code on several apps (disk-manager, radiotray, mirage all of these being python code) but I have yet to find the method or way to implement that change in spacefm. I have been looking at it for a couple of weeks now and have several users invested in finding it also since spacefm is the VSIDO default file manager. spacefm-gtk3 is the interim fix but not one that fits all themes nicely ... We will report back if we solve it

@arclance

This comment has been minimized.

Copy link

commented Sep 30, 2014

I looked at it a little but I don't know C so my guess (gdk_threads_enter (); coming after gtk_init (); and possibly gtk_main ();) could be wrong.
@BwackNinja has worked on the gtk part of spacefm before he might be able to figure it out if IgnorantGuru stays in hibernation mode.

@BwackNinja

This comment has been minimized.

Copy link
Contributor

commented Sep 30, 2014

Yo. A backtrace would be really nice for isolating this, but I'll take a look at it in a few hours regardless. Probably a simple issue. Any fix wil end up in my repo.

@arclance

This comment has been minimized.

Copy link

commented Sep 30, 2014

Yes, I thought a backtrace would help to narrow down where the code is failing as a well.
I am at work right now so I can't make one until I get home.
I plan to setup a VSIDO VM tonight so I can get a backtrace without breaking things on my main system.

@BwackNinja

This comment has been minimized.

Copy link
Contributor

commented Sep 30, 2014

It looks like it is the gdk thread issue you mentioned. Adding a GDK_THREADS_ENTER(); and a GDK_THREADS_LEAVE(); around the gtk_main(); statements on lines 1341 and 1502 of src/main.c should be enough to fix it.

I'll have to update my glib to test it though, because this is only supposed to be an issue using glib 2.41 and above.

@VastOne

This comment has been minimized.

Copy link

commented Oct 1, 2014

If you are still in need of a backtrace I can supply one

@BwackNinja

This comment has been minimized.

Copy link
Contributor

commented Oct 1, 2014

Please do. I haven't tried a fix yet, and it would likely confirm my suspicions.

BwackNinja added a commit to BwackNinja/spacefm that referenced this issue Oct 1, 2014

@BwackNinja

This comment has been minimized.

Copy link
Contributor

commented Oct 1, 2014

Nevermind about the backtrace. It was just the simple fix. You guys can check out my repo - it's only got this fix and a transparent background option implemented on top of this.

If there's something wrong somewhere else and you don't think it would be much trouble to fix, just ping me like you've done here.

@arclance

This comment has been minimized.

Copy link

commented Oct 1, 2014

Thanks.
You finished before I finished dinner so I never got to get started on making a backtrace.

@VastOne

This comment has been minimized.

Copy link

commented Oct 2, 2014

The patch that BwackNinja supplied has been packaged by the debian maintainer Mateusz Łukasik and version 9.4-2 is in the FTP process of upload to the debian servers. I am running it now without issues, the mutex errors gone. Thank you for the help and support arclance and BwackNinja. https://packages.debian.org/sid/spacefm

mati75 added a commit to mati75/spacefm that referenced this issue Oct 2, 2014

@riveravaldez

This comment has been minimized.

Copy link
Author

commented Oct 6, 2014

Already on Testing and working fine so far. Thanks a lot!
Should I close the issue?

@BwackNinja

This comment has been minimized.

Copy link
Contributor

commented Oct 6, 2014

It's now fixed downstream but not upstream. Leave it open for IgnorantGuru if he ever comes out of hibernation.

@riveravaldez

This comment has been minimized.

Copy link
Author

commented Oct 7, 2014

Okay.
Thanks a lot again!

@IgnorantGuru

This comment has been minimized.

Copy link
Owner

commented Feb 17, 2015

This "Attempt to unlock mutex that was not locked" error on SpaceFM startup is caused by upgrading from glib <= 2.40 to glib >= 2.41, while using GTK 2.24.24. This was a bug in GTK2 which affected a lot of GTK2 apps. eg you can see some discussion and links here.

This problem was fixed upstream in GTK2 with version 2.24.25. So building SpaceFM with glib >= 2.41 and GTK >= 2.24.25 should solve this problem. No changes are required in SpaceFM.

In Debian, you only need to update these packages (which have no systemd dependency):
libglib2.0-0 (2.40.0-3 => 2.42.1-1)
libglib2.0-dev (2.40.0-3 => 2.42.1-1)
gir1.2-gtk-2.0 (2.24.24-1 => 2.24.25-1)
gtk2-engines-pixbuf (2.24.24-1 => 2.24.25-1)
libgtk2.0-0 (2.24.24-1 => 2.24.25-1)
libgtk2.0-0-dbg (2.24.24-1 => 2.24.25-1)
libgtk2.0-bin (2.24.24-1 => 2.24.25-1)
libgtk2.0-dev (2.24.24-1 => 2.24.25-1)

Thanks for the work providing workarounds for this, which may have been a temp fix for glib 2.41 with GTK 2.24.24. However, I do not recommend using the gdk_threads_enter patches any longer, as it will probably interfere with SpaceFM's multithread support, and may cause other issues.

@BwackNinja

This comment has been minimized.

Copy link
Contributor

commented Feb 17, 2015

I've seen the problem with glib 2.41 and GTK3, and problems will still arise with older versions of GTK that SpaceFM does otherwise support. Also, I'd that using gdk_threads_enter is not just a workaround and is shown as the right way of doing things even in an old cairo tutorial here [1].

[1] http://cairographics.org/threaded_animation_with_cairo/

@IgnorantGuru

This comment has been minimized.

Copy link
Owner

commented Feb 17, 2015

BwackNinja, okay thanks. I didn't review the issue in detail. Just off-hand, it just seems strange to use gdk_threads_enter/leave around the main gtk loop, but if that fix is working then maybe that is indeed the way to do it. I did try to backtrace it but got nowhere - seems deep in GTK or glib.

@IgnorantGuru IgnorantGuru changed the title spacefm: No such property from XGetWindowProperty() _NET_CURRENT_DESKTOP spacefm won't start: Attempt to unlock mutex that was not locked error Feb 17, 2015

@IgnorantGuru IgnorantGuru added bug and removed wontfix labels Feb 17, 2015

@IgnorantGuru

This comment has been minimized.

Copy link
Owner

commented Feb 17, 2015

Noting that BwackNinja has a patched version of SpaceFM on his maintenance fork which includes a fix for this as well as some feature improvements. You can grab the source via this link, and follow the normal build instructions in README.

@IgnorantGuru IgnorantGuru added this to the 0.9.5 milestone Feb 25, 2015

@IgnorantGuru IgnorantGuru added the fixed label Mar 2, 2015

@IgnorantGuru

This comment has been minimized.

Copy link
Owner

commented Mar 2, 2015

BwackNinja fixed this in f167b28 (next branch) due in 0.9.5 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.