Crash when loading meta for local flatpak repo with appstream branch
@mjog
Submitted by Michael James Gratton Assigned to Richard Hughes @hughsie
Link to original bug (#788125)
Description
I'm getting a crash running gnome-software after adding a local flatpack repo that has an appstream branch.
The general setup is:
mkdir repo
mkdir geary-flatpak
flatpak-builder geary-flatpak gnome-apps-nightly/org.gnome.Geary.json
flatpak build-export repo geary-flatpak --update-appstream
flatpak build-update-repo repo
flatpak remote-add --no-gpg-verify geary-dev repo
Then running gnome-software, it reports in the UI "Getting flatpak metadata for geary-dev", and crashes.
The crash doesn't happen if "--update-appstream" is omitted from the build-export command.
Verbose logs and stack trace from the crash:
[snip]
10:41:12:0061 GsPluginFlatpak geary-dev is 4294967295 seconds old, so downloading new data
10:41:12:0061 As run 0x555555993190~GsFlatpak-system-default::refresh-appstream{geary-dev}
10:41:12:0061 Gs emitting downloading(flatpak)
10:41:12:0129 OSTree starting fetch of cc2ddb17b9ca1d3f19ca7ab17dbd565d59152bccf76a21daa061e4d8ba53db54.commit (detached)
10:41:12:0129 OSTree fetch of cc2ddb17b9ca1d3f19ca7ab17dbd565d59152bccf76a21daa061e4d8ba53db54.commit (detached) complete
10:41:12:0129 OSTree pull: idle, exiting mainloop
10:41:12:0209 GLib g_bytes_get_size: assertion 'bytes != NULL' failed
10:41:12:0209 GLib g_bytes_get_data: assertion 'bytes != NULL' failed
10:41:12:0209 GLib-GIO g_file_replace_contents: assertion 'contents != NULL' failed
Thread 5 "pool" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffceeaa700 (LWP 20537)]
0x00007fffd2682ba5 in gs_flatpak_refresh_appstream (self=self@entry=0x555555d5a5e0,
cache_age=cache_age@entry=4294967295, flags=flags@entry=1,
cancellable=cancellable@entry=0x5555576d8b30, error=error@entry=0x7fffceea99c8)
at ../plugins/flatpak/gs-flatpak.c:671
671 ../plugins/flatpak/gs-flatpak.c: No such file or directory.
(gdb)
(gdb) bt
#0 0x00007fffd2682ba5 in gs_flatpak_refresh_appstream (self=self@entry=0x555555d5a5e0, cache_age=cache_age@entry=4294967295, flags=flags@entry=1, cancellable=cancellable@entry=0x5555576d8b30, error=error@entry=0x7fffceea99c8) at ../plugins/flatpak/gs-flatpak.c:671
#1 0x00007fffd2684240 in gs_flatpak_refresh (self=0x555555d5a5e0, cache_age=cache_age@entry=4294967295, flags=flags@entry=1, cancellable=cancellable@entry=0x5555576d8b30, error=error@entry=0x7fffceea99c8) at ../plugins/flatpak/gs-flatpak.c:1205
#2 0x00007fffd2689717 in gs_plugin_refresh (plugin=plugin@entry=0x555555b634c0, cache_age=4294967295, flags=flags@entry=1, cancellable=cancellable@entry=0x5555576d8b30, error=error@entry=0x7fffceea99c8) at ../plugins/flatpak/gs-plugin-flatpak.c:270
#3 0x00005555555c5992 in gs_plugin_loader_call_vfunc (helper=helper@entry=0x555558736f60, plugin=plugin@entry=0x555555b634c0, app=app@entry=0x0, list=<optimised out>,
list@entry=0x0, cancellable=cancellable@entry=0x5555576d8b30, error=error@entry=0x7fffceea9ad8) at ../lib/gs-plugin-loader.c:680
#4 0x00005555555c5b3d in gs_plugin_loader_run_results (helper=helper@entry=0x555558736f60, cancellable=cancellable@entry=0x5555576d8b30, error=error@entry=0x7fffceea9ad8)
at ../lib/gs-plugin-loader.c:1083
#5 0x00005555555c734a in gs_plugin_loader_process_thread_cb (task=0x55555873f6a0, object=0x5555558969c0, task_data=0x555558736f60, cancellable=0x5555576d8b30)
at ../lib/gs-plugin-loader.c:3054
#6 0x00007ffff70e8cf6 in () at /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#7 0x00007ffff7469fd0 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8 0x00007ffff7469605 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9 0x00007ffff47337fc in start_thread (arg=0x7fffceeaa700) at pthread_create.c:465
#10 0x00007ffff4460a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95