Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 562558 - x11-libs/gtk+-3.16.7: gtk-query-immodules-3.0 segmentation fault
Summary: x11-libs/gtk+-3.16.7: gtk-query-immodules-3.0 segmentation fault
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All FreeBSD
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-08 11:51 UTC by Chí-Thanh Christopher Nguyễn
Modified: 2016-09-08 23:28 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (xz compressed due to size) (build.log.xz,28.51 KB, application/x-xz)
2015-10-08 11:51 UTC, Chí-Thanh Christopher Nguyễn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chí-Thanh Christopher Nguyễn gentoo-dev 2015-10-08 11:51:57 UTC
Created attachment 414112 [details]
build.log (xz compressed due to size)

Building gtk+-3.16.7 on amd64-fbsd results in a segmentation fault in gtk-query-immodules-3.0

../../gtk/gtk-query-immodules-3.0 im-am-et.la im-cedilla.la im-cyrillic-translit.la  im-inuktitut.la im-ipa.la im-multipress.la   im-thai.la im-ti-er.la im-ti-et.la im-viqr.la im-xim.la > immodules.cache
Makefile:1500: recipe for target 'immodules.cache' failed
gmake[3]: *** [immodules.cache] Segmentation fault (core dumped)
gmake[3]: *** Deleting file 'immodules.cache'

Stack trace:

(gdb) run
Starting program: /var/tmp/portage/x11-libs/gtk+-3.16.7/work/gtk+-3.16.7-abi_x86_64.amd64_fbsd/gtk/.libs/gtk-query-immodules-3.0 

Program received signal SIGSEGV, Segmentation fault.
0x000000080757d513 in g_type_name () from /usr/lib/libgobject-2.0.so.0
(gdb) where
#0  0x000000080757d513 in g_type_name () from /usr/lib/libgobject-2.0.so.0
#1  0x000000080756a44f in g_param_type_register_static ()
   from /usr/lib/libgobject-2.0.so.0
#2  0x000000080756bd4f in ?? () from /usr/lib/libgobject-2.0.so.0
#3  0x000000080755a57a in ?? () from /usr/lib/libgobject-2.0.so.0
#4  0x0000000800606754 in ?? () from /libexec/ld-elf.so.1
#5  0x000000080060aafe in ?? () from /libexec/ld-elf.so.1
#6  0x0000000800604465 in ?? () from /libexec/ld-elf.so.1
#7  0x0000000000000000 in ?? ()
Comment 1 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-10-08 13:13:33 UTC
(In reply to Chí-Thanh Christopher Nguyễn from comment #0)
> 0x000000080756bd4f in ?? () from /usr/lib/libgobject-2.0.so.0

This level of detail isn't exactly helpful :)

Please rebuild dev-libs/glib and whatever package is responsible for ld-elf.so.1 with -ggdb in CFLAGS to get a backtrace that shows what is actually happening. And then try to build gtk+ with -ggdb too, so the gtk-query-immodules-3.0 executable also has debugging symbols.
Comment 2 Chí-Thanh Christopher Nguyễn gentoo-dev 2015-10-08 15:31:23 UTC
new stack trace with debug info:

Program received signal SIGSEGV, Segmentation fault.
0x0000000807580513 in g_type_name (type=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gtype.c:3321
3321    /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gtype.c: No such file or directory.
(gdb) where
#0  0x0000000807580513 in g_type_name (type=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gtype.c:3321
#1  0x000000080756d44f in g_param_type_register_static (name=0x80758dccc "GParamValueArray", 
    pspec_info=pspec_info@entry=0x8077a15e0 <pspec_info>)
    at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gparam.c:1410
#2  0x000000080756ed4f in _g_param_spec_types_init ()
    at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gparamspecs.c:1512
#3  0x000000080755d57a in gobject_init_ctor ()
    at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gtype.c:4450
#4  0x0000000800606754 in objlist_call_init (lockstate=0x7fffffffe1b0, list=<optimized out>)
    at /var/tmp/portage/sys-freebsd/freebsd-libexec-10.2/work/libexec/rtld-elf/rtld.c:2433
#5  0x000000080060aafe in _rtld (sp=<optimized out>, exit_proc=<optimized out>, 
    objp=<optimized out>)
    at /var/tmp/portage/sys-freebsd/freebsd-libexec-10.2/work/libexec/rtld-elf/rtld.c:662
