Bug 391118 - Kwin crash when using Active Window screenshot method
Summary: Kwin crash when using Active Window screenshot method
Status: RESOLVED DUPLICATE of bug 388182
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 17.12.2
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
: 391179 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-02-26 18:56 UTC by Andrew Crouthamel
Modified: 2018-03-06 05:10 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
My test system (785.70 KB, image/png)
2018-03-02 00:54 UTC, Andrew Crouthamel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Crouthamel 2018-02-26 18:56:28 UTC
When selecting an area of "Active Window", with a Delay of "No Delay", KWin crashes for me. If I select a Delay of any number of seconds, it does not crash.

This is always reproducible, either in stable or master branch.

If you'd like me to send debugs, just let me know what to run. :)

KDE Plasma Version: 5.12.2
KDE Frameworks Version: 5.43.0
Qt Version: 5.9.1
Kernel Version 4.13.0-32-generic
OS Type: 64-bit

System is a Dell XPS 13 laptop with Intel graphics and Mesa drivers. So no weird video setup here.
Comment 1 null 2018-03-02 00:27:02 UTC
Hmh, cannot reproduce in a VM.

For Spectacle it's always interesting to know if you have KWin's compositing enabled or not (check in the settings or press Shift+Alt+F2 and look at the shadows).

Also, try capturing a screenshot of your complete desktop and mark the window you wanted to screenshot originally. Maybe you've got an unusual setup?

