only thing that makes it tier3
Description
Status | Assigned | Task | ||
---|---|---|---|---|
Open | None | T12171 Meta task: KService | ||
Open | None | T12172 KService: Review/remove KCrash dependency |
static void crashHandler(int) { // If we crash while reading sycoca, we delete the database // in an attempt to recover. if (KBuildSycoca::sycocaPath()) { unlink(KBuildSycoca::sycocaPath()); } }
I guess the crash handler makes sense to have, otherwise one could end up with an unfixable, broken setup.
@dfaure Thoughts?
Right.
Well, one can implement a crash handler without using KCrash... A simple sigaction should do. This would also be an opportunity to make sure no memory allocation happens in the signal handler (I bet unlink converts the QString to an 8-bit char* down the line), by storing the sycoca path into a static char*.
The way I see it we would need to duplicate some code from KCrash::setEmergencySaveFunction. Maybe you could do a MR? I am pretty sure you are more familiar with this than me :)
Done in https://invent.kde.org/frameworks/kservice/-/merge_requests/54
I was wrong about sycocaPath(), it already returns a static char *, all good there.