#6  0x0000000800604465 in .rtld_start ()
    at /var/tmp/portage/sys-freebsd/freebsd-libexec-10.2/work/libexec/rtld-elf/amd64/rtld_start.S:39
#7  0x0000000000000000 in ?? ()
Comment 3 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-10-08 17:28:53 UTC
(In reply to Chí-Thanh Christopher Nguyễn from comment #2)

This looks like a crash in libgobject's ctor when it's being loaded by the dynamic loader. Which simply should never happen :/

Please check whether other things on your system that are based on gobject are also crashing. Because a crash at such a basic level should be affecting everything related to gnome, xfce etc.
Comment 4 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-10-08 17:34:35 UTC
Also, has *any* version of gtk+ or libgobject worked on this system? Which versions worked? Please check what changed in your toolchain etc. since that time?
Comment 5 Chí-Thanh Christopher Nguyễn gentoo-dev 2015-10-08 17:59:13 UTC
It is a new system I am setting up for the Prague LinuxDays.
gtk+-2.4.28-r1 built fine and firefox runs fine.

I am seeing similar a problem with x11-libs/pango[X] though, pango-querymodules also segfaults during the build.
Comment 6 Chí-Thanh Christopher Nguyễn gentoo-dev 2015-10-08 18:14:35 UTC
I am currently looking through the patches that FreeBSD applies to glib
https://svnweb.freebsd.org/ports/head/devel/glib20/files/
to see if there is anything relevant.

This is the stacktrace of pango, it also fails in gobject_init_ctor

(gdb) where
#0  0x0000000802bde513 in g_type_name (type=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gtype.c:3321
#1  0x0000000802bcb44f in g_param_type_register_static (name=0x802bebccc "GParamValueArray", 
    pspec_info=pspec_info@entry=0x802dff5e0 <pspec_info>)
    at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gparam.c:1410
#2  0x0000000802bccd4f in _g_param_spec_types_init ()
    at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gparamspecs.c:1512
#3  0x0000000802bbb57a in gobject_init_ctor ()
    at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gtype.c:4450
#4  0x0000000800606754 in objlist_call_init (lockstate=0x7fffffffe200, list=<optimized out>)
    at /var/tmp/portage/sys-freebsd/freebsd-libexec-10.2/work/libexec/rtld-elf/rtld.c:2433
#5  0x000000080060aafe in _rtld (sp=<optimized out>, exit_proc=<optimized out>, 
    objp=<optimized out>)
    at /var/tmp/portage/sys-freebsd/freebsd-libexec-10.2/work/libexec/rtld-elf/rtld.c:662
#6  0x0000000800604465 in .rtld_start ()
    at /var/tmp/portage/sys-freebsd/freebsd-libexec-10.2/work/libexec/rtld-elf/amd64/rtld_start.S:39
#7  0x0000000000000000 in ?? ()
Comment 7 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-10-08 19:06:01 UTC
Potentially relevant: https://bugzilla.gnome.org/show_bug.cgi?id=756139

Maybe freebsd's libc, like musl, doesn't preserve the ctor order?
Comment 8 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-10-08 19:13:09 UTC
Check if either of the following works (it should force ctor order hopefully):

LD_PRELOAD="/usr/lib/libglib-2.0.so.0" gtk-query-immodules-3.0

or

LD_PRELOAD="/usr/lib/libglib-2.0.so.0:/usr/lib/libgobject-2.0.so.0" gtk-query-immodules-3.0
Comment 9 Chí-Thanh Christopher Nguyễn gentoo-dev 2015-10-08 20:10:54 UTC
No, I still get the segfault.

