KService: Review/remove KCrash dependency
Open, Needs TriagePublic

Description

only thing that makes it tier3

Related Objects

StatusAssignedTask
OpenNone
OpenNone
mart created this task.Nov 23 2019, 4:47 PM
mart renamed this task from Review/remove KCrash dependency to KService: Review/remove KCrash dependency.
alex added subscribers: dfaure, alex.Aug 9 2021, 4:22 PM
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*.

alex added a comment.Aug 10 2021, 9:27 AM

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.

alex moved this task from Backlog to Done on the KF6 board.Aug 23 2021, 2:44 PM

Done with dfaure's MR