GtkFileChooserNative crashes with certain file-filters when used from Flatpak
Try to open a file using either a menu option or just by pressing Ctrl+O. It will crash immediately:
#0 gtk_file_filter_to_gvariant (filter=0x55e72a0c8b50)
at ../gtk/gtkfilefilter.c:832
832 FilterRule *rule = l->data;
[Current thread is 1 (Thread 0x7f54ab9e1e00 (LWP 2))]
(gdb) bt full
#0 0x00007f54ace5de89 in gtk_file_filter_to_gvariant (filter=0x55e72a0c8b50) at ../gtk/gtkfilefilter.c:832
rule = <optimized out>
builder =
{u = {s = {partial_magic = 0, type = 0x55e72a16bfa0, y = {94451331940257, 0, 0, 18446744073709551615, 94451331383968, 8, 0, 3, 1033660112, 0, 0, 0, 0, 0}}, x = {0, 94451331940256, 94451331940257, 0, 0, 18446744073709551615, 94451331383968, 8, 0, 3, 1033660112, 0, 0, 0, 0, 0}}}
l = Python Exception <class 'gdb.MemoryError'> Cannot access memory at address 0x100000006:
#1 0x00007f54ace4d191 in get_filters (self=<optimized out>) at ../gtk/gtkfilechoosernativeportal.c:276
filter = <optimized out>
l = 0x55e729c17e90 = {0x55e72a0c8b50, 0x7f54a00022a0}
builder =
{u = {s = {partial_magic = 0, type = 0x55e729da62a0, y = {94451327984289, 0, 0, 18446744073709551615, 94451325637168, 8, 0, 3, 1033660112, 0, 0, 0, 0, 0}}, x = {0, 94451327984288, 94451327984289, 0, 0, 18446744073709551615, 94451325637168, 8, 0, 3, 1033660112, 0, 0, 0, 0, 0}}}
data = 0x55e729ddbcf0
message = 0x55e729dca540 [GDBusMessage]
opt_builder =
{u = {s = {partial_magic = 0, type = 0x55e72a164fe0, y = {94451331911649, 140001371302640, 0, 18446744073709551615, 94451328204192, 8, 6, 3, 1033660112, 0, 0, 0, 0, 0}}, x = {0, 94451331911648, 94451331911649, 140001371302640, 0, 18446744073709551615, 94451328204192, 8, 6, 3, 1033660112, 0, 0, 0, 0, 0}}}
multiple = <optimized out>
directory = 0
title = <optimized out>
token = 0x55e72a1426e0 "directory"
#2 0x00007f54ace4d191 in show_portal_file_chooser
(self=0x7f54a0005020 [GtkFileChooserNative], parent_window_str=0x55e72a163cf0 "wayland:V D_=Jy%2gz!HRMW1rC8eO`[2N4i^'8`") at ../gtk/gtkfilechoosernativeportal.c:370
data = 0x55e729ddbcf0
message = 0x55e729dca540 [GDBusMessage]
opt_builder =
{u = {s = {partial_magic = 0, type = 0x55e72a164fe0, y = {94451331911649, 140001371302640, 0, 18446744073709551615, 94451328204192, 8, 6, 3, 1033660112, 0, 0, 0, 0, 0}}, x = {0, 94451331911648, 94451331911649, 140001371302640, 0, 18446744073709551615, 94451328204192, 8, 6, 3, 1033660112, 0, 0, 0, 0, 0}}}
multiple = <optimized out>
directory = 0
title = <optimized out>
token = 0x55e72a1426e0 "directory"
#3 0x00007f54ad04c81b in wayland_window_handle_exported
(window=<optimized out>, wayland_handle_str=<optimized out>, user_data=0x55e72a156600)
at ../gtk/gtkwindow.c:12941
data = 0x55e72a156600
handle_str = 0x55e72a163cf0 "wayland:V D_=Jy%2gz!HRMW1rC8eO`[2N4i^'8`"
#4 0x00007f54acc1bc15 in invoke_exported_closures (window=0x55e7299de9f0 [GdkWaylandWindow])
at ../gdk/wayland/gdkwindow-wayland.c:5051
closure = 0x55e72a1594d0
impl = 0x55e7296ba5c0 [GdkWindowImplWayland]
l = 0x55e729ddd740 = {0x55e72a1594d0}
#5 0x00007f54ac81af75 in ffi_call_unix64 () at ../src/x86/unix64.S:101
#6 0x00007f54ac81a369 in ffi_call_int
(cif=<optimized out>, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=<optimized out>) at ../src/x86/ffi64.c:669
classes = {X86_64_INTEGER_CLASS, X86_64_NO_CLASS, 701752032, 21991}
stack = <optimized out>
argp = 0x7ffdb25fb660 ""
arg_types = <optimized out>
gprcount = 3
ssecount = <optimized out>
ngpr = 1
nsse = 0
i = <optimized out>
avn = <optimized out>
flags = <optimized out>
reg_args = <optimized out>
#7 0x00007f54ac0bf7c2 in wl_closure_invoke (closure=closure@entry=0x55e729d3e2e0, flags=flags@entry=1, target=<optimized out>, target@entry=0x55e729ddbd40, opcode=opcode@entry=0, data=<optimized out>) at ../src/connection.c:1018
count = 1
cif = {abi = FFI_UNIX64, nargs = 3, arg_types = 0x7ffdb25fb7d0, rtype = 0x7f54ac81c180 <ffi_type_void>, bytes = 0, flags = 0}
ffi_types = {0x7f54ac81c060 <ffi_type_pointer>, 0x7f54ac81c060 <ffi_type_pointer>, 0x7f54ac81c060 <ffi_type_pointer>, 0x7f54ac81c0c0 <ffi_type_sint32>, 0x7f54ac81c0c0 <ffi_type_sint32>, 0x7f54ac9bd992 <__libc_recvmsg+98>, 0x4, 0x4c, 0x7ffdb25fb880, 0x4000004000000000, 0x0, 0x7f54ac0bffc6 <wl_os_recvmsg_cloexec+38>, 0x55e72a0a26f0, 0x7ffdb25fb880, 0x55e729664e40, 0x55e7296abd80, 0x55e7296abd18, 0x7ffdb25fba68, 0x7f54acc11290 <gdk_event_source_check>, 0x7f54ac0be21b <wl_connection_read+235>, 0xd00000010, 0x55e7296add90}
ffi_args = {0x7ffdb25fb790, 0x7ffdb25fb798, 0x55e729d3e2f8, 0x55e729933130, 0x55e729933138, 0x0, 0x7f54acca2150 <zxdg_exported_v1_events>, 0x7f54acc717d5, 0x0, 0x7f54ac0be728 <wl_closure_init+216>, 0x296abd73, 0xd850ae935bd49a00, 0x55e7296abc30, 0x32, 0x0, 0x55e7296abd80, 0x30, 0x7f54ac0bf0e3 <wl_connection_demarshal+243>, 0x55e729d3e3e0, 0x55e7296abd80, 0x55e729d3e3b0, 0x55e729d3e2e0}
implementation = <optimized out>
#8 0x00007f54ac0bbdaa in dispatch_event (display=display@entry=0x55e7296abc30, queue=0x55e7296abd00, queue=<optimized out>) at ../src/wayland-client.c:1445
closure = 0x55e729d3e2e0
proxy = 0x55e729ddbd40
opcode = 0
proxy_destroyed = <optimized out>
#9 0x00007f54ac0bd49c in dispatch_queue (queue=0x55e7296abd00, display=0x55e7296abc30) at ../src/wayland-client.c:1591
count = 2
ret = <optimized out>
#10 0x00007f54ac0bd49c in wl_display_dispatch_queue_pending (display=0x55e7296abc30, queue=0x55e7296abd00) at ../src/wayland-client.c:1833
ret = <optimized out>
#11 0x00007f54ac0bd4f0 in wl_display_dispatch_pending (display=<optimized out>) at ../src/wayland-client.c:1896
#12 0x00007f54acc1158b in _gdk_wayland_display_queue_events (display=<optimized out>) at ../gdk/wayland/gdkeventsource.c:201
display_wayland = <optimized out>
source = 0x55e7296bd490
__func__ = "_gdk_wayland_display_queue_events"
#13 0x00007f54acbd7bb4 in gdk_display_get_event (display=display@entry=0x55e7296b20d0 [GdkWaylandDisplay]) at ../gdk/gdkdisplay.c:441
__func__ = "gdk_display_get_event"
#14 0x00007f54acc11266 in gdk_event_source_dispatch (base=<optimized out>, callback=<optimized out>, data=<optimized out>) at ../gdk/wayland/gdkeventsource.c:120
source = <optimized out>
display = 0x55e7296b20d0 [GdkWaylandDisplay]
event = <optimized out>
#15 0x00007f54ad52af0b in g_main_dispatch (context=0x55e729664e40) at ../glib/gmain.c:3332
dispatch = 0x7f54acc11250 <gdk_event_source_dispatch>
prev_source = 0x0
begin_time_nsec = 0
was_in_call = 0
user_data = 0x0
callback = 0x0
cb_funcs = <optimized out>
cb_data = <optimized out>
need_destroy = <optimized out>
source = 0x55e7296bd490
current = 0x55e729670f10
i = 0
__func__ = "g_main_dispatch"
#16 0x00007f54ad52af0b in g_main_context_dispatch (context=0x55e729664e40) at ../glib/gmain.c:4023
#17 0x00007f54ad52b1b8 in g_main_context_iterate (context=context@entry=0x55e729664e40, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4099
max_priority = 200
timeout = 0
some_ready = 1
nfds = <optimized out>
allocated_nfds = <optimized out>
fds = 0x55e729ce3480
#18 0x00007f54ad52b283 in g_main_context_iteration (context=context@entry=0x55e729664e40, may_block=may_block@entry=1) at ../glib/gmain.c:4164
retval = <optimized out>
#19 0x00007f54ad7508ad in g_application_run (application=0x55e729634130 [EditorApplication], argc=-1302348940, argc@entry=2, argv=argv@entry=0x7ffdb25fbcd8) at ../gio/gapplication.c:2559
arguments = 0x55e72969dfe0
status = 0
context = 0x55e729664e40
acquired_context = <optimized out>
__func__ = "g_application_run"
#20 0x000055e728c88b3c in main (argc=2, argv=0x7ffdb25fbcd8) at ../src/main.c:41
app = 0x55e729634130
ret = <optimized out>