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 701156 - testgobject assumes that the priv data follows the instance data
testgobject assumes that the priv data follows the instance data
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gobject
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-05-28 20:57 UTC by Emanuele Aina
Modified: 2017-11-17 18:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tests: Don't assume that private data follows the instance data (1.43 KB, patch)
2013-05-28 20:57 UTC, Emanuele Aina
none Details | Review
tests: Re-wire the testgobject test program to the build system (1.25 KB, patch)
2013-06-13 09:35 UTC, Emanuele Aina
committed Details | Review
tests: Don't assume that private data follows the instance data (1.47 KB, patch)
2013-06-13 09:36 UTC, Emanuele Aina
committed Details | Review

Description Emanuele Aina 2013-05-28 20:57:34 UTC
Commit https://git.gnome.org/browse/glib/commit/?id=31fde56 changes the way
private and instance data are laid out in memory and this breaks the assumption
in `testgobject' that the pointer to the private data must be greater than the
instance data pointer + the instance data size.
Comment 1 Emanuele Aina 2013-05-28 20:57:37 UTC
Created attachment 245493 [details] [review]
tests: Don't assume that private data follows the instance data

Commit 31fde56 changed the way the private data is laid out in memory by
putting it *before* the instance data to keep the offsets fixed
regardless of the number of many subclasses.

This means that the invariant testgobject was verifying is no longer
true and the failing tests can be safely dropped.
Comment 2 Emanuele Aina 2013-06-13 09:35:59 UTC
Created attachment 246694 [details] [review]
tests: Re-wire the testgobject test program to the build system

After the build system rework in commit f9eb9e testgobject fell through
the cracks and was not built since then.

Re-enable it, even if it is currently failing due to commit 31fde56.
Comment 3 Emanuele Aina 2013-06-13 09:36:14 UTC
Created attachment 246695 [details] [review]
tests: Don't assume that private data follows the instance data

Commit 31fde56 changed the way the private data is laid out in memory by
putting it *before* the instance data to keep the offsets fixed
regardless of the number of many subclasses.

This means that the invariant testgobject was verifying is no longer
true and the failing tests can be safely dropped.
Comment 4 Philip Withnall 2017-11-17 12:25:57 UTC
Review of attachment 246695 [details] [review]:

Looks legit.
Comment 5 Philip Withnall 2017-11-17 12:26:07 UTC
Review of attachment 246694 [details] [review]:

::: tests/gobject/Makefile.am
@@ +43,3 @@
 defaultiface_SOURCES = defaultiface.c testmodule.c testmodule.h
 dynamictype_SOURCES = dynamictype.c testmodule.c testmodule.h
+testgobject_SOURCES = testgobject.c

This also needs to be added to meson.build, but I’ll do that before I push it.
Comment 6 Philip Withnall 2017-11-17 12:27:46 UTC
Attachment 246694 [details] pushed as e73831d - tests: Re-wire the testgobject test program to the build system
Attachment 246695 [details] pushed as edcabe1 - tests: Don't assume that private data follows the instance data
Comment 7 Emanuele Aina 2017-11-17 18:50:54 UTC
Thanks! <3