Created attachment 166387 [details] gdb debug messages (tracebacks) SUMMARY *** Since a few days I can not start kmail or kontact anymore. It eats all my memory and crashes than. I have now tried to run in in debugger and have interruppted the process every 30-60 seconds, taken a backtrace and continued again. At the End the kmail porcess eats all my memory (64GB) and swap (another 64GB) and crashed. The traceback is attached. STEPS TO REPRODUCE Not sure, my Mail boxes are large. OBSERVED RESULT EXPECTED RESULT Operating System: KDE neon Testing Edition KDE Plasma Version: 6.0.0 KDE Frameworks Version: 6.0.0 Qt Version: 6.6.2 Kernel Version: 6.5.0-21-generic (64-bit) Graphics Platform: X11 Processors: 24 × 13th Gen Intel® Core™ i7-13700 Memory: 62,5 GiB of RAM Graphics Processor: NVIDIA T1000/PCIe/SSE2 Manufacturer: Thomas-Krenn.AG Product Name: Business-PC PI1004-FRCIS System Version: 1.0 Linux/KDE Plasma: ADDITIONAL INFORMATION
Just a note. I observe the same problem with the very same backtrace, but on a different scenario. In my case kmail opens, but when I try to reply to an email, kmail is stuck and memory goes up, until kmail is killed. The compositor window never shows up. Backtrace is the same: from KMComposerWin::setMessage to MessageComposer::ComposerViewBase::setMessage, then down to the chain until QTextDocumentLayoutPrivate::layoutBlock, where it seems to loop forever and eat all the memory. It is not clear if it is a kmail or Qt problem. It happens replying to almost all my emails, but on a very few emails the problem does not appear. Odd.
I have exactly the same on : Opensuse tumbleweed Plasma 6.0.1 and KMail 6.0.0 (24.02.0) Wayland
I have one more info for troubleshooting. If the mail is plain text reply works, if it is html then this whole memory eating starts until systme is frozen.
(In reply to Sebastian Turzański from comment #3) > I have one more info for troubleshooting. > If the mail is plain text reply works, if it is html then this whole memory > eating starts until systme is frozen. html is probably involved, but I have some html emails that don't show this problem when replying to.
did you also upgrade from plasma5 to plasma6 with kmail and mailbox created in plasma5 ? maybe that is the reason as I had been using it in plasma5 and have quite big accounts there and now I tried to use it in plasma6
(In reply to Sebastian Turzański from comment #5) > did you also upgrade from plasma5 to plasma6 with kmail and mailbox created > in plasma5 ? Yes. I'm going to install Arch on a new laptop from scratch, will see if it shows the same problem or not.
Issue is also present after a clean install. Replying as plaintext works, so it is related to html. If any dev wants to have a look, I can provide a simple test mail privately.
*** Bug 483686 has been marked as a duplicate of this bug. ***
I played a little more with gdb and discovered the following. The infinite loop happens in QTextDocumentLayoutPrivate::layoutBlock, in the "while (1)" block at line 3477: https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/text/qtextdocumentlayout.cpp?h=6.6.2 Here, tl->createLine is called. From QTextLayout::createLine, on lines 802/803, https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/text/qtextlayout.cpp?h=6.6.2 I can see that the "from" field is always 0. So, the incoming text is never consumed, and an endless number of 0-length QTextLines are produced. This is where all the memory is consumed. With the help of gdb, I dumped the problematic html payload which is passed to QTextEdit::setHtml (it is the "reply" formatted html string prepared by kmail in response to the mail we're replying to) and created a test program populating a QTextLine with the same payload. The program worked correctly, so I don't really understand what is going on here. Maybe some layout settings from kmail are not handled correctly by Qt 6 code, who knows. A dev eye would be really appreciated at this point. At a first glance what kmail is doing seems correct to me.
> and created a test program populating a QTextLine with the same payload s/QTextLine/QTextEdit
I just tested on an Fedora Asahi machine with nearly identical config (copied my kmail2rc over from the crashing machine) and I'm able to reply to the same email that triggered the crash. That machine runs Arch, and shivarryn at least also runs Arch. Are the other folks who are having trouble with this also running Arch?
(In reply to luna from comment #11) > I just tested on an Fedora Asahi machine with nearly identical config > (copied my kmail2rc over from the crashing machine) and I'm able to reply to > the same email that triggered the crash. That machine runs Arch, and > shivarryn at least also runs Arch. Are the other folks who are having > trouble with this also running Arch? Sorry, disregard that, this Fedora machine isn't on Plasma 6 yet :(
Good news! Problem is gone on my side after Qt 6.6.3 reached Arch. So yes, it was probably a Qt issue. If the other reporters can confirm after Qt 6.6.3 reaches your distros, we can close the bug.
(In reply to shivarryn from comment #13) > Good news! > Problem is gone on my side after Qt 6.6.3 reached Arch. > So yes, it was probably a Qt issue. > If the other reporters can confirm after Qt 6.6.3 reaches your distros, we > can close the bug. I can also confirm that this is fixed on my Arch machine.
(In reply to shivarryn from comment #13) > Good news! > Problem is gone on my side after Qt 6.6.3 reached Arch. > So yes, it was probably a Qt issue. > If the other reporters can confirm after Qt 6.6.3 reaches your distros, we > can close the bug. Also for me on latest NEON update with latest Qt 6.6.3 update the problem is fixed now. Thank You