Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 836642 - dev-libs/dbus-glib-0.112 fails to cross compile with segfault
Summary: dev-libs/dbus-glib-0.112 fails to cross compile with segfault
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Cross compilation support
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 915000
  Show dependency tree
 
Reported: 2022-04-02 10:39 UTC by tt_1
Modified: 2023-10-01 10:15 UTC (History)
4 users (show)

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


Attachments
compressed build log from armv7-cross (build.log.gz,14.20 KB, application/gzip)
2022-04-02 10:39 UTC, tt_1
Details
output from emerge --info (armv7) (emerge-info,5.29 KB, text/plain)
2022-04-02 10:41 UTC, tt_1
Details
backtrace (backtrace-dbus-glib,3.19 KB, text/plain)
2022-04-03 08:24 UTC, tt_1
Details
ASAN output (-fsanitize=address) (file_836642.txt,8.94 KB, text/plain)
2022-04-03 08:46 UTC, Sam James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2022-04-02 10:39:17 UTC
Created attachment 768501 [details]
compressed build log from armv7-cross

the build fails with this error: 

make[3]: Entering directory '/usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.112/work/dbus-glib-0.112-.arm-build/dbus/examples'
/bin/sh ../../libtool --mode=execute ../../dbus/dbus-binding-tool --prefix=some_object --mode=glib-server --output=example-service-glue.h /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.112/work/dbus-glib-0.112/dbus/examples/example-service.xml
/bin/sh ../../libtool --mode=execute ../../dbus/dbus-binding-tool --prefix=test_object --mode=glib-server --output=example-signal-emitter-glue.h /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.112/work/dbus-glib-0.112/dbus/examples/example-signal-emitter.xml

(process:1161): GLib-CRITICAL **: 12:14:52.602: g_string_insert_c: assertion '(gsize) pos <= string->len' failed

(process:1161): GLib-CRITICAL **: 12:14:52.602: g_string_insert_c: assertion '(gsize) pos <= string->len' failed

(process:1161): GLib-CRITICAL **: 12:14:52.602: g_string_insert_c: assertion '(gsize) pos <= string->len' failed

(process:1161): GLib-CRITICAL **: 12:14:52.602: g_string_insert_c: assertion '(gsize) pos <= string->len' failed

(process:1161): GLib-CRITICAL **: 12:14:52.602: g_string_insert_c: assertion '(gsize) pos <= string->len' failed

(process:1161): GLib-CRITICAL **: 12:14:52.602: g_string_insert_c: assertion '(gsize) pos <= string->len' failed
make[3]: *** [Makefile:810: example-service-glue.h] Segmentation fault
make[3]: *** Waiting for unfinished jobs....

(process:1162): GLib-CRITICAL **: 12:14:52.603: g_string_insert_c: assertion '(gsize) pos <= string->len' failed
make[3]: *** [Makefile:813: example-signal-emitter-glue.h] Segmentation fault
make[3]: Leaving directory '/usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.112/work/dbus-glib-0.112-.arm-build/dbus/examples'
make[2]: *** [Makefile:1049: all-recursive] Error 1
make[2]: Leaving directory '/usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.112/work/dbus-glib-0.112-.arm-build/dbus'
make[1]: *** [Makefile:536: all-recursive] Error 1
make[1]: Leaving directory '/usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.112/work/dbus-glib-0.112-.arm-build'
make: *** [Makefile:436: all] Error 2


this is really bad, as at the moment firefox-nightly is fundamentally broken if build without dbus support; so will take about roughly two months before this is mandantory for cross-compiling firefox to the slow armv7a targets. 

the cross-compile is working for aarch64
Comment 1 tt_1 2022-04-02 10:41:18 UTC
Created attachment 768503 [details]
output from emerge --info (armv7)
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-03 07:48:07 UTC
Backtrace please?
Comment 3 tt_1 2022-04-03 08:03:08 UTC
I haven't yet found out how to reproduce this in gdb, but can offer you this from the dmesg log:

