On 2018/07/09 10:31, Bryan Vyhmeister wrote:
> On Mon, Jul 09, 2018 at 12:39:43PM +0100, Stuart Henderson wrote:
> > A backtrace from gdb would be a good start. Is there anything in dmesg at
> > the time of the crash?
> 
> Nothing in dmesg. The output if I run in an xterm and also the backtrace
> are below. I should also mention that I am using cwm and not any desktop
> environment. Thank you.
> 
> Bryan
> 
> 
> 
> $ remmina                                                                 
> 
> ** (remmina:40021): CRITICAL **: 10:27:11.944: 
> secret_service_load_collections_sync: assertion 'paths != NULL' failed
> [glibsecret] unable to get secret service: Unknown error.
> Plugin entry returned false: 
> /usr/local/lib/remmina/plugins/remmina-plugin-secret.so.
> StatusNotifier/Appindicator support: not supported by desktop. Remmina will 
> try to fallback to GtkStatusIcon/xembed
> WARNING: Remmina is running with a secret plugin, but it cannot connect to a 
> secret service.
> 
> (remmina:40021): Gtk-WARNING **: 10:27:12.108: gtk_menu_attach_to_widget(): 
> menu already attached to GtkMenuItem
> Gtk-Message: 10:27:16.253: GtkDialog mapped without a transient parent. This 
> is discouraged.
> pthread_mutex_destroy on mutex with waiters!
> pthread_mutex_destroy on mutex with waiters!
> pthread_mutex_destroy on mutex with waiters!
> pthread_mutex_destroy on mutex with waiters!
> Abort trap (core dumped) 
> $
> 
> 
> 
> (gdb) bt
> #0  thrkill () at -:3
> #1  0x00001c9f16420e9e in _libc_abort () at 
> /usr/src/lib/libc/stdlib/abort.c:51
> #2  0x00001c9f16439a56 in _rthread_mutex_timedlock (mutexp=Variable "mutexp" 
> is not available.
> )
>     at /usr/src/lib/libc/thread/rthread_mutex.c:118
> #3  0x00001c9ed6791f77 in onMainThread_schedule_callback_and_wait ()
>    from /usr/local/lib/remmina/plugins/remmina-plugin-vnc.so
> #4  0x00001c9ed6791ddb in remmina_plugin_vnc_update_scale ()
>    from /usr/local/lib/remmina/plugins/remmina-plugin-vnc.so
> #5  0x00001c9ed67907d9 in remmina_plugin_vnc_rfb_allocfb ()
>    from /usr/local/lib/remmina/plugins/remmina-plugin-vnc.so
> #6  0x00001c9ec90eb972 in rfbInitClient () from 
> /usr/local/lib/libvncclient.so.0.0
> #7  0x00001c9ed678f922 in remmina_plugin_vnc_main ()
>    from /usr/local/lib/remmina/plugins/remmina-plugin-vnc.so
> #8  0x00001c9ed678f43b in remmina_plugin_vnc_main_thread ()
>    from /usr/local/lib/remmina/plugins/remmina-plugin-vnc.so
> #9  0x00001c9f387cfbfe in _rthread_start (v=Variable "v" is not available.
> )
>     at /usr/src/lib/librthread/rthread.c:96
> #10 0x00001c9f164810db in __tfork_thread ()
>     at /usr/src/lib/libc/arch/amd64/sys/tfork_thread.S:75
> #11 0x0000000000000000 in ?? ()
> Current language:  auto; currently asm
> 

No idea about a fix but here are some more details,

The SIGABRT comes from the mutex checking that we have in librthread. The actual
line is here:

249         if (mutex->owner != self) {
250         _rthread_debug(5, "%p: different owner %p (%p)\n", self, (void 
*)mutex,
251             (void *)mutex->owner);
252                 if (mutex->type == PTHREAD_MUTEX_ERRORCHECK ||
253                     mutex->type == PTHREAD_MUTEX_RECURSIVE) {
254                         return (EPERM);
255                 } else {
256                         /*
257                          * For mutex type NORMAL our undefined behavior for
258                          * unlocking an unlocked mutex is to succeed without
259                          * error.  All other undefined behaviors are to
260                          * abort() immediately.
261                          */
262                         if (mutex->owner == NULL &&
263                             mutex->type == PTHREAD_MUTEX_NORMAL)
264                                 return (0);
265                         else
266>>>                              abort();
267 
268                 }
269         }

I've tried forcgin the mutex to PTHREAD_MUTEX_NORMAL rather than the
default PTHREAD_MUTEX_STRICT_NP with the diff below but it still aborts,
the reason being that mutex->owner != NULL (and actually running with
RTHREAD_DEBUG=5 we see the "different owner" message).

Index: plugins/vnc/vnc_plugin.c
--- plugins/vnc/vnc_plugin.c.orig
+++ plugins/vnc/vnc_plugin.c
@@ -175,11 +175,15 @@ static void onMainThread_cleanup_handler( gpointer dat
 
 static void onMainThread_schedule_callback_and_wait( struct 
onMainThread_cb_data *d )
 {
+       pthread_mutexattr_t mattr;
        TRACE_CALL(__func__);
        d->cancelled = FALSE;
        pthread_cleanup_push( onMainThread_cleanup_handler, d );
-       pthread_mutex_init( &d->mu, NULL );
-       pthread_mutex_lock( &d->mu );
+       pthread_mutexattr_init(&mattr);
+       pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_NORMAL);
+       pthread_mutex_init( &d->mu, &mattr );
+       pthread_mutexattr_destroy(&mattr);
+       pthread_mutex_lock(&d->mu);
        gdk_threads_add_idle( (GSourceFunc)onMainThread_cb, (gpointer)d );
 
        pthread_mutex_lock( &d->mu );


Not sure where to go next but maybe this will save somebody else some time..

Reply via email to