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 757083 - Initialization via library ctors is breaking single library use case
Initialization via library ctors is breaking single library use case
Status: RESOLVED DUPLICATE of bug 756139
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal blocker
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-10-25 09:26 UTC by Sebastian Dröge (slomo)
Modified: 2015-10-25 09:30 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Dröge (slomo) 2015-10-25 09:26:19 UTC
Background: For GStreamer on Android we build all of GLib, GStreamer, etc in a single shared library. And on iOS we do static linking of everything into a single executable.


So, nowadays GLib, GObject, etc are initialized via library ctors. The order in which those are called is completely undefined. Now in the above two cases we will have the GLib and GObject library ctors in the same shared library or executable. Unfortunately with 2.46, now the GObject library ctor is called before the GLib one, which causes the GObject one to assert.

If you really want to use library ctors for all this, you need to ensure that dependencies between them are explicitly handled. That is, the GObject one must call the GLib one first
Comment 1 Emmanuele Bassi (:ebassi) 2015-10-25 09:30:02 UTC
In order to cater to other standard C libraries, the GObject constructor is now also initializing GLib explicitly.

*** This bug has been marked as a duplicate of bug 756139 ***