<div dir="ltr">Hi!<br><br><div>Would be possible to put this info into the docs, if it isn't already there?</div><div><br></div><div>I believe this is really important and deserves a spotlight on the docs.<br></div><div>Thoughts on that?<br></div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,<br></div>Magno Lomardo<br></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 8, 2024 at 11:24 AM Nicolas Fella <<a href="mailto:nicolas.fella@gmx.de">nicolas.fella@gmx.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
TL;DR: Call KCrash::initialize() after setting up KAboutData<br>
<br>
crash reporting via DrKonqi to Bugzilla and Sentry is powered by the<br>
KCrash framework, which acts as the crash handler inside the application.<br>
<br>
To install the crash handler you need to call KCrash::initialize() in<br>
your application's main function. Since the crash handler relies on<br>
information from KAboutData you should do it after the call to<br>
KAboutData::setApplicationData(). For best results make sure to include<br>
the application version in the about data.<br>
<br>
You can verify that it is working correctly by doing "killall -SEGV<br>
myapp" and checking that DrKonqi appears and lets you submit a report.<br>
<br>
Why am I sending this now? Some background:<br>
<br>
In KF5 linking against KF5::Crash would automatically install the crash<br>
handler for your application even without the explicity<br>
KCrash::initalize(). This approach had some caveats:<br>
<br>
- It doesn't work when linking with -as-needed, which is the default in<br>
some distributions<br>
<br>
- Similarly it won't work with static builds<br>
<br>
- It can result in the crash handler being installed for non-KDE apps<br>
that happen to load KF5::Crash, e.g. via out platform plugins<br>
<br>
For these reasons for KF6 we dropped this approach (see<br>
<a href="https://invent.kde.org/frameworks/kcrash/-/merge_requests/51" rel="noreferrer" target="_blank">https://invent.kde.org/frameworks/kcrash/-/merge_requests/51</a>), meaning<br>
one must explicitly opt into our crash handling. A large number of our<br>
applications does that already, but there's also a significant number<br>
that doesn't. Please check your applications for that.<br>
<br>
Cheers<br>
<br>
Nico<br>
<br>
</blockquote></div>