Bug 502848

Summary: DrKonqi fills /tmp with core dumps until (almost?) no space is left
Product: [Applications] drkonqi Reporter: Louis Moureaux <m_louis30>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: nate, sitter
Priority: NOR    
Version First Reported In: 6.3.3   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Louis Moureaux 2025-04-15 16:40:34 UTC
SUMMARY

When an application crashes DrKonqi saves a core dump in /tmp. These folders can be huge, hundreds of MB.

When an application crashes repeatedly, a core dump is created each time. This ends up filling the filesystem.

STEPS TO REPRODUCE
1. Introduce a crash in a large Kde application
2. Trigger the crash as many times as you can
3. Watch your /tmp folder

OBSERVED RESULT

Disk usage appears not to be limited and core dumps fill up the disk. Core dumps do not disappear.

Here is an example:

93M     /tmp/drkonqi-core.PAKDGj
94M     /tmp/drkonqi-core.incVUD
96M     /tmp/drkonqi-core.iKJbVo
119M    /tmp/drkonqi-core.NsJeOj
119M    /tmp/drkonqi-core.OyvlIk
131M    /tmp/drkonqi-core.DwuLVw
221M    [unrelated]
269M    /tmp/drkonqi-core.RjRgOM
465M    /tmp/drkonqi-core.GhumdV
465M    /tmp/drkonqi-core.mdpHXX
530M    /tmp/drkonqi-core.nDJTlw
590M    /tmp/drkonqi-core.SoTGZo
614M    /tmp/drkonqi-core.PYMKgt
642M    /tmp/drkonqi-core.vSwDDN
649M    /tmp/drkonqi-core.nwVJBD
662M    /tmp/drkonqi-core.LbUDSY
682M    /tmp/drkonqi-core.nxRHKc
696M    /tmp/drkonqi-core.FKsxOV
697M    /tmp/drkonqi-core.lPYiuM
701M    /tmp/drkonqi-core.LCKkOI
723M    /tmp/drkonqi-core.KQYVxz
11G     /tmp
11G     total

Some of these are more than a week old.

EXPECTED RESULT

Disk usage is limited to a reasonable value. Core dumps are removed automatically after some time.

SOFTWARE/OS VERSIONS

Operating System: KDE neon 6.3
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Kernel Version: 6.11.0-19-generic (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i5-10310U CPU @ 1.70GHz
Memory: 15.3 Gio of RAM

ADDITIONAL INFORMATION

The crashing apps are KMail and the Akonadi EWS resource.
Comment 1 Harald Sitter 2025-04-16 16:22:21 UTC
Cannot reproduce. When I close drkonqi the cores get cleaned up.
Comment 2 Louis Moureaux 2025-04-16 16:37:12 UTC
Because of 489315 DrKonqi usually gets killed by the OOM killer.
Comment 3 Louis Moureaux 2025-04-16 16:38:32 UTC
(actually it's gdb that gets killed)
Comment 4 Harald Sitter 2025-04-18 12:32:52 UTC
Well. With the hack you put in place for bug #489315 you are also killing drkonqi, obviously no cleanup is going to happen then.
Comment 5 Louis Moureaux 2025-04-18 16:30:44 UTC
Thanks for the hint. I now have updated my "hack" to the following:

MemoryMax=2G
MemorySwapMax=0
ExecStopPost=/bin/sh -c '/bin/rm -rf %T/drkonqi*'

Works like a breeze, except most reports don't get submitted because even a Dolphin crash appears to use more than 2G of RAM. I'm not willing to give more to a process that can start at any time without warning.
Comment 6 Harald Sitter 2025-04-18 19:46:21 UTC
There's a smart solution in the works for 6.4