Bug 494976

Summary: Crash in KWin::SurfaceInterface::firstTransaction with xpra
Product: [Plasma] kwin Reporter: RW <kde>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: kde
Priority: NOR Keywords: drkonqi
Version: 6.2.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 6.3.0
Sentry Crash Report: https://crash-reports.kde.org/organizations/kde/issues/80663/events/50cc0c41feb5462aa9020ea070a21590/
Attachments: New crash information added by DrKonqi

Description RW 2024-10-18 08:50:00 UTC
Application: kwin_wayland (6.2.1)

ApplicationNotResponding [ANR]: false
Qt Version: 6.8.0
Frameworks Version: 6.7.0
Operating System: Linux 6.11.3-arch1-1 x86_64
Windowing System: Wayland
Distribution: Arch Linux
DrKonqi: 6.2.1 [CoredumpBackend]

-- Information about the crash:
Hi there! I just upgraded to KDE 6.2.1 two days or so. KDE 6.2.x seems to be the least stable release of KDE 6 so far ;-) With KDE 6.2.0 I had the issue that I wasn't able to login anymore after the monitor got black and the screen got locked after a while of inactivity. While I was able to type in the password, the screen didn't unlock no matter if I used the "enter" key on the keyboard or the ">" button right to the password field. I had to click "switch" user and then login again with the same user. That worked. Now with KDE 6.2.1 I had this crash. I was doing nothing special. Just was using Firefox and clicked on a link and then it crashed. Basically all my open windows were closed afterwards. I only got all my Konsole windows back (all at the same position in the same activity while they're normally distributed around three different activities). I had six different Firefox instances open (so not six windows but really six different Firefox profiles all on their own). I also got a crash report of all these Firefox instances. That's actually all the information I can provide. I hope this helps.

The reporter is unsure if this crash is reproducible.

-- Backtrace (Reduced):
#5  KWin::SurfaceInterface::firstTransaction (this=0x0) at /usr/include/c++/14.2.1/bits/unique_ptr.h:193
#6  0x000076f7eeb1ad51 in KWin::Transaction::commit (this=0x76f7980146f0) at /usr/src/debug/kwin/kwin-6.2.1.1/src/wayland/transaction.cpp:281
#7  0x000076f7eeaea752 in KWin::SurfaceInterfacePrivate::surface_commit (this=0x579291470950, resource=<optimized out>) at /usr/src/debug/kwin/kwin-6.2.1.1/src/wayland/surface.cpp:379
#8  0x000076f7e9bb1596 in ffi_call_unix64 () at ../src/x86/unix64.S:104
#9  0x000076f7e9bae00e in ffi_call_int (cif=cif@entry=0x7ffdf88878f0, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=closure@entry=0x0) at ../src/x86/ffi64.c:673


Reported using DrKonqi
Comment 1 RW 2024-10-18 08:50:01 UTC
Created attachment 174978 [details]
New crash information added by DrKonqi

DrKonqi auto-attaching complete backtrace.
Comment 2 RW 2024-10-18 09:07:07 UTC
Crash just happened 10-15 minutes later again. I have the feeling that this related to the Xpra (https://xpra.org) update. Xpra is very handy when working with multiple computers but only one screen. E.g. I'm starting Firefox on a remote machine via SSH + Xpra and the Firefox window appears as I'd have started Firefox locally. I upgraded from version 4.4.5. to 6.2.0 this morning. Xpra is always a bit special but I've never seen that it crashes that hard. Normally it just doesn't work e.g. if Xpra version doesn't match on local and remote host or if some video codes are not there. But that's it.
Comment 3 RW 2024-10-21 06:14:29 UTC
Looks like downgrading Xpra from 6.2.0 to 4.4.5 "solved" the issue. Haven't had the crash anymore so far. But without a fix I'm not really able to update Xpra anymore.
Comment 4 David Edmundson 2024-11-29 07:56:02 UTC
Can you elaborate on how to use xpra to reproduce this
Comment 5 RW 2024-11-29 09:57:42 UTC
Thanks for getting back on this! Well it's actually pretty easy. I've a workstation and a laptop. Both run latest Archlinux, KDE and xpra. So they are installed basically the same way. Xpra allows me to get the windows of various programs displayed on my workstation and it looks like they run locally. The connection is over SSH. E.g. for Firefox I run this command:

xpra start ssh:laptop --keyboard-layout=de --pulseaudio=no --speaker=disabled --microphone=disabled --exit-with-client=yes --daemon=no --printing=no --exit-with-children --clipboard=yes --clipboard-direction=both  --start-child=/usr/bin/firefox'

That's basically all I do to get the remote window displayed. But the crash doesn't happen immediately. Sometimes it takes 30 minutes, sometimes only one or two minutes. But I haven't found a pattern yet when it happens. I also do nothing special with the remote Firefox (not watching videos e.g.). It's really just "normal" webpages. Hope this helps a bit. With xpra 4.4.5 it works like a charm. I'm using it all day long. But after upgrading to 6.2.0 I got this crashes. That's why I needed to downgrade to 4.4.5 again.
Comment 6 RW 2025-01-09 07:22:14 UTC
Today I had another crash. I submitted a new crash report. I just don't know where it ended up in the bug tracking system. But it was transmitted successfully and I put a link to this bug ID in the crash comment.

I need to use xpra 6.2.1 now instead of 4.4.5 (which was stable) because of updated dependencies in Archlinux (mainly Python 3.13 which xpra 4.4.5 doesn't like anymore...) . Meanwhile I'm using KDE 6.2.5 and kernel 6.12.8 (but I guess the kernel doesn't matter). I updated the "version" in the bug details accordingly. This time the crash only happened after two days of usage. So it looked like that the crash wouldn't show up anymore but I was wrong. But I guess that was only by accident that it took that long to get the crash. I don't really know what causes the crash. I was just using the remote Firefox (via xpra) as usual until the crash happened. I've three KDE activities and after the crash all remaining windows were moved to the "default" activity. The other two KDE activities didn't contain any windows anymore.

I did a full Archlinux update now and restarted my computer. So I've the very latest packages installed.
Comment 7 RW 2025-01-15 14:24:55 UTC
The last six days it worked fine and stable. So I'll close this. I'm not sure if it's resolved or if happens again. But then I'll open a new crash report.
Comment 8 RW 2025-01-17 06:52:13 UTC
Sadly I've to re-open the bug. Crash happened again today. I just don't know where it ended. Is there a possibility to figure out which bug ID such a crash report gets?

I just updated my Archlinx to the very latest packages yesterday. While the crash happened I was using xpra (https://xpra.org - screen for X11/Wayland) to work on a remote machine forwarding the display of a remote Firefox to my local machine (basically the same as doing I already described in the initial bug description and the ones that followed). I was using the remote Firefox to log into Google Cloud console. The crash happened while I was pressing a submit button to send the 2FA code during the login process. My local Firefox instances crashed too. Also Slack, Thunderbird and a few other apps died without any messages or so. Only every local Firefox process (three separate Firefox instances at that time) opened a window to create a crash report. All remaining windows were moved to "Default" activity. I have three activities altogether as mentioned in an earlier comment already. The only app that "survived" was "konsole" (again). Besides that all "konsole" windows were moved to "Default" activity and centered on the middle top of that activity, "konsole" was still working. That's basically everything I can say.
Comment 9 RW 2025-01-17 06:58:38 UTC
This is the last message I got from the remote xpra session: "Gdk-Message: 07:29:17.397: Error flushing display: Connection reset by peer" But I guess that's not really related to the crash itself.
Comment 10 RW 2025-01-17 07:15:50 UTC
Maybe one additional information that just came into my mind: I'm using remote apps with xpra from my local machine to two remote machines:

local (Archlinux) -> remote (Archlinux)
local (Archlinux) -> remote (Ubuntu 24.04)

While both Archlinux machines are "full" desktops (both have KDE installed), the Ubuntu one is more or less just a server where I installed Firefox without a full desktop environment (just the dependencies that Firefox pulls in when you install the package). This kind of crash never happened to me when I was using the remote Firefox on the Ubuntu host from my local machine.