g_tls_certificate_gnutls_get_type_once: unlock of an unlocked mutex
Hi, I see there's an open issue about resolving some threading issues, so I'm not sure if this is related.
I pared my test down to the simplest snippet along the lines of:
static void
test_certificate_new (void)
{
GTlsCertificate *certificate;
certificate = g_tls_certificate_new_from_pem (cert, -1, NULL);
}
I get this from ThreadSanitizer:
==================
WARNING: ThreadSanitizer: unlock of an unlocked mutex (or by a wrong thread) (pid=14287)
#0 pthread_mutex_unlock <null> (libtsan.so.0+0x3b64a)
#1 g_tls_certificate_gnutls_get_type_once <null> (libgiognutls.so+0xa459)
#2 test_case_run ../glib/gtestutils.c:2900 (libglib-2.0.so.0+0x7eca5)
#3 g_test_run_suite_internal ../glib/gtestutils.c:2988 (libglib-2.0.so.0+0x7eca5)
#4 __libc_start_call_main <null> (libc.so.6+0x2d55f)
Location is heap block of size 40 at 0x7b0c00001950 allocated by main thread:
#0 malloc <null> (libtsan.so.0+0x32919)
#1 g_rec_mutex_impl_new ../glib/gthread-posix.c:284 (libglib-2.0.so.0+0xa4760)
#2 test_case_run ../glib/gtestutils.c:2900 (libglib-2.0.so.0+0x7eca5)
#3 g_test_run_suite_internal ../glib/gtestutils.c:2988 (libglib-2.0.so.0+0x7eca5)
#4 __libc_start_call_main <null> (libc.so.6+0x2d55f)
Mutex M27 (0x7b0c00001950) created at:
#0 pthread_mutex_unlock <null> (libtsan.so.0+0x3b64a)
#1 g_tls_certificate_gnutls_get_type_once <null> (libgiognutls.so+0xa459)
#2 test_case_run ../glib/gtestutils.c:2900 (libglib-2.0.so.0+0x7eca5)
#3 g_test_run_suite_internal ../glib/gtestutils.c:2988 (libglib-2.0.so.0+0x7eca5)
#4 __libc_start_call_main <null> (libc.so.6+0x2d55f)
SUMMARY: ThreadSanitizer: unlock of an unlocked mutex (or by a wrong thread) (/lib64/libtsan.so.0+0x3b64a) in pthread_mutex_unlock
==================
ThreadSanitizer: reported 1 warnings
I'm pretty new to the ThreadSanitizer game, so please do let me know if I'm doing something silly here.