Hi,

I've recently investigated the FTBFS on sparc (where it fails even before getting to the testing stage [0]), and found that the build failure was caused by lack of a call to gst_init() in the BOOT section of xs/Gst.xs.
Without it the code segfaults with the following backtrace:

#0  0x7022aaec in pthread_mutex_lock () from /lib/libpthread.so.0
#1  0x70763830 in gst_atomic_int_read (aint=0x708cfb0c) at gstatomic_impl.h:488
#2  0x707917d4 in gst_debug_get_default_threshold () at gstinfo.c:761
#3  0x70791a48 in gst_debug_reset_threshold (category=0x44618, unused=0x0) at 
gstinfo.c:782
#4  0x707927b0 in _gst_debug_category_new (name=0x7080abc8 "GST_DATAFLOW", color=258, 
description=0x7080abd8 "dataflow inside pads") at gstinfo.c:886
#5  0x70793f9c in gst_pad_get_type () at gstpad.c:117
#6  0x706d6aac in boot_GStreamer (my_perl=0x24098, cv=0xe084c) at Gst.xs:31

gst_debug_get_default threshold tries to read the default debug level from a lock-protected variable, which is normally initialized by gst_init(). Since it is not called, the lock is NULL, resulting in a segfault. I was able to build libgstreamer-perl successfully on sparc (passing all the tests) after applying the attached patch. The full build log is available at [1]. It might be that it will also help with other build failures.

[0] 
http://buildd.debian.org/fetch.php?pkg=libgstreamer-perl&arch=sparc&ver=0.04-1&stamp=1137218524&file=log
[1] http://www.wooyd.org/debian/libgstreamer-perl/

Best regards,

Jurij Smakov                                        [EMAIL PROTECTED]
Key: http://www.wooyd.org/pgpkey/                   KeyID: C99E03CC
diff -aur a/xs/Gst.xs b/xs/Gst.xs
--- a/xs/Gst.xs 2005-06-12 10:29:15.000000000 -0700
+++ b/xs/Gst.xs 2006-01-27 21:37:51.362482192 -0800
@@ -27,6 +27,7 @@
         * use a static variable directly, instead of the usual reference to
         * the _get_type function.  Thus, the macros we rely on are NULL until
         * the corresponding _get_type() function has been called. */
+       gst_init (NULL, NULL);
        gst_object_get_type ();
        gst_pad_get_type ();
        gst_real_pad_get_type ();

Reply via email to