GTK4 system monitor crashes when switching to the "Resources" tab (and on subsequent startups) under Wayland
On my computer (with open source AMD Radeon graphics with the Wayland GNOME 45 session on Fedora 39; I have a dual-monitors setup, if that changes anything), a freshly built GTK4 version of system monitor from main
will crash whenever it tries to show the "Resources" tab.
Context, steps to reproduction, backtrace
I built g-s-m from a fresh checkout of main
using GNOME Builder; since I had never done this before, the flatpak it created was fresh and never had any user settings in it, so the first time I launched the app it worked... then as soon as I clicked the "Resources" tab it crashed, and when I launched again it crashed on startup (and any subsequent startup), presumably because it remembered that it wanted to start with the "Resources" tab this time. So this is probably related to the graphs.
Here is the gdb backtrace from GNOME Builder.
Click to expand
```
Thread 1 "gnome-system-mo" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
44 return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
> bt full
#0 __pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
tid =
ret = 0
pd =
old_mask = {__val = {3}}
ret =
#1 0x00007ffff5aae8a3 in __pthread_kill_internal (signo=6, threadid=) at pthread_kill.c:78
#2 0x00007ffff5a5c8ee in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
ret =
#3 0x00007ffff5a448ff in __GI_abort () at abort.c:79
save_stage = 1
act = {__sigaction_handler = {sa_handler = 0x20, sa_sigaction = 0x20}, sa_mask = {__val = {4096, 2, 140737285312704, 140737487353408, 140737314908958, 14, 18281625, 1, 4294967300480, 1000, 0, 0, 4096, 0, 1698453984, 912734148}}, sa_flags = 1698453984, sa_restorer = 0x366737c4}
#4 0x00007ffff5a457d0 in __libc_message (fmt=fmt@entry=0x7ffff5bc2309 "*** %s ***: terminated\n") at ../sysdeps/posix/libc_fatal.c:150
ap = {{gp_offset = 16, fp_offset = 0, overflow_arg_area = 0x7ffffff0b740, reg_save_area = 0x7ffffff0b6d0}}
fd = 2
list =
nlist =
cp =
#5 0x00007ffff5b41cd9 in __GI___fortify_fail (msg=msg@entry=0x7ffff5bc22f0 "buffer overflow detected") at fortify_fail.c:24
#6 0x00007ffff5b41694 in __GI___chk_fail () at chk_fail.c:28
#7 0x00007ffff5b41f25 in __fread_chk (ptr=0x7ffffff0ba00, ptrlen=, size=1, n=18446744073709551615, stream=0xf23760) at fread_chk.c:39
bytes_requested = 18446744073709551615
bytes_read =
#8 0x00007ffff7c7eb5f in glibtop_get_disk_s () at /lib64/libgtop-2.0.so.11
#9 0x00007ffff7c826fe in glibtop_get_disk_l () at /lib64/libgtop-2.0.so.11
#10 0x00000000004969f5 in get_disk(LoadGraph*) (graph=0xe885a0) at ../dev/gnome-system-monitor/src/load-graph.cpp:936
disk = {flags = 0, xdisk_sectors_read = {0 }, xdisk_time_read = {0 }, xdisk_sectors_write = {0 }, xdisk_time_write = {0 }, xdisk_flags = 0}
i = 0
read = 0
write = 0
#11 0x0000000000496be8 in load_graph_update_data(LoadGraph*) (graph=0xe885a0) at ../dev/gnome-system-monitor/src/load-graph.cpp:981
__PRETTY_FUNCTION__ = "void load_graph_update_data(LoadGraph*)"
#12 0x0000000000497f0b in load_graph_start(LoadGraph*) (graph=0xe885a0) at ../dev/gnome-system-monitor/src/load-graph.cpp:1181
#13 0x0000000000492231 in update_page_activities(GsmApplication*) (app=0x796650) at ../dev/gnome-system-monitor/src/interface.cpp:747
current_page = 0x7ea300 "resources"
#14 (closed) 0x0000000000492c30 in create_main_window(GsmApplication*) (app=0x796650) at ../dev/gnome-system-monitor/src/interface.cpp:951
display = 0x55c940 [GdkWaylandDisplay]
monitor = 0x5176d0 [GdkWaylandMonitor]
monitor_geometry = {x = 0, y = 0, width = 1920, height = 1080}
surface = 0xf7bf80 [GdkWaylandToplevel]
builder = 0x827360 [GtkBuilder]
native = 0x87c460
err = 0x0
width = 700
height = 500
win_action_entries = {{name = 0x4ccb34 "about", activate = 0x491694 , parameter_type = 0x0, state = 0x0, change_state = 0x0, padding = {0, 0, 0}}, {name = 0x4ccb3a "show-help-overlay", activate = 0x491868 , parameter_type = 0x0, state = 0x0, change_state = 0x0, padding = {0, 0, 0}}, {name = 0x4ccb4c "search", activate = 0x491b8b , parameter_type = 0x0, state = 0x0, change_state = 0x0, padding = {0, 0, 0}}, {name = 0x4ccb53 "send-signal-stop", activate = 0x49199b , parameter_type = 0x4ccb64 "i", state = 0x0, change_state = 0x0, padding = {0, 0, 0}}, {name = 0x4ccb66 "send-signal-cont", activate = 0x49199b , parameter_type = 0x4ccb64 "i", state = 0x0, change_state = 0x0, padding = {0, 0, 0}}, {name = 0x4ccb77 "send-signal-term", activate = 0x49199b , parameter_type = 0x4ccb64 "i", state = 0x0, change_state = 0x0, padding = {0, 0, 0}}, {name = 0x4ccb88 "send-signal-kill", activate = 0x49199b , parameter_type = 0x4ccb64 "i", state = 0x0, change_state = 0x0, padding = {0, 0, 0}}, {name = 0x4ccb99 "priority", activate = 0x491e79 , parameter_type = 0x4ccb64 "i", state = 0x4ccba2 "@i 0", change_state = 0x491ef6 , padding = {0, 0, 0}}, {name = 0x4ccba7 "set-affinity", activate = 0x491a14 , parameter_type = 0x0, state = 0x0, change_state = 0x0, padding = {0, 0, 0}}, {name = 0x4ccbb4 "memory-maps", activate = 0x491a3f , parameter_type = 0x0, state = 0x0, change_state = 0x0, padding = {0, 0, 0}}, {name = 0x4ccbc0 "open-files", activate = 0x491a6a , parameter_type = 0x0, state = 0x0, change_state = 0x0, padding = {0, 0, 0}}, {name = 0x4ccbcb "process-properties", activate = 0x491a95 , parameter_type = 0x0, state = 0x0, change_state = 0x0, padding = {0, 0, 0}}, {name = 0x4ccbde "refresh", activate = 0x4918cf , parameter_type = 0x0, state = 0x0, change_state = 0x0, padding = {0, 0, 0}}, {name = 0x4ccbe6 "show-page", activate = 0x491ac0 , parameter_type = 0x4ccbf0 "s", state = 0x4ccbf2 "'resources'", change_state = 0x491bda , padding = {0, 0, 0}}, {name = 0x4cc99e "show-whose-processes", activate = 0x491ac0 , parameter_type = 0x4ccbf0 "s", state = 0x4ccbfe "'all'", change_state = 0x491ce5 , padding = {0, 0, 0}}, {name = 0x4cc9b3 "show-dependencies", activate = 0x491b00 , parameter_type = 0x0, state = 0x4ccc04 "false", change_state = 0x491daf , padding = {0, 0, 0}}}
action = 0xf34930
#15 0x00000000004777c4 in GsmApplication::on_startup() (this=0x796650) at ../dev/gnome-system-monitor/src/application.cpp:585
style_manager = 0x647770
action = std::shared_ptr (use count 1, weak count 0) = {get() = 0x6873d0}
builder = std::shared_ptr (use count 1, weak count 0) = {get() = 0x704350}
```