rickyrockrat / parcellite

GNU General Public License v3.0
224 stars 29 forks source link

Attempt to unlock mutex that was not locked #37

Closed Massimo-B closed 3 years ago

Massimo-B commented 4 years ago

Parcellite is my favourite clipboard manager since many years. However recently it often crashes and fails to start like this:

$ parcellite 
Flag 0x0001, status 0, EXIT 1 STAT 0
DRM_I915No magic! Assume no history.
Attempt to unlock mutex that was not locked
Aborted

The history seems to be deleted or corrupted:

$ ls -al ~/.local/share/parcellite/
total 4
drwxr-xr-x 1 mb mb   68 26. Sep 08:31 .
drwx------ 1 mb mb 1842 26. Sep 07:51 ..
-rw-r--r-- 1 mb mb    4 28. Aug 08:05 actions
prw-r----- 1 mb mb    0 26. Sep 08:31 fifo_c
prw-r----- 1 mb mb    0 26. Sep 08:31 fifo_cmd
prw-r----- 1 mb mb    0 26. Sep 08:31 fifo_p
-rw-r--r-- 1 mb mb    0 25. Sep 15:32 history

Always the only solution to fix this is restoring the directory from a backup. But even if the history is lost, why doesn't the application start anymore?

The reason why this might has appeared this time, the machine was crashed somehow, IO was blocked. I needed to reset by SYSREQ and emergency sync.

rickyrockrat commented 4 years ago

I suspect you have more problems than this. The mutex in question is using g_mutex_XX functions. I suggest running parcellite with strace: strace -o /tmp/parcellite.log -f $(which parcellite) Then post parcellite.log. Unfortunately, I've never run into this but then your situation will be hard to duplicate. I'm assuming the mutex is stored somewhere on your disk and it thinks it is locked.

Massimo-B commented 4 years ago

Next time I run into this issue I'm going to provide the strace log. Maybe it is of interest that the underlying filesystem is btrfs.

rickyrockrat commented 4 years ago

I'm going to assume this is due to your crashed system. If you see it again, please re-open this.

Dieterbe commented 3 years ago

Hi i also have this problem with version 1.2.1 I did not have any sort of system crash unlike OP.

Out of the blue, parcellite just refuses to start when I start I get errors like this:

<stuff i copied from primary selection buffer>No magic! Assume no history.
Attempt to unlock mutex that was not locked
[1]    316828 abort (core dumped)  parcellite

and this:

<stuff i copied from primary selection buffer>No magic! Assume no history.
Attempt to unlock mutex that was not locked
[1]    316828 abort (core dumped)  parcellite
No magic! Assume no history.
Attempt to unlock mutex that was not locked
[1]    317334 abort (core dumped)  parcellite

I notice that my .local/share/parcellite/history file was 0 bytes. when i delete it, parcellite starts again and seems to work fine again (but history is lost of course)

rickyrockrat commented 3 years ago

Can you please let me know your full install? File system format? Any steps to get it to happen? Can you verify your parcellite history file does have content at some point? Also, have you run smartctl on your drive? Is it a SSD?

It should not be core dumping. I'll see if I can duplicate a 0 len history file here.

rickyrockrat commented 3 years ago

Well, I duplicated your problem. Congratulations! you've discovered a bug with a zero len history file.

rickyrockrat commented 3 years ago

Can you pull down the master and build and make sure it resolves your problem? I can't fix the zero len file, but parcellite should start up now with the zero len file without core dumping.

Hopefully the fix is in commit e88679bb8becf245cbb26dfd97c948843c7cf34e

And my apologies to Massimo-B!

Massimo-B commented 3 years ago

Thanks :+1:

rickyrockrat commented 3 years ago

So did that fix the problem? I'd like to close this if I can. Thanks.

Dieterbe commented 3 years ago

Hello @rickyrockrat I just tested 6410b4e124e80bc8ee511d19c0ccd8662e8f44f7 with an empty .local/share/parcellite/history file. I can confirm it starts correctly, correctly recognizes the empty file, assumes no history, and seems to function normally thank you very much for this program ! :)

process output:

Unable to load pref 'disable_clear'
Unable to load pref 'save_history_Lineno'
Unable to load pref 'on_unity'
Flag 0x0001, status 0, EXIT 1 STAT 0
(parcellite:12634): Gtk-WARNING **: 11:18:44.643: Unable to locate theme engine in module_path: "clearlooks",
<some more messages about the theme>
No magic! Assume no history.
Flag 0x0001, status 0, EXIT 1 STAT 0
rickyrockrat commented 3 years ago

Thanks everyone.

veksha commented 2 years ago

Hello. this bug still happens on last release (1.2.1) maybe it's time to release 1.2.2 with the fixes?

buliasz commented 1 year ago

It's 2023-01-18 and the bug still happens. I have Parcellite 1.2.1 (default one from Linux Mint repo). I think the message "Attempt to unlock mutex that was not locked" is quite important here and it is always with the message "No magic! Assume no history.".