Bug 477115 - KCrash interferes with QProcess::exitStatus
Summary: KCrash interferes with QProcess::exitStatus
Status: REPORTED
Alias: None
Product: frameworks-kcrash
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.112.0
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-16 22:08 UTC by Stefan Brüns
Modified: 2025-07-13 18:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Brüns 2023-11-16 22:08:27 UTC
SUMMARY

Whenever KCrash catches e.g. SIGSEGV or SIGILL, it may either reraise the signal after DrKonqi has closed, or do an `_exit(253)`.

Which of the two happens depends on the setting of /proc/sys/kernel/core_pattern.  

STEPS TO REPRODUCE
1. execute an external program which uses KCrash using QProcess::start(...)
  (a program known to crash - for a reproducer, just use `raise(SIGSEGV)`).
2. listen to the `QProcess::finished(...)` signal
3. Evaluate the `QProcess::exitStatus`

OBSERVED RESULT
The `exitStatus` should be `QProcess::CrashExit`

EXPECTED RESULT
The `exitStatus` *may be* `QProcess::NormalExit` with an exitCode of 253.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  5.112.0
KDE Frameworks Version: 5.112.0
Qt Version: 5.15

ADDITIONAL INFORMATION
When `systemd-coredump` is installed, the `core_pattern` is set to a pipe.

The intention seems to not produce a core file when a crash is caught by KCrash. There a other ways to achieve this, as outlined in `man 5 core`, e.g. setting the RLIMIT_CORE to { 0, 0 }.

This behavior is not mentioned in any documentation, at least not in https://api.kde.org/frameworks/kcrash/html/namespaceKCrash.html