appstream icon indicating copy to clipboard operation
appstream copied to clipboard

Segfault on shutdown due to thread building meta data cache still running

Open agx opened this issue 6 months ago • 3 comments

Symptoms: phosh test case the involves building the meta data cache segfaults sporadically when built with clang.

Details: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1240

Backtrace: https://gitlab.gnome.org/-/project/16747/uploads/bcccb0e53f4315a7b0027b7e1adf1130/backtrace-all-threads-2.txt

As far as I can tell we're cancelling correctly but it seems as_pool_update_desktop_entries_table is not being terminated. I think
as_pool_load_thread needs to call g_task_set_return_on_cancel`. @ximion if that makes sense I could look at a fix.

agx avatar Jun 22 '25 10:06 agx

Hmm... It does make some sense, however, I wonder if this isn't actually the bug fixed in https://github.com/ximion/appstream/commit/d4fbd569cb3f659a67ce85c6df159d8fbdce2821 instead. Which version of AppStream are you using? Anything >= 1.0.4 should have this fixed.

ximion avatar Sep 30 '25 22:09 ximion

No idea which version but from what @CyberTailor usually reports I'd assume pretty recent.

I've asked the reporter in the corresponding phosh issue to follow up here.

agx avatar Oct 01 '25 06:10 agx

That makes sense, thank you! :-)

I have not been able to reproduce this, but given that it's intermittent, that may not mean much (I also have only tried with the most recent version of AppStream).

ximion avatar Oct 02 '25 13:10 ximion