(gdb) show environment LD_PRELOAD
LD_PRELOAD = /usr/lib/libglib-2.0.so.0:/usr/lib/libgobject-2.0.so.0
(gdb) run
Starting program: /var/tmp/portage/x11-libs/gtk+-3.16.7/work/gtk+-3.16.7-abi_x86_64.amd64_fbsd/gtk/.libs/gtk-query-immodules-3.0 

Program received signal SIGSEGV, Segmentation fault.
0x0000000800b7f513 in g_type_name (type=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gtype.c:3321
3321    /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gtype.c: No such file or directory.
(gdb) where
#0  0x0000000800b7f513 in g_type_name (type=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gtype.c:3321
#1  0x0000000800b6c44f in g_param_type_register_static (name=0x800b8cccc "GParamValueArray", 
    pspec_info=pspec_info@entry=0x800da05e0 <pspec_info>)
    at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gparam.c:1410
#2  0x0000000800b6dd4f in _g_param_spec_types_init ()
    at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gparamspecs.c:1512
#3  0x0000000800b5c57a in gobject_init_ctor ()
    at /var/tmp/portage/dev-libs/glib-2.44.1/work/glib-2.44.1/gobject/gtype.c:4450
#4  0x0000000800606754 in objlist_call_init (lockstate=0x7fffffffe170, list=<optimized out>)
    at /var/tmp/portage/sys-freebsd/freebsd-libexec-10.2/work/libexec/rtld-elf/rtld.c:2433
#5  0x000000080060aafe in _rtld (sp=<optimized out>, exit_proc=<optimized out>, 
    objp=<optimized out>)
    at /var/tmp/portage/sys-freebsd/freebsd-libexec-10.2/work/libexec/rtld-elf/rtld.c:662
#6  0x0000000800604465 in .rtld_start ()
    at /var/tmp/portage/sys-freebsd/freebsd-libexec-10.2/work/libexec/rtld-elf/amd64/rtld_start.S:39
#7  0x0000000000000000 in ?? ()
Comment 10 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-10-09 02:14:37 UTC
Please check if this is specific to gtk/pango module querying, or just gobject alone triggers the problem.

Write a dummy 1-line .c file:

int main(int argc, const char ** argv) { return 0; }

Compile like this: gcc dummy.c `pkg-config --cflags --libs gobject-2.0` -o dummy

See if your dummy executable segfaults with the same backtrace. Because it should go through the same gobject_init_ctor() when libgobject is loaded.
Comment 11 Chí-Thanh Christopher Nguyễn gentoo-dev 2015-10-12 12:34:23 UTC
The test program compiles and runs without any segfault.
Comment 12 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-10-12 16:33:27 UTC
(In reply to Chí-Thanh Christopher Nguyễn from comment #11)

Then I am out of suggestions :(

Please try with glib-2.46.0-r1 from the gnome overlay: https://gitweb.gentoo.org/proj/gnome.git/tree/dev-libs/glib

If that still segfaults, please report upstream, probably to glib maintainers (this affects both gtk+ and pango, and libgobject looks like the common factor): https://bugzilla.gnome.org/enter_bug.cgi?product=glib&component=gobject

and add gnome@gentoo.org to the CC list.
Comment 13 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-10-12 16:35:02 UTC
(In reply to Alexandre Rostovtsev from comment #12)

Also, when reporting to upstream, paste the backtrace into a comment because they have some special bugzilla magic to identify similar bactraces.
Comment 14 Chí-Thanh Christopher Nguyễn gentoo-dev 2016-09-01 15:28:31 UTC
The problem has gone away after upgrading to gcc-5.4.0 and binutils-2.26.1
Comment 15 Gilles Dartiguelongue (RETIRED) gentoo-dev 2016-09-08 23:28:16 UTC
ok, thanks for the heads up.