Menu

#492 pthread_mutex_unlock abort in lxpanel

closed-fixed
nobody
lxpanel (297)
5
2013-03-10
2012-05-18
No

NetBSD is strict:

GLib (gthread-posix.c): Unexpected error from C library during 'pthread_mutex_unlock': Operation not permitted. Aborting.

I think isomething tries to unlock already unlocked mutexes.

gdb shows:

#0 0x00007f7ff61db90a in _lwp_kill () from /usr/lib/libc.so.12
#1 0x00007f7ff61db1e2 in abort () from /usr/lib/libc.so.12
#2 0x00007f7ff6b85d70 in g_thread_yield () from /usr/pkg/lib/libglib-2.0.so.0
#3 0x00007f7ff7a3f94a in gtk_main () from /usr/pkg/lib/libgtk-x11-2.0.so.0
#4 0x00000000004191bd in main ()

$ env PTHREAD_DIAGASSERT=ae lxpanel
lxpanel: can't load cpu plugin
lxpanel: Error detected by libpthread: Unlocking unlocked mutex.
Detected by file "/usr/src/lib/libpthread/pthread_mutex.c", line 423, function "pthread__mutex_unlock_slow".

So I patched glib2 to not abort on this so I can still use lxpanel.

Older glib2 doesn't abort.

I am not sure where the problem is... maybe somewhere in lxpanel there is a mutex gettig unlocked twice I think.

Discussion

  • Henry Gebhardt

    Henry Gebhardt - 2012-05-18

    Please try the patch here: https://github.com/hsgg/lxpanel/commit/75f5e575e692818869cb3d7fded6f42c735f6954

    It might be that gdk_threads_enter() and gdk_threads_leave() need to be called in other places, too. But please try the patch first.

    Since I cannot reproduce this on Linux, can you narrow down the exact place of where it occurs?

    Also, which version of glib are you using?

    (Also, how do I attach a file to this bug report?)

     
  • Jeremy C. Reed

    Jeremy C. Reed - 2012-05-26

    Thanks. The gdk_threads_enter/leave patch works. I didn't get any mutex unlock error.

    As for narrowing it dow, I don't know how. It was in gtk_main() but I don't know how to step within it.

    The glib is glib2-2.32.3

    Thanks again.

    Sorry for my delayed response. As far as I see, no email was sent about this and I just happened to re-read my ticket and saw the comment.

     
  • Jeremy C. Reed

    Jeremy C. Reed - 2012-11-23

    I updated to lxpanel 0.5.10 and the problem was there again. So I tried the patch again but still had problem. Maybe the problem was not fixed before. I reinstalled glib2 2.32.3 and also 2.34.2 and had the problem. For now I patched glib2 with:

    --- glib/gthread-posix.c.orig 2012-04-01 22:08:41.000000000 -0500
    +++ glib/gthread-posix.c 2012-05-15 12:54:26.000000000 -0500
    @@ -225,7 +225,8 @@
    gint status;

    if G_UNLIKELY ((status = pthread_mutex_unlock (g_mutex_get_impl (mutex))) != 0)
    - g_thread_abort (status, "pthread_mutex_unlock");
    + g_warning ("pthread_mutex_unlock");
    +
    }

    /**

     
  • Henry Gebhardt

    Henry Gebhardt - 2013-03-10
    • status: open --> closed-fixed
     
  • Henry Gebhardt

    Henry Gebhardt - 2013-03-10

    The patch is in lxpanel-0.5.12. Please test with that version, and reopen if you continue having problems.
    Thanks,
    Henry

     

Log in to post a comment.