Bug 385397 - Crash (segfault) on startup at memmove
Summary: Crash (segfault) on startup at memmove
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: 5.10.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-05 13:25 UTC by Mate Soos
Modified: 2017-10-06 14:11 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.11.1
Sentry Crash Report:
mgraesslin: Wayland+
mgraesslin: X11-


Attachments
valgrind trace (25.08 KB, text/plain)
2017-10-05 13:25 UTC, Mate Soos
Details
hwinfo output (333.11 KB, text/plain)
2017-10-05 15:01 UTC, Mate Soos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mate Soos 2017-10-05 13:25:08 UTC
Created attachment 108186 [details]
valgrind trace

Hi,

I have a full valgrind trace (attached), as it was reproducible. It's most likely not a HW failure as when I managed to log out and log back in, it's fine and my system has been fine before and since. Bunch of invalid reads in valgrind, not good. Also some conditional jumps not initialized, but it's best to take the first invalid read and see if fixing it fixes all the rest -- it may do.


on the dmesg I could see this:

[258563.996832] kwin_wayland[6079]: segfault at 10 ip 00007faf766c9240 sp 00007fff561cfdc8 error 4 in libKF5WaylandClient.so.5.37.0[7faf76665000+a9000]

Obviously, the valgrind trace is signfificantly more detailed.
Comment 1 Martin Flöser 2017-10-05 14:45:50 UTC
which exact version are you running? I fixed a crash related to your backtrace just the other day.

The memmove warnings look like false-positives to me, the invalid read is directly related to your crash.
Comment 2 Mate Soos 2017-10-05 15:00:07 UTC
Cool, thanks for picking this up. I was pretty happy I could run valgrind to be honest. It's nice trace I think.

Using:

msoos@msoos: pacman -Qs "kwin*"
[...]
local/kwin 5.10.5-1 (plasma)
    An easy to use, but flexible, composited Window Manager
local/kwindowsystem 5.37.0-1 (kf5)
    Access to the windowing system

It's fairly recently updated Arch Linux, so I shouldn't be too much off. Maybe 1-2 months off but pretty close I think.

Ask away if you want more info :)
Comment 3 Mate Soos 2017-10-05 15:01:43 UTC
Created attachment 108189 [details]
hwinfo output
Comment 4 Martin Flöser 2017-10-05 17:27:38 UTC
I'll backport my patch to the 5.11 branch. So will be fixed with 5.11.0
Comment 5 Martin Flöser 2017-10-05 17:35:18 UTC
Git commit 31b5b7f9f981ccaca001423c1a2183157bb53356 by Martin Flöser.
Committed on 05/10/2017 at 17:34.
Pushed by graesslin into branch 'Plasma/5.11'.

Ensure internal Wayland connection is properly setup before creating LockScreen integration

With the new Wayland only mode we start too fast and it can happen that
the initWithWorkspace is called before the client connection is fully
setup. This would result in a crash in the idletime plugin once it tries
to create a seat.

To prevent this problem the code is split out into a dedicated method
and only invoked if all interfaces have been announced on the internal
connection.
FIXED-IN: 5.11.1

M  +33   -17   wayland_server.cpp
M  +2    -0    wayland_server.h

https://commits.kde.org/kwin/31b5b7f9f981ccaca001423c1a2183157bb53356
Comment 6 Mate Soos 2017-10-06 09:01:07 UTC
Wow, thanks! Great work :) Owe you a beer! Let me know if you are coming to CCC (34C3) conf. Cheers,

Mate
Comment 7 Martin Flöser 2017-10-06 14:11:12 UTC
(In reply to Martin Flöser from comment #4)
> I'll backport my patch to the 5.11 branch. So will be fixed with 5.11.0

Have to correct that one. 5.11.0 was already tagged, so one week later with 5.11.1

Thanks for the beer offer :-)