Crash under gs_flatpak_refine_wildcard()
Moving this from a downstream bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=2203403
Version-Release number of selected component:
gnome-software-44.1-1.fc38
Backtrace
Core was generated by `/usr/bin/gnome-software --gapplication-service'.
Program terminated with signal SIGABRT, Aborted.
#0 __pthread_kill_implementation (threadid=<optimized out>, 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;
[Current thread is 1 (Thread 0x7fcdb59fe6c0 (LWP 3573))]
Thread 1 (Thread 0x7fcdb59fe6c0 (LWP 3573)):
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
tid = <optimized out>
ret = 0
pd = <optimized out>
old_mask = {__val = {16}}
ret = <optimized out>
#1 0x00007fcdd60c28b3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2 0x00007fcdd6071abe in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
ret = <optimized out>
#3 0x00007fcdd605a87f in __GI_abort () at abort.c:79
save_stage = 1
act = {__sigaction_handler = {sa_handler = 0x20, sa_sigaction = 0x20}, sa_mask = {__val = {140522050422933, 0, 1030159384632205312, 140521492173808, 18446744073709551496, 0, 140521272142272, 140521508774195, 140521492173824, 140521492173776, 140522036203982, 140521272142288, 0, 0, 140521272142288, 114}}, sa_flags = -688619960, sa_restorer = 0x7fcdb59fd3f0}
#4 0x00007fcdd6e1ff4e in g_assertion_message (domain=domain@entry=0x7fcdb69d4b49 "flatpak", file=file@entry=0x7fcdb69d2133 "../common/flatpak-ref-utils.c", line=line@entry=931, func=func@entry=0x7fcdb69d30a0 <__func__.1> "flatpak_decomposed_new_from_parts", message=message@entry=0x7fcda89fc900 "assertion failed: (id != NULL)") at ../glib/gtestutils.c:3450
lstr = "931\000\000\000\000\000\360\310\237\250\315\177", '\000' <repeats 17 times>
s = 0x7fcda88269d0 "\366\006[T\312\177"
#5 0x00007fcdd6e8a437 in g_assertion_message_expr (domain=domain@entry=0x7fcdb69d4b49 "flatpak", file=file@entry=0x7fcdb69d2133 "../common/flatpak-ref-utils.c", line=line@entry=931, func=func@entry=0x7fcdb69d30a0 <__func__.1> "flatpak_decomposed_new_from_parts", expr=expr@entry=0x7fcdb69cf119 "id != NULL") at ../glib/gtestutils.c:3476
s = 0x7fcda89fc900 "assertion failed: (id != NULL)"
#6 0x00007fcdb6986da6 in flatpak_decomposed_new_from_parts (kind=<optimized out>, id=<optimized out>, arch=<optimized out>, branch=<optimized out>, error=<optimized out>) at ../common/flatpak-ref-utils.c:931
__func__ = "flatpak_decomposed_new_from_parts"
#7 0x00007fcdb6974e8f in flatpak_installation_fetch_remote_ref_sync_full (self=self@entry=0x7fcda80094b0, remote_name=remote_name@entry=0x7fcda8a1d390 "fedora", kind=FLATPAK_REF_KIND_APP, name=name@entry=0x0, arch=arch@entry=0x0, branch=branch@entry=0x0, flags=FLATPAK_QUERY_FLAGS_NONE, cancellable=0x5645ee1fca20, error=0x7fcdb59fd5d0) at ../common/flatpak-installation.c:2546
dir = 0x7fcda80033f0
ht = 0x0
state = 0x0
ref = 0x0
checksum = <optimized out>
#8 0x00007fcdb6975089 in flatpak_installation_fetch_remote_ref_sync (self=self@entry=0x7fcda80094b0, remote_name=remote_name@entry=0x7fcda8a1d390 "fedora", kind=<optimized out>, name=name@entry=0x0, arch=arch@entry=0x0, branch=branch@entry=0x0, cancellable=0x5645ee1fca20, error=0x7fcdb59fd5d0) at ../common/flatpak-installation.c:2502
#9 0x00007fcdb726db2a in gs_plugin_refine_item_origin (self=self@entry=0x7fcda800f360, app=app@entry=0x7fcda8877bd0, interactive=interactive@entry=0, cancellable=cancellable@entry=0x5645ee1fca20, error=error@entry=0x7fcdb59fd8f8) at ../plugins/flatpak/gs-flatpak.c:2348
remote_name = 0x7fcda8a1d390 "fedora"
xremote = 0x7fcda8834eb0
xref = 0x0
error_local = 0x0
i = 0
ref_display = 0x0
xremotes = 0x7fcda887db70
installation = 0x7fcda80094b0
#10 0x00007fcdb726de99 in gs_flatpak_refine_app_state_unlocked (self=self@entry=0x7fcda800f360, app=app@entry=0x7fcda8877bd0, interactive=interactive@entry=0, cancellable=cancellable@entry=0x5645ee1fca20, error=error@entry=0x7fcdb59fd8f8) at ../plugins/flatpak/gs-flatpak.c:2416
ref = 0x0
installed_refs = 0x0
installation = 0x7fcda80094b0
#11 0x00007fcdb7270a11 in gs_flatpak_refine_app_unlocked (self=0x7fcda800f360, app=0x7fcda8877bd0, flags=3145760, interactive=0, locker=0x7fcdb59fd7e0, cancellable=0x5645ee1fca20, error=0x7fcdb59fd8f8) at ../plugins/flatpak/gs-flatpak.c:3455
old_state = GS_APP_STATE_UNKNOWN
local_error = 0x0
#12 0x00007fcdb72744de in gs_flatpak_refine_wildcard (self=0x7fcda800f360, app=app@entry=0x7fcda887e9d0, list=list@entry=0x5645ee569330, refine_flags=refine_flags@entry=3145760, interactive=interactive@entry=0, cancellable=cancellable@entry=0x5645ee1fca20, error=0x7fcdb59fd8f8) at ../plugins/flatpak/gs-flatpak.c:3675
GsProfilerFlatpakRefineWildcardRefineNewApp = {begin_time = 24167310033, name = 0x7fcda884a270 "Flatpak (refine new app)", description = 0x0}
ScopedGsProfilerTraceHeadFlatpakRefineWildcardRefineNewApp = 0x7fcdb59fd840
component = <optimized out>
new = 0x7fcda8877bd0
i = 0
GsProfilerFlatpakRefineWildcardGenerateApps = {begin_time = 24167155090, name = 0x7fcda886f060 "Flatpak (create app)", description = 0x0}
ScopedGsProfilerTraceHeadFlatpakRefineWildcardGenerateApps = 0x7fcdb59fd820
GsProfilerFlatpakRefineWildcard = {begin_time = 24165195991, name = 0x7fcda8a4ac10 "Flatpak (refine wildcard)", description = 0x0}
ScopedGsProfilerTraceHeadFlatpakRefineWildcard = 0x7fcdb59fd800
id = <optimized out>
xpath = 0x7fcda8879f40 "components/component/id[text()='org.freedesktop.Platform']/.."
error_local = 0x0
components = 0x7fcda887ae30
locker = 0x7fcda800f3d0
#13 0x00007fcdb727c624 in refine_thread_cb (task=0x5645eec46ec0, source_object=0x5645ee3d6ce0, task_data=<optimized out>, cancellable=0x5645ee1fca20) at ../plugins/flatpak/gs-plugin-flatpak.c:724
app = 0x7fcda887e9d0
j = 444
list = 0x5645ee569330
flags = 3145760
interactive = 0
app_list = <optimized out>
local_error = 0x0
__func__ = "refine_thread_cb"
#14 0x00007fcdd72be3e3 in work_run_cb (_data=_data@entry=0x5645ee571d70) at ../lib/gs-worker-thread.c:236
data = 0x5645ee571d70
task = 0x5645eec46ec0
source_object = 0x5645ee3d6ce0
task_data = 0x5645ee571d50
cancellable = 0x5645ee1fca20
#15 0x00007fcdd6e5839d in g_idle_dispatch (source=0x5645ee571de0, callback=0x7fcdd72be390 <work_run_cb>, user_data=0x5645ee571d70) at ../glib/gmain.c:6163
idle_source = 0x5645ee571de0
again = <optimized out>
#16 0x00007fcdd6e5c39c in g_main_dispatch (context=0x5645ee41c230) at ../glib/gmain.c:3460
dispatch = 0x7fcdd6e58370 <g_idle_dispatch>
prev_source = 0x0
begin_time_nsec = 22961758004
was_in_call = 0
user_data = 0x5645ee571d70
callback = 0x7fcdd72be390 <work_run_cb>
cb_funcs = 0x7fcdd6f47380 <g_source_callback_funcs>
cb_data = 0x7fcda88d2ad0
need_destroy = <optimized out>
source = 0x5645ee571de0
current = 0x7fcda8000bf0
i = 2
#17 g_main_context_dispatch (context=0x5645ee41c230) at ../glib/gmain.c:4200
#18 0x00007fcdd6eba438 in g_main_context_iterate.isra.0 (context=0x5645ee41c230, block=1, dispatch=1, self=<optimized out>) at ../glib/gmain.c:4276
max_priority = 300
timeout = 0
some_ready = 1
nfds = 1
allocated_nfds = <optimized out>
fds = <optimized out>
begin_time_nsec = 22528154507
#19 0x00007fcdd6e59a23 in g_main_context_iteration (context=0x5645ee41c230, may_block=may_block@entry=1) at ../glib/gmain.c:4343
retval = <optimized out>
#20 0x00007fcdd72bbfce in thread_cb (data=0x5645ee41c1f0) at ../lib/gs-worker-thread.c:175
self = 0x5645ee41c1f0
#21 0x00007fcdd6e8a893 in g_thread_proxy (data=0x5645ee4160c0) at ../glib/gthread.c:831
thread = 0x5645ee4160c0
__func__ = "g_thread_proxy"
#22 0x00007fcdd60c0907 in start_thread (arg=<optimized out>) at pthread_create.c:444
ret = <optimized out>
pd = <optimized out>
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140522036135440, 4078025183679598313, 140521492178624, -120, 11, 140723125312896, 4078025183591517929, 4078230928009187049}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <optimized out>
#23 0x00007fcdd6146870 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Looking in the code, it seems to me like the gs_flatpak_refine_wildcard
expects gs_appstream_create_app
returning a previously cached app within the plugin, but the plugin cache could be cleared due to the flatpak changes, thus the returned app
instance is a new one, without having set flatpak::RefName
, which causes the flatpak functions being called with NULL
name
parameter, which triggers this assert.