For crash bugs, submit a backtrace. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports. You should be able to start KWin with "kwin_x11 --replace".
Comment 2 null 2018-03-02 00:40:52 UTC
> Shift+Alt+F2
Shift+Alt+F12
Comment 3 Andrew Crouthamel 2018-03-02 00:51:40 UTC
(In reply to Henrik Fehlauer from comment #1)
> Hmh, cannot reproduce in a VM.
Me either, I tried Neon Dev Unstable in VirtualBox.
> For Spectacle it's always interesting to know if you have KWin's compositing
> enabled or not (check in the settings or press Shift+Alt+F2 and look at the
> shadows).
I do have compositing on (Kubuntu defaults).
> Also, try capturing a screenshot of your complete desktop and mark the
> window you wanted to screenshot originally. Maybe you've got an unusual
> setup?
I have some more information on this. It is only when windows are maximized. Doesn't matter which window, any of them. For example, Konsole. In a small size, floating on the desktop, Active Window screenshot works fine. Maximized (but still not "full screen", as I have a standard panel on the left), Kwin dies.

Interestingly, I do not get a crash pop-up. So maybe it's not a "crash" but something else (process kill?).
> For crash bugs, submit a backtrace. See
> https://community.kde.org/Guidelines_and_HOWTOs/Debugging/
> How_to_create_useful_crash_reports. You should be able to start KWin with
> "kwin_x11 --replace".
I can easily get kwin back with "kwin &" each time. Which is good, makes it easy to test. I'm trying to work out the -dbg package for kwin. I do have kdelibs5-dbg installed.
Comment 4 Andrew Crouthamel 2018-03-02 00:54:44 UTC
Created attachment 111124 [details]
My test system

If I maximize that window and run the Active Window screenshot, Kwin will die.
Comment 5 Kai Uwe Broulik 2018-03-02 08:02:33 UTC
Can you get a backtrace of KWin crashing?
Comment 6 null 2018-03-02 08:47:20 UTC
*** Bug 391179 has been marked as a duplicate of this bug. ***
Comment 7 null 2018-03-02 08:49:58 UTC
Learnings from Bug 391179:
- No crash if "Include window titlebar and borders" unchecked.
- Different delay values make no difference.
- "it's not necessary to be full screen."
Comment 8 Andrew Crouthamel 2018-03-06 01:15:19 UTC
(In reply to Henrik Fehlauer from comment #7)
> Learnings from Bug 391179:
> - No crash if "Include window titlebar and borders" unchecked.
I can confirm that disabling "Include window titlebar and borders" prevents the crash.

> - Different delay values make no difference.
I can still reproduce a crash/no crash based on delay value (with the above mentioned option enabled).

> - "it's not necessary to be full screen."
This only crashes with a window maximized for me. Non-maximized windows (with the above mentioned option enabled) do not crash Kwin for me.


(In reply to Kai Uwe Broulik from comment #5)
> Can you get a backtrace of KWin crashing?
Here is all I can get via gdb. "thread apply all backtrace" does not show anything. What am I missing?

andrew@andrew-XPS-13-9360:~$ gdb kwin
GNU gdb (Ubuntu 8.0.1-0ubuntu1) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from kwin...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/kwin 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffdd690700 (LWP 4140)]
[New Thread 0x7fffd7134700 (LWP 4141)]
QXcbConnection: XCB error: 3 (BadWindow), sequence: 178, resource id: 77594630, major code: 20 (GetProperty), minor code: 0
[New Thread 0x7fffd5eb9700 (LWP 4142)]
Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-dark/stock/16/"
Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-dark/stock/22/"
Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-dark/stock/24/"
Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-dark/stock/32/"
Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-dark/stock/48/"
Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-dark/stock/64/"
Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-dark/stock/128/"
[New Thread 0x7fffcffff700 (LWP 4143)]
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setWindow: Painter not active
QPainter::setClipRect: Painter not active
QPainter::save: Painter not active
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::setClipRect: Painter not active
QPainter::drawRects: Painter not active
QPainter::restore: Unbalanced save/restore
QPainter::save: Painter not active
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setBrush: Painter not active
QPainter::setPen: Painter not active
QPainter::drawRects: Painter not active
QPainter::restore: Unbalanced save/restore
[New Thread 0x7fffcedd8700 (LWP 4144)]
OpenGL vendor string:                   Intel Open Source Technology Center
OpenGL renderer string:                 Mesa DRI Intel(R) HD Graphics 620 (Kaby Lake GT2) 
OpenGL version string:                  3.0 Mesa 17.3.2 - padoka PPA
OpenGL shading language version string: 1.30
Driver:                                 Intel
GPU class:                              Unknown
OpenGL version:                         3.0
GLSL version:                           1.30
Mesa version:                           17.3.2
X server version:                       1.19.5
Linux kernel version:                   4.13
Requires strict binding:                yes
GLSL shaders:                           yes
Texture NPOT support:                   yes
Virtual Machine:                        no
[New Thread 0x7fffc3d13700 (LWP 4145)]
kf5.kcoreaddons.desktopparser: Property type "Url" is not a known QVariant type. Found while parsing property definition for "X-KWin-Video-Url" in "/usr/share/kservicetypes5/kwineffect.desktop"
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1534, resource id: 0, major code: 14 (GetGeometry), minor code: 0
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1535, resource id: 0, major code: 14 (GetGeometry), minor code: 0
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1536, resource id: 0, major code: 14 (GetGeometry), minor code: 0
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1537, resource id: 0, major code: 14 (GetGeometry), minor code: 0
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1538, resource id: 0, major code: 14 (GetGeometry), minor code: 0
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1540, resource id: 0, major code: 14 (GetGeometry), minor code: 0
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1544, resource id: 0, major code: 14 (GetGeometry), minor code: 0
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1545, resource id: 0, major code: 14 (GetGeometry), minor code: 0
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1546, resource id: 0, major code: 14 (GetGeometry), minor code: 0
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1547, resource id: 0, major code: 14 (GetGeometry), minor code: 0
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1548, resource id: 0, major code: 14 (GetGeometry), minor code: 0
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1550, resource id: 0, major code: 14 (GetGeometry), minor code: 0
[New Thread 0x7fffc3512700 (LWP 4146)]
[Thread 0x7fffcedd8700 (LWP 4144) exited]
QXcbConnection: XCB error: 3 (BadWindow), sequence: 6262, resource id: 77594982, major code: 3 (GetWindowAttributes), minor code: 0
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 6263, resource id: 77594982, major code: 14 (GetGeometry), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 6266, resource id: 77594982, major code: 3 (GetWindowAttributes), minor code: 0
QXcbConnection: XCB error: 9 (BadDrawable), sequence: 6267, resource id: 77594982, major code: 14 (GetGeometry), minor code: 0
The X11 connection broke: Maximum allowed requested length exceeded (code 4)
XIO:  fatal IO error 2 (No such file or directory) on X server ":0"
      after 6818 requests (6818 known processed) with 0 events remaining.
The X11 connection broke: Maximum allowed requested length exceeded (code 4)
XIO:  fatal IO error 2 (No such file or directory) on X server ":0"
      after 6818 requests (6818 known processed) with 0 events remaining.
[Thread 0x7fffc3d13700 (LWP 4145) exited]
[Thread 0x7fffd5eb9700 (LWP 4142) exited]
[Thread 0x7fffd7134700 (LWP 4141) exited]
[Thread 0x7fffc3512700 (LWP 4146) exited]
[Thread 0x7fffcffff700 (LWP 4143) exited]
[Thread 0x7fffdd690700 (LWP 4140) exited]
[Inferior 1 (process 4136) exited with code 01]
(gdb) thread apply all backtrace
(gdb)
Comment 9 Andrew Crouthamel 2018-03-06 01:20:58 UTC
Note: I did just try purging the padoka PPA and reverting to standard Mesa. No change in behavior.
Comment 10 null 2018-03-06 01:27:35 UTC
Thanks for the update, Andrew. Seems this problem only happens in some special situations, and it does not look like a normal crash.

I searched for "Maximum allowed requested length exceeded" and ended up in Bug 388182. Could you look through that one and see if it is the same problem as yours?
Comment 11 Andrew Crouthamel 2018-03-06 05:10:59 UTC
Yeah this definitely is the same issue. Due to the comments about X11, I installed Wayland and tested in that. I am unable to get Kwin to crash that way.

I'll mark this as a duplicate of the other bug.

*** This bug has been marked as a duplicate of bug 388182 ***