[ 5231.491261] dbus-binding-to[6378]: segfault at 8113e280 ip 00007fd453af2b01 sp 00007ffcc085cfd0 error 4 in libgobject-2.0.so.0.7000.4[7fd453acd000+30000]
[ 5231.491265] Code: 0f 87 83 00 00 00 48 c1 ef 02 48 8d 05 d8 6b 02 00 48 8b 2c f8 48 85 ed 0f 84 0b 01 00 00 48 8d 3d 14 74 02 00 e8 af ab fd ff <4c> 8b 6d 30 4d 85 ed 0f 84 22 01 00 00 41 8b 4d 00 49 8b 7d 08 85
[ 5231.491322] dbus-binding-to[6379]: segfault at 556490c4b401 ip 00007f8d18a49cfb sp 00007ffc5118a728 error 4 in libc.so.6[7f8d188fb000+16b000]
[ 5231.491327] Code: c5 fe 7f 5c 17 c0 c5 f8 77 c3 48 3b 15 a6 b8 07 00 0f 87 38 01 00 00 48 39 f7 0f 87 96 00 00 00 0f 84 d5 fe ff ff c5 fe 6f 26 <c5> fe 6f 6c 16 e0 c5 fe 6f 74 16 c0 c5 fe 6f 7c 16 a0 c5 7e 6f 44
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-03 08:14:04 UTC
(In reply to tt_1 from comment #3)
> I haven't yet found out how to reproduce this in gdb, but can offer you this
> from the dmesg log:
> 

in e.g. /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.112/work/dbus-glib-0.112-.arm-build/dbus/examples, run:
libtool --mode=execute gdb --args ../../dbus/dbus-binding-tool --prefix=test_object --mode=glib-server --output=example-signal-emitter-glue.h /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.112/work/dbus-glib-0.112/dbus/examples/example-signal-emitter.xml
Comment 5 tt_1 2022-04-03 08:23:25 UTC
Ah thanks a lot for the help with the syntax, I was using it in the wrong order. Anyway, here is the output: 

LANG=C libtool --mode=execute gdb --args ../../dbus/dbus-binding-tool --prefix=test_object --mode=glib-server --output=example-signal-emitter-glue.h /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.112/work/dbus-glib-0.112/dbus/examples/example-signal-emitter.xml
GNU gdb (Gentoo 11.2 vanilla) 11.2
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.112/work/dbus-glib-0.112-.arm-build/dbus/.libs/dbus-binding-tool...
(No debugging symbols found in /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.112/work/dbus-glib-0.112-.arm-build/dbus/.libs/dbus-binding-tool)
(gdb) run
Starting program: /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.112/work/dbus-glib-0.112-.arm-build/dbus/.libs/dbus-binding-tool --prefix=test_object --mode=glib-server --output=example-signal-emitter-glue.h /usr/armv7a-unknown-linux-gnueabihf/tmp/portage/dev-libs/dbus-glib-0.112/work/dbus-glib-0.112/dbus/examples/example-signal-emitter.xml
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

(process:17842): GLib-CRITICAL **: 10:22:21.411: g_string_insert_c: assertion '(gsize) pos <= string->len' failed

Program received signal SIGSEGV, Segmentation fault.
__memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:476
476	../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.
(gdb) bt 476
#0  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:476
#1  0x00007ffff7c50a82 in memcpy (__len=2047, __src=0x55555558fc22, __dest=<optimized out>) at /usr/include/bits/string_fortified.h:29
#2  g_string_insert_len (string=0x55555557c280, pos=pos@entry=-1, val=val@entry=0x55555558fc22 "", len=len@entry=2047) at ../glib-2.70.4/glib/gstring.c:498
#3  0x00007ffff7c50b96 in g_string_append_len (string=<optimized out>, val=val@entry=0x55555558fc22 "", len=len@entry=2047) at ../glib-2.70.4/glib/gstring.c:574
#4  0x00007ffff7c22afe in g_io_channel_write_chars (channel=0x55555557df20, buf=0x55555558fc22 "", count=4294967295, bytes_written=0x7fffffffce44, error=0x7fffffffdfb8)
    at ../glib-2.70.4/glib/giochannel.c:2314
#5  0x000055555555a436 in write_marshaller ()
#6  0x00007ffff7c1c4ae in g_hash_table_foreach (hash_table=0x555555570300, func=0x55555555a3d0 <write_marshaller>, user_data=0x7fffffffcee0) at ../glib-2.70.4/glib/ghash.c:2065
#7  0x000055555555d2e1 in dbus_binding_tool_output_glib_server ()
#8  0x000055555555a083 in main ()
Comment 6 tt_1 2022-04-03 08:24:49 UTC
Created attachment 768550 [details]
backtrace
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-03 08:46:28 UTC
Created attachment 768551 [details]
ASAN output (-fsanitize=address)
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-12 05:47:02 UTC
OK, next step is to report this upstraem to dbus-glib with the backtrace & ask for advice on what to do further. The ASAN output may be helpful too (feel free to just send mine).
Comment 9 tt_1 2022-04-15 08:41:50 UTC
I wonder if this is a problem of picking the wrong libdir to link the binary, will try to setup pure amd64 no multilib setup and another x86 setup to test it. 

If these efforts are not helpfull I will report it upstream, its just that dbus-glib is not maintained for almost a decade now.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-01 20:32:41 UTC
(In reply to tt_1 from comment #9)
> I wonder if this is a problem of picking the wrong libdir to link the
> binary, will try to setup pure amd64 no multilib setup and another x86 setup
> to test it. 
> 
> If these efforts are not helpfull I will report it upstream, its just that
> dbus-glib is not maintained for almost a decade now.

Did you report it yet?