After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 653266 - qt-gstreamer build failed with glib2-2.29.8
qt-gstreamer build failed with glib2-2.29.8
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: qt-gstreamer
0.10.1
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-23 18:44 UTC by nucleo
Modified: 2011-09-07 11:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Build log in Fedora Rawhide (16) (64.54 KB, text/plain)
2011-06-23 18:44 UTC, nucleo
Details

Description nucleo 2011-06-23 18:44:41 UTC
Created attachment 190528 [details]
Build log in Fedora Rawhide (16)

qt-gstreamer-0.10.1 build failed when I tried to build it for Fedora Rawhide (16).

There is glib2 updated to 2.29.8 in Rawhide which causes build error

qt-gstreamer-0.10.1/src/QGst/caps.cpp:129:13: error: cannot call member function 
'T* QGlib::RefCountedObject::object() const [with T = _GstCaps]' without object

See also bug https://bugzilla.redhat.com/show_bug.cgi?id=716209
Comment 1 George Kiagiadakis 2011-06-23 21:35:17 UTC
Confirmed. Some debug information:

line 129 reads:

return (GST_CAPS_REFCOUNT_VALUE(object<GstCaps>()) == 1);

and GST_CAPS_REFCOUNT_VALUE is actually:

#define GST_CAPS_REFCOUNT_VALUE(caps) \
 (g_atomic_int_get (&(GST_CAPS(caps))->refcount))

The problem relies on the implementation of g_atomic_int_get. In glib 2.28, it is defined as:

# define g_atomic_int_get(atomic) \
 ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gint) ? 1 : -1]), \
  (g_atomic_int_get) ((volatile gint G_GNUC_MAY_ALIAS *) (volatile void *) (atomic)))

...which works (despite being unreadable :P).
However, in glib 2.29 it is defined as:

#define g_atomic_int_get(atomic) \
  (G_GNUC_EXTENSION ({                                    \
    G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint));  \
    (void) (0 ? *(atomic) ^ *(atomic) : 0);               \
    __sync_synchronize ();                                \
    (gint) *(atomic);                                     \
  }))

which fails if "atomic" is a call to a C++ member function.
The bug actually appears in G_STATIC_ASSERT, which is defined as:

#define G_STATIC_ASSERT(expr) typedef struct { char Compile_Time_Assertion[(expr) ? 1 : -1]; } G_PASTE (_GStaticAssert_, __LINE__)

A quick test reveals that the following fails to compile:

typedef struct {
  char Compile_Time_Assertion[
     (sizeof(object<GstCaps>()->refcount) == sizeof(gint)) ? 1 : -1
  ];
} Foobar;

...while this one works fine:

typedef struct {
  char Compile_Time_Assertion[
     (sizeof(this->object<GstCaps>()->refcount) == sizeof(gint)) ? 1 : -1
  ];
} Foobar;

Imho, this is a compiler bug. An explicit use of the "this" pointer should not be required in the context of a member function.
Comment 2 nucleo 2011-06-24 16:32:39 UTC
Here comment added by gcc maintainer:
https://bugzilla.redhat.com/show_bug.cgi?id=716209#c8

If you think this is a compiler bug, you'd need to provide self-contained
(preferrably small, see http://gcc.gnu.org/bugs/ for details how to submit
proper bugreports) testcase, the comment in gnome bugzilla has nothing like
that.
And the claim that this-> should never be needed in C++ in the context of a
member function is obviously false, e.g. in templates with dependent bases
added this-> makes names dependent where they were previously non-dependent and
so is needed in order to access members of the dependent bases.
Comment 3 nucleo 2011-07-26 15:00:43 UTC
Hi, is there any news about fixing this bug?
Comment 4 George Kiagiadakis 2011-08-10 14:43:49 UTC
It should be now fixed (worked around) in master, but I haven't tested it.
Comment 5 Tim-Philipp Müller 2011-08-11 08:34:50 UTC
Alexey, could you try git master to see if this fixes the issue for you?
Comment 6 nucleo 2011-08-30 22:28:28 UTC
http://cgit.freedesktop.org/gstreamer/qt-gstreamer/commit/?id=a5487083433341783733858b5c153b759053f032

This patch fixes qt-gstreamer build for Fedora 16 with glib 2.29.16.