[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#667836: FTBFS on kfreebsd-amd64

Package: amanda
Version: 3.3.1-2
Severity: serious
Tags: patch
Justification: fails to build from source (but built successfully in the past)

See: http://lists.debian.org/debian-bsd/2012/04/msg00093.html

The glib init code is completely obsolete.  g_thread_supported() is now a stub
which always returns 1, so the first assertion doesn't make sense.

And g_thread_init() is just a dummy stub, so it's no use to call it.

These two provisions were put there to prevent some problem with multithreading
and libcurl, but they don't have any effect now (other than breaking things), so
it makes no sense to enable them.

As to what they were trying to prevent, perhaps they were just meant to work
around thread unsafety in curl_global_init()?  If that's the case, a mutex
sounds like the right thing to do.  Then again, I doubt it's really necessary.
Why would curl_global_init() be re-entered if amanda hasn't spawned new
threads yet?

-- System Information:
Debian Release: 6.0.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 8.1-1-amd64
Locale: LANG=ca_AD.UTF-8, LC_CTYPE=ca_AD.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
=== modified file 'common-src/glib-util.c'
--- common-src/glib-util.c	2012-04-06 21:45:36 +0000
+++ common-src/glib-util.c	2012-04-06 21:49:13 +0000
@@ -38,12 +38,8 @@ glib_init(void) {
     if (did_glib_init) return;
     did_glib_init = TRUE;
-    /* set up libcurl (this must happen before threading 
-     * is initialized) */
+    /* set up libcurl */
-    g_assert(!g_thread_supported()); /* assert threads aren't initialized yet */
-# endif
     g_assert(curl_global_init(CURL_GLOBAL_ALL) == 0);
@@ -64,12 +60,6 @@ glib_init(void) {
     /* Initialize glib's type system.  On glib >= 2.24, this will initialize
      * threads, so it must be done after curl is initialized. */
-    /* And set up glib's threads */
-#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE)
-    if (!g_thread_supported())
-	g_thread_init(NULL);
 typedef enum {

Reply to: