Bug#1049434: gtk4: FTBFS on riscv64: SIGSEGV in gtk:gtk / templates test

Aurelien Jarno aurel32 at debian.org
Tue Aug 15 19:19:16 BST 2023


Source: gtk4
Version: 4.10.3+ds-1
Severity: important
Tags: upstream ftbfs
Justification: fails to build from source
X-Debbugs-Cc: debian-riscv at lists.debian.org

Dear maintainer,

As part of the riscv64 bootstrap, I have been trying to build and import
gtk4 (involves building it with a mix of the official archive and the
old debian-ports archive). Unfortunately it fails to build from source
with a failure in the testsuite:

| 262/722 gtk:gtk / templates                                                                         ERROR             8.58s   killed by signal 5 SIGTRAP

This only happens for the wayland tests, not for the x11 ones. Here is
the corresponding test details and my attempt at using gdb:

| (sid-riscv64-sbuild)aurel32 at vf2:/build/gtk4-4.10.5+ds$ GTK_CSD=1 G_TEST_SRCDIR=/build/gtk4-4.10.5+ds/testsuite/gtk GSK_RENDERER=cairo MALLOC_PERTURB_=207 GDK_DEBUG=default-settings GSETTINGS_SCHEMA_DIR=/build/gtk4-4.10.5+ds
| /debian/build/deb/gtk G_ENABLE_DIAGNOSTIC=0 TEST_OUTPUT_SUBDIR=wayland GSETTINGS_BACKEND=memory G_TEST_BUILDDIR=/build/gtk4-4.10.5+ds/debian/build/deb/testsuite/gtk LD_LIBRARY_PATH=/build/gtk4-4.10.5+ds/debian/build/deb/gtk
|  GTK_A11Y=test GDK_BACKEND=wayland /build/gtk4-4.10.5+ds/debian/build/deb/testsuite/gtk/templates --tap -k
| TAP version 13
| # random seed: R02S8e710ced91d8200aa7e9c3678e4c2965
| # GLib-GIO-DEBUG: _g_io_module_get_default: Found default implementation memory (GMemorySettingsBackend) for ?gsettings-backend?
| # GLib-DEBUG: setenv()/putenv() are not thread-safe and should not be used after threads are created
| 1..29
| # Start of template tests
| # Start of GtkDialog tests
| # GLib-GIO-DEBUG: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ?gio-vfs?
| ok 1 /template/GtkDialog/basic
| ok 2 /template/GtkDialog/OverrideProperty
| # End of GtkDialog tests
| # Start of GtkMessageDialog tests
| ok 3 /template/GtkMessageDialog/basic
| # End of GtkMessageDialog tests
| # Start of GtkAboutDialog tests
| ok 4 /template/GtkAboutDialog/basic
| ok 5 /template/GtkAboutDialog/show
| # slow test /template/GtkAboutDialog/show executed in 0.52 secs
| # End of GtkAboutDialog tests
| # Start of GtkInfoBar tests
| ok 6 /template/GtkInfoBar/basic
| # End of GtkInfoBar tests
| # Start of GtkLockButton tests
| ok 7 /template/GtkLockButton/basic
| # End of GtkLockButton tests
| # Start of GtkAssistant tests
| ok 8 /template/GtkAssistant/basic
| ok 9 /template/GtkAssistant/show
| # slow test /template/GtkAssistant/show executed in 0.51 secs
| # End of GtkAssistant tests
| # Start of GtkScaleButton tests
| ok 10 /template/GtkScaleButton/basic
| # End of GtkScaleButton tests
| # Start of GtkVolumeButton tests
| ok 11 /template/GtkVolumeButton/basic
| # End of GtkVolumeButton tests
| # Start of GtkStatusBar tests
| ok 12 /template/GtkStatusBar/basic
| # End of GtkStatusBar tests
| # Start of GtkSearchBar tests
| ok 13 /template/GtkSearchBar/basic
| # End of GtkSearchBar tests
| # Start of GtkActionBar tests
| ok 14 /template/GtkActionBar/basic
| # End of GtkActionBar tests
| # Start of GtkAppChooserWidget tests
| ok 15 /template/GtkAppChooserWidget/basic
| # End of GtkAppChooserWidget tests
| # Start of GtkAppChooserDialog tests
| ok 16 /template/GtkAppChooserDialog/basic
| # slow test /template/GtkAppChooserDialog/basic executed in 0.52 secs
| # End of GtkAppChooserDialog tests
| # Start of GtkColorChooserDialog tests
| ok 17 /template/GtkColorChooserDialog/basic
| Gtk-Message: 20:36:10.703: GtkDialog mapped without a transient parent. This is discouraged.
| ok 18 /template/GtkColorChooserDialog/show
| # slow test /template/GtkColorChooserDialog/show executed in 0.54 secs
| # End of GtkColorChooserDialog tests
| # Start of GtkFileChooserWidget tests
| # DEBUG: Error acquiring bus for cloud providers: Cannot autolaunch D-Bus without X11 $DISPLAY
| ok 19 /template/GtkFileChooserWidget/basic
| # End of GtkFileChooserWidget tests
| # Start of GtkFileChooserDialog tests
| ok 20 /template/GtkFileChooserDialog/basic
| Gtk-Message: 20:36:11.700: GtkDialog mapped without a transient parent. This is discouraged.
| ok 21 /template/GtkFileChooserDialog/show
| # slow test /template/GtkFileChooserDialog/show executed in 0.60 secs
| # End of GtkFileChooserDialog tests
| # Start of GtkFontButton tests
| ok 22 /template/GtkFontButton/basic
| # End of GtkFontButton tests
| # Start of GtkFontChooserWidget tests
| ok 23 /template/GtkFontChooserWidget/basic
| # slow test /template/GtkFontChooserWidget/basic executed in 0.80 secs
| # End of GtkFontChooserWidget tests
| # Start of GtkFontChooserDialog tests
| ok 24 /template/GtkFontChooserDialog/basic
| # slow test /template/GtkFontChooserDialog/basic executed in 1.27 secs
| Gtk-Message: 20:36:15.219: GtkDialog mapped without a transient parent. This is discouraged.
| ok 25 /template/GtkFontChooserDialog/show
| # slow test /template/GtkFontChooserDialog/show executed in 1.76 secs
| # End of GtkFontChooserDialog tests
| # Start of GtkPageSetupUnixDialog tests
| ok 26 /template/GtkPageSetupUnixDialog/basic
| Gtk-Message: 20:36:16.143: GtkDialog mapped without a transient parent. This is discouraged.
| Segmentation fault (core dumped)
| (sid-riscv64-sbuild)aurel32 at vf2:/build/gtk4-4.10.5+ds$ gdb /build/gtk4-4.10.5+ds/debian/build/deb/testsuite/gtk/templates core
| GNU gdb (Debian 13.2-1) 13.2
| Copyright (C) 2023 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 "riscv64-linux-gnu".
| Type "show configuration" for configuration details.
| For bug reporting instructions, please see:
| <https://www.gnu.org/software/gdb/bugs/>.
| 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 /build/gtk4-4.10.5+ds/debian/build/deb/testsuite/gtk/templates...
| 
| warning: Can't open file /memfd:gdk-wayland (deleted) during file-backed mapping note processing
| 
| warning: Can't open file /memfd:wayland-cursor (deleted) during file-backed mapping note processing
| [New LWP 935442]
| [New LWP 935445]
| [New LWP 935444]
| [New LWP 935464]
| [Thread debugging using libthread_db enabled]
| Using host libthread_db library "/lib/riscv64-linux-gnu/libthread_db.so.1".
| Core was generated by `/build/gtk4-4.10.5+ds/debian/build/deb/testsuite/gtk/templates --tap -k'.
| Program terminated with signal SIGSEGV, Segmentation fault.
| #0  0x0000003f839b65f6 in gdk_surface_get_display (surface=surface at entry=0x2b02537d50) at ../../../gdk/gdksurface.c:1033
| 1033      g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
| [Current thread is 1 (Thread 0x3f824e7480 (LWP 935442))]
| (gdb) bt full
| #0  0x0000003f839b65f6 in gdk_surface_get_display (surface=surface at entry=0x2b02537d50) at ../../../gdk/gdksurface.c:1033
|         __inst = 0x2b02537d50
|         __t = Python Exception <class 'gdb.error'>: No type named TypeNode.
| 
|         __r = <optimized out>
|         _g_boolean_var_27 = <optimized out>
|         __func__ = "gdk_surface_get_display"
| #1  0x0000003f8396fbc2 in frame_callback (data=0x2b02537d50, callback=0x2b03119030, time=286776601) at ../../../gdk/wayland/gdksurface-wayland.c:255
|         surface = 0x2b02537d50
|         impl = 0x2b02537d50
|         display_wayland = <optimized out>
|         clock = <optimized out>
|         timings = <optimized out>
| #2  0x0000003f82a01264 in  () at /usr/lib/riscv64-linux-gnu/libffi.so.8
| #3  0x0000003f82a00ebe in  () at /usr/lib/riscv64-linux-gnu/libffi.so.8
| #4  0x0000003f82abc91c in  () at /usr/lib/riscv64-linux-gnu/libwayland-client.so.0
| #5  0x0000003f82ab9c9a in  () at /usr/lib/riscv64-linux-gnu/libwayland-client.so.0
| #6  0x0000003f82abae2e in wl_display_dispatch_queue_pending () at /usr/lib/riscv64-linux-gnu/libwayland-client.so.0
| #7  0x0000003f8396993e in _gdk_wayland_display_queue_events (display=0x2b01effe10) at ../../../gdk/wayland/gdkeventsource.c:218
|         display_wayland = 0x2b01effe10
|         source = 0x2b01f01050
|         l = <optimized out>
|         __func__ = "_gdk_wayland_display_queue_events"
| #8  0x0000003f8399df5c in gdk_display_get_event (display=0x2b01effe10) at ../../../gdk/gdkdisplay.c:461
|         __func__ = "gdk_display_get_event"
| #9  0x0000003f8396966c in gdk_event_source_dispatch (base=<optimized out>, callback=<optimized out>, data=<optimized out>) at ../../../gdk/wayland/gdkeventsource.c:138
|         source = <optimized out>
|         display = <optimized out>
|         event = <optimized out>
| #10 0x0000003f8352323c in  () at /usr/lib/riscv64-linux-gnu/libglib-2.0.so.0
| #11 0x0000003f83525972 in  () at /usr/lib/riscv64-linux-gnu/libglib-2.0.so.0
| #12 0x0000003f83525e26 in g_main_context_iteration () at /usr/lib/riscv64-linux-gnu/libglib-2.0.so.0
| #13 0x0000002ad6774f6a in show_and_wait (widget=0x2b021622e0) at ../../../testsuite/gtk/templates.c:47
|         done = 0
|         widget = 0x2b021622e0
|         __func__ = "test_page_setup_unix_dialog_show"
| #14 test_page_setup_unix_dialog_show () at ../../../testsuite/gtk/templates.c:398
|         widget = 0x2b021622e0
|         __func__ = "test_page_setup_unix_dialog_show"
| #15 0x0000003f83545f9e in  () at /usr/lib/riscv64-linux-gnu/libglib-2.0.so.0
| #16 0x0000003f83545e5a in  () at /usr/lib/riscv64-linux-gnu/libglib-2.0.so.0
| #17 0x0000003f83545e5a in  () at /usr/lib/riscv64-linux-gnu/libglib-2.0.so.0
| --Type <RET> for more, q to quit, c to continue without paging--
| #18 0x0000003f83546344 in g_test_run_suite () at /usr/lib/riscv64-linux-gnu/libglib-2.0.so.0
| #19 0x0000003f835463ac in g_test_run () at /usr/lib/riscv64-linux-gnu/libglib-2.0.so.0
| #20 0x0000002ad6773fe0 in main (argc=<optimized out>, argv=<optimized out>) at ../../../testsuite/gtk/templates.c:473
|         __func__ = "main"

The segmentation fault appears because "surface.display" is
0xcfcfcfcfcfcfcfcf, which sounds like some memory poisoning.

I believed that the problem is fully reproducible (running the
individual test like above definitely is), but I start to have some
doubts. It appears that the issue was already present in the latest
builds on the debian-ports archive:

https://buildd.debian.org/status/fetch.php?pkg=gtk4&arch=riscv64&ver=4.10.3%2Bds-1&stamp=1683828518&raw=0
https://buildd.debian.org/status/fetch.php?pkg=gtk4&arch=riscv64&ver=4.10.4%2Bds-1&stamp=1686004425&raw=0
https://buildd.debian.org/status/fetch.php?pkg=gtk4&arch=riscv64&ver=4.10.4%2Bds-2&stamp=1689784927&raw=0

I have also noticed that the issue also appeared on some architectures,
maybe with less probability:

https://buildd.debian.org/status/fetch.php?pkg=gtk4&arch=armel&ver=4.10.3%2Bds-1&stamp=1683820072&raw=0
https://buildd.debian.org/status/fetch.php?pkg=gtk4&arch=mips64el&ver=4.10.5%2Bds-3&stamp=1691410067&raw=0
https://buildd.debian.org/status/fetch.php?pkg=gtk4&arch=mipsel&ver=4.10.5%2Bds-3&stamp=1691412439&raw=0

I have used lower version for which the issue appeared, but if it is
more or less random, it could be something even older, or a bug
somewhere else in the stack.

Any ideas about the issue or how to debug it is welcome.

Regards
Aurelien



More information about the pkg-gnome-maintainers mailing list