Bug 511912

Summary: Freezing due to out of memory while importing an mbox file into Clawsmail
Product: [Plasma] kwin Reporter: kdgiid.dcz
Component: generic-crashAssignee: KWin default assignee <kwin-bugs-null>
Status: REPORTED ---    
Severity: crash CC: kdedev
Priority: NOR    
Version First Reported In: 6.4.4   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Crash dump
kwin log

Description kdgiid.dcz 2025-11-10 14:55:35 UTC
SUMMARY

kwin crashes apparently for no reason, leaving the computer frozen for several minutes.

STEPS TO REPRODUCE
1. Import .mbox file in Claws Mail

OBSERVED RESULT

The UI freezes on the progress bar. The entire system freezes, can't switch to VTE.
15 minutes later, KWin comes back from crash. Emails finally imported.

EXPECTED RESULT
No freeze or crash. Emails still imported.

SOFTWARE/OS VERSIONS

KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.8.3
Kernel Version: 6.17.4-100.fc41.x86_64 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION

Using claws-mail-4.3.1-1.fc41.x86_64.

The .mbox contains 2 emails, each about 100kB in size, plain text and just a couple PDFs inside. Available to share privately. The import is into an IMAP mailbox.

dmesg:

[405791.173084] __vm_enough_memory: pid: 917139, comm: kwin_wayland, bytes: 68719480832 not enough memory for the allocation
[405791.173099] __vm_enough_memory: pid: 917139, comm: kwin_wayland, bytes: 68719607808 not enough memory for the allocation
[405791.173105] __vm_enough_memory: pid: 917139, comm: kwin_wayland, bytes: 68719611904 not enough memory for the allocation
[405791.546613] __vm_enough_memory: pid: 917139, comm: kwin_wayland, bytes: 68719480832 not enough memory for the allocation
[405791.551124] kwin_wayland[917139]: segfault at 0 ip 00007f1b7a49a9c8 sp 00007fff7ec9f298 error 6 in libc.so.6[8d9c8,7f1b7a40e000+16f000] likely on CPU 2 (core 1, socket 0)
[405791.551147] Code: 00 00 4c 8b 1d f1 28 16 00 4c 39 da 0f 82 dc fe ff ff 48 f7 d9 48 39 ca 0f 87 e6 fe ff ff 0f 10 4e 10 0f 10 56 20 0f 10 5e 30 <0f> 11 07 0f 11 4f 10 0f 11 57 20 0f 11 5f 30 49 89 f8 49 83 e0 3f
[405986.012862] QSGRenderThread[1457696]: segfault at 7f58f33c3f6c ip 00007f596684c494 sp 00007f58f33c3f20 error 6 in libc.so.6[3f494,7f596680e000+16f000] likely on CPU 2 (core 1, socket 0)
[405986.012881] Code: 84 00 00 00 00 00 f3 0f 1e fa 55 48 89 e5 41 57 41 56 49 89 fe 41 55 49 89 d5 41 54 53 48 89 f3 48 89 df 48 81 ec 08 05 00 00 <89> 8d 1c fb ff ff 48 89 b5 f0 fa ff ff be 25 00 00 00 64 48 8b 04
[405994.420674] QSGRenderThread[1457792]: segfault at 7f0da1ffcf6c ip 00007f0e14e4c494 sp 00007f0da1ffcf20 error 6 in libc.so.6[3f494,7f0e14e0e000+16f000] likely on CPU 0 (core 0, socket 0)
[405994.420692] Code: 84 00 00 00 00 00 f3 0f 1e fa 55 48 89 e5 41 57 41 56 49 89 fe 41 55 49 89 d5 41 54 53 48 89 f3 48 89 df 48 81 ec 08 05 00 00 <89> 8d 1c fb ff ff 48 89 b5 f0 fa ff ff be 25 00 00 00 64 48 8b 04
[406002.467571] QSGRenderThread[1457884]: segfault at 7ff71ef00f6c ip 00007ff79224c494 sp 00007ff71ef00f20 error 6 in libc.so.6[3f494,7ff79220e000+16f000] likely on CPU 2 (core 1, socket 0)
[406002.467591] Code: 84 00 00 00 00 00 f3 0f 1e fa 55 48 89 e5 41 57 41 56 49 89 fe 41 55 49 89 d5 41 54 53 48 89 f3 48 89 df 48 81 ec 08 05 00 00 <89> 8d 1c fb ff ff 48 89 b5 f0 fa ff ff be 25 00 00 00 64 48 8b 04
Comment 1 TraceyC 2025-11-13 02:03:06 UTC
Thanks for the crash report. As the message at the top of the summary says, if something crashed, we need a backtrace of it so we can figure out what's going on. Can you please attach a backtrace of the crash using the coredumpctl command-line program, as detailed in https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl ?

If there is no coredump, this isn't a crash, it's a freeze. In that case: can you check kwin's logs for the timeframe when the hard freeze occurs? 

  journalctl --boot --user-unit plasma-kwin_wayland > ~/log.txt

Also, could you retrieve kwin's backtrace when the hard freeze occurs? You would need to ssh from another computer and attach a debugger to kwin process, e.g.

  sudo gdb -p $(pidof kwin_wayland)

then type

  bt

then press 'c' if it asks you if you want to continue paging

Then copy-and-paste the output here. Thanks!
Comment 2 kdgiid.dcz 2025-11-25 11:50:50 UTC
Created attachment 187156 [details]
Crash dump
Comment 3 kdgiid.dcz 2025-11-25 11:53:46 UTC
There is no core dump because it's an out of memory condition and I don't have 40GiB disk space free :)
I tried to dump core manually, but a file truncated due to lack of space doesn't load again.

Looking at the backtrace, I'm guessing that kwin handles the out of memory failure correctly but crashes when trying to reallocate the invalid pointer? I could be wrong.
Comment 4 TraceyC 2025-11-25 17:18:53 UTC
Thanks for confirming this isn't a crash, and for the backtrace.

Can you also check kwin's logs for the timeframe when the hard freeze occurs? 

  journalctl --boot --user-unit plasma-kwin_wayland > ~/log.txt
Comment 5 kdgiid.dcz 2025-11-25 17:57:55 UTC
Created attachment 187167 [details]
kwin log

Note that there should be 2 kwin crashes - first crash because of lack of disk pace that I haven't reported yet. I only captured the backtrace because after the first crash, triggering another doesn't lose me anything.

I couldn't reliably find the separate crashes because of the noise from maliit... crashes (and I'm not even using it).
Comment 6 kdgiid.dcz 2025-11-25 19:15:42 UTC
Another important detail: I took the backtrace on SIGSEGV, but I didn't capture that part in the logs. This is why I keep referring to this as a crash - I see sigsegv as a sufficient condition for that description.
Comment 7 TraceyC 2025-11-25 20:01:54 UTC Comment hidden (spam)
Comment 8 kdgiid.dcz 2025-11-25 21:08:59 UTC
No worries, I'm glad that you figured out the miscommunication.

By the way, the stack trace you quoted is *not* the same as the one that I captured manually (gdb.txt). It's likely that it's from the first crash from running out of space. The one from importing emails crashes in

#0  0x00007f874629a9c8 in __memmove_sse2_unaligned_erms () at /lib64/libc.so.6
#1  0x00007f874965577a in QArrayDataPointer<KWin::Window*>::reallocateAndGrow(QArrayData::GrowthPosition, long long, QArrayDataPointer<KWin::Window*>*) () at /lib64/libkwin.so.6
...
Comment 9 TraceyC 2025-11-26 16:48:04 UTC
Thanks for clarifying

Searchable backtrace for the original issue:

#0  0x00007f874629a9c8 in __memmove_sse2_unaligned_erms () at /lib64/libc.so.6
#1  0x00007f874965577a in QArrayDataPointer<KWin::Window*>::reallocateAndGrow(QArrayData::GrowthPosition, long long, QArrayDataPointer<KWin::Window*>*) () at /lib64/libkwin.so.6
#2  0x00007f87497410ee in KWin::Workspace::raiseWindow(KWin::Window*, bool) () at /lib64/libkwin.so.6
#3  0x00007f87496573f7 in KWin::Workspace::activateNextWindow(KWin::Window*) () at /lib64/libkwin.so.6
#4  0x00007f87498881a6 in KWin::Workspace::removeWaylandWindow(KWin::Window*) () at /lib64/libkwin.so.6
#5  0x00007f874695ad2e in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt6Core.so.6
#6  0x00007f87498560a4 in KWin::WaylandServer::windowRemoved(KWin::Window*) () at /lib64/libkwin.so.6
#7  0x00007f87498a6873 in KWin::XdgSurfaceWindow::destroyWindow() () at /lib64/libkwin.so.6
#8  0x00007f874695ad2e in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt6Core.so.6
#9  0x00007f8749a254f1 in KWin::XdgToplevelInterface::~XdgToplevelInterface() () at /lib64/libkwin.so.6
#10 0x00007f8749a70707 in QtWaylandServer::xdg_toplevel::destroy_func(wl_resource*) () at /lib64/libkwin.so.6
#11 0x00007f8747a10788 in remove_and_destroy_resource () at /lib64/libwayland-server.so.0
#12 0x00007f8745142056 in ffi_call_unix64 () at /lib64/libffi.so.8
#13 0x00007f874513d74d in ffi_call_int.lto_priv () at /lib64/libffi.so.8
#14 0x00007f874514064e in ffi_call () at /lib64/libffi.so.8
#15 0x00007f8747a0cb8c in wl_closure_invoke.constprop () at /lib64/libwayland-server.so.0
#16 0x00007f8747a118e8 in wl_client_connection_data () at /lib64/libwayland-server.so.0
#17 0x00007f8747a0fdc2 in wl_event_loop_dispatch () at /lib64/libwayland-server.so.0
#18 0x00007f874997f599 in KWin::Display::dispatchEvents() () at /lib64/libkwin.so.6
#19 0x00007f874695ad2e in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt6Core.so.6
#20 0x00007f874696935d in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () at /lib64/libQt6Core.so.6
#21 0x00007f8746969b4b in QSocketNotifier::event(QEvent*) () at /lib64/libQt6Core.so.6
#22 0x00007f8747c3d9b8 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt6Widgets.so.6
#23 0x00007f87468f3f30 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt6Core.so.6
#24 0x00007f8746abc306 in QEventDispatcherUNIXPrivate::activateSocketNotifiers() () at /lib64/libQt6Core.so.6
#25 0x00007f8746abcc8c in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt6Core.so.6
#26 0x00007f87476cd6b2 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt6Gui.so.6
#27 0x00007f8746901313 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt6Core.so.6
#28 0x00007f87468fc90e in QCoreApplication::exec() () at /lib64/libQt6Core.so.6
#29 0x00005582bec0bd97 in main ()
warning: Currently logging to gdb.txt.  Turn the logging off and on to make the new setting effective.
#0  0x00007f874629a9c8 in __memmove_sse2_unaligned_erms () at /lib64/libc.so.6
#1  0x00007f874965577a in QArrayDataPointer<KWin::Window*>::reallocateAndGrow(QArrayData::GrowthPosition, long long, QArrayDataPointer<KWin::Window*>*) () at /lib64/libkwin.so.6
#2  0x00007f87497410ee in KWin::Workspace::raiseWindow(KWin::Window*, bool) () at /lib64/libkwin.so.6
#3  0x00007f87496573f7 in KWin::Workspace::activateNextWindow(KWin::Window*) () at /lib64/libkwin.so.6
#4  0x00007f87498881a6 in KWin::Workspace::removeWaylandWindow(KWin::Window*) () at /lib64/libkwin.so.6
#5  0x00007f874695ad2e in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt6Core.so.6
#6  0x00007f87498560a4 in KWin::WaylandServer::windowRemoved(KWin::Window*) () at /lib64/libkwin.so.6
#7  0x00007f87498a6873 in KWin::XdgSurfaceWindow::destroyWindow() () at /lib64/libkwin.so.6
#8  0x00007f874695ad2e in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt6Core.so.6
#9  0x00007f8749a254f1 in KWin::XdgToplevelInterface::~XdgToplevelInterface() () at /lib64/libkwin.so.6
#10 0x00007f8749a70707 in QtWaylandServer::xdg_toplevel::destroy_func(wl_resource*) () at /lib64/libkwin.so.6
#11 0x00007f8747a10788 in remove_and_destroy_resource () at /lib64/libwayland-server.so.0
#12 0x00007f8745142056 in ffi_call_unix64 () at /lib64/libffi.so.8
#13 0x00007f874513d74d in ffi_call_int.lto_priv () at /lib64/libffi.so.8
#14 0x00007f874514064e in ffi_call () at /lib64/libffi.so.8
#15 0x00007f8747a0cb8c in wl_closure_invoke.constprop () at /lib64/libwayland-server.so.0
#16 0x00007f8747a118e8 in wl_client_connection_data () at /lib64/libwayland-server.so.0
#17 0x00007f8747a0fdc2 in wl_event_loop_dispatch () at /lib64/libwayland-server.so.0
#18 0x00007f874997f599 in KWin::Display::dispatchEvents() () at /lib64/libkwin.so.6
#19 0x00007f874695ad2e in void doActivate<false>(QObject*, int, void**) () at /lib64/libQt6Core.so.6
#20 0x00007f874696935d in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () at /lib64/libQt6Core.so.6
#21 0x00007f8746969b4b in QSocketNotifier::event(QEvent*) () at /lib64/libQt6Core.so.6
#22 0x00007f8747c3d9b8 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt6Widgets.so.6
#23 0x00007f87468f3f30 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt6Core.so.6
#24 0x00007f8746abc306 in QEventDispatcherUNIXPrivate::activateSocketNotifiers() () at /lib64/libQt6Core.so.6
#25 0x00007f8746abcc8c in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt6Core.so.6
#26 0x00007f87476cd6b2 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt6Gui.so.6
#27 0x00007f8746901313 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt6Core.so.6
#28 0x00007f87468fc90e in QCoreApplication::exec() () at /lib64/libQt6Core.so.6
#29 0x00005582bec0bd97 in main ()
quit
Comment 10 kdgiid.dcz 2025-12-14 14:30:21 UTC
I used xrestop but didn't see any indication that Claws mail was displayed using Xwayland.