Bug 107058 - [Wayland] plasmashell gets SIGSEGV after clicking on Application Menu for second time
Summary: [Wayland] plasmashell gets SIGSEGV after clicking on Application Menu for sec...
Status: RESOLVED NOTOURBUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Intel 3D Bugs Mailing List
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-27 21:59 UTC by magiblot
Modified: 2019-06-26 09:29 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
dmesg output while Plasma hangs (312.83 KB, image/png)
2018-07-17 14:55 UTC, Marina Chernish
Details
Output for Plasma while is hangs (7.32 KB, text/plain)
2018-07-18 12:56 UTC, Marina Chernish
Details
mipmap creation error logs (4.38 KB, patch)
2018-11-05 12:20 UTC, Danylo
Details | Splinter Review
pkgbuild for patched mesa (2.72 KB, text/plain)
2018-11-05 13:26 UTC, Danylo
Details
debug log having applied the patch above (1.12 MB, text/x-log)
2018-11-06 01:24 UTC, magiblot
Details

Description magiblot 2018-06-27 21:59:11 UTC
Hi,

I submitted the following bug report to the developers of KDE Plasma:

https://bugs.kde.org/show_bug.cgi?id=395753

However, we got to the conclusion that this is a Mesa bug instead. Thus, I will just summarize what I wrote there.

First of all, my hardware is an Intel i3-3110M CPU, which comes with a Intel HD Graphics 4000 GPU.

The versions of some of the software I have suffered this crash with are:

* Arch Linux x86_64
* Plasma 5.13.0, 5.13.1 or 5.13.2
* Qt 5.11.1
* Mesa 18.1.1 or git-103087.ab2643e4b0 (from the unnoficial mesa-git repository: https://pkgbuild.com/~lcarlier/mesa-git/)

The steps I followed are these:

0. Start a Plasma 5 Wayland session (if you are in tty, run "startplasmacompositor"). There is no such crash in the usual X session.
1. Click with the mouse on the Application Manager icon, so that the Application Manager appears.
2. Click again, so that it hids.
3. Click again, in an attempt to make it appear again.

However, the screen and keyboard freeze instead. The only way to get full control over the computer again, other than rebooting, is unrawing the keyboard (Alt+SysRq+R), changing to another tty and killing kwin_wayland, because "The X11 connection broke" (according to the messages in stderr).

It has to be noted that the Application Manager is not the only applet from the panel that suffers from this crash.

So here's a backtrace of the process that gets SIGSEGV, using Plasma 5.13.2 and mesa-git-103087.ab2643e4b0

> #0  0x00007fffd25a4476 in intel_miptree_level_has_hiz (mt=0x0, level=0) at intel_mipmap_tree.c:1953
> #1  0x00007fffd25a2890 in intel_renderbuffer_has_hiz (irb=irb@entry=0x555558744d90) at intel_fbo.c:930
> #2  0x00007fffd2577845 in brw_fast_clear_depth (ctx=0x5555561a7660) at brw_clear.c:114
> #3  0x00007fffd2577845 in brw_clear (ctx=0x5555561a7660, mask=50) at brw_clear.c:258
> #4  0x00007ffff575e82d in QSGBatchRenderer::Renderer::renderBatches() () at /usr/lib/libQt5Quick.so.5
> #5  0x00007ffff5764103 in QSGBatchRenderer::Renderer::render() () at /usr/lib/libQt5Quick.so.5
> #6  0x00007ffff57544ee in QSGRenderer::renderScene(QSGBindable const&) () at /usr/lib/libQt5Quick.so.5
> #7  0x00007ffff57549bc in QSGRenderer::renderScene(unsigned int) () at /usr/lib/libQt5Quick.so.5
> #8  0x00007ffff578f030 in QSGDefaultRenderContext::renderNextFrame(QSGRenderer*, unsigned int) () at /usr/lib/libQt5Quick.so.5
> #9  0x00007ffff57f2db5 in QQuickWindowPrivate::renderSceneGraph(QSize const&) () at /usr/lib/libQt5Quick.so.5
> #10 0x00007ffff5781275 in  () at /usr/lib/libQt5Quick.so.5
> #11 0x00007ffff57820a5 in  () at /usr/lib/libQt5Quick.so.5
> #12 0x00007ffff1f0f935 in QWindow::event(QEvent*) () at /usr/lib/libQt5Gui.so.5
> #13 0x00007ffff57fe65c in QQuickWindow::event(QEvent*) () at /usr/lib/libQt5Quick.so.5
> #14 0x00007ffff799b4a4 in PlasmaQuick::Dialog::event(QEvent*) () at /usr/lib/libKF5PlasmaQuick.so.5
> #15 0x00007ffff2fa6a74 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
> #16 0x00007ffff2fae341 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
> #17 0x00007ffff195ccb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
> #18 0x00007ffff1f04146 in QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) () at /usr/lib/libQt5Gui.so.5
> #19 0x00007ffff1f04e7e in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/libQt5Gui.so.5
> #20 0x00007ffff1edeb7c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Gui.so.5
> #21 0x00007fffe36ed72d in  () at /usr/lib/libQt5XcbQpa.so.5
> #22 0x00007ffff195b94c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
> #23 0x00007ffff1963c46 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
> #24 0x000055555557064e in  ()
> #25 0x00007ffff0fc906b in __libc_start_main () at /usr/lib/libc.so.6
> #26 0x0000555555570aca in _start ()

This is another backtrace using Plasma 5.13.1 and Mesa 18.1.1, but without debug symbols:

> #0  0x00007fffd2541626 in  () at /usr/lib/dri/i965_dri.so
> #1  0x00007fffd2515751 in  () at /usr/lib/dri/i965_dri.so
> #2  0x00007ffff575e82d in QSGBatchRenderer::Renderer::renderBatches() () at /usr/lib/libQt5Quick.so.5
> #3  0x00007ffff5764103 in QSGBatchRenderer::Renderer::render() () at /usr/lib/libQt5Quick.so.5
> #4  0x00007ffff57544ee in QSGRenderer::renderScene(QSGBindable const&) () at /usr/lib/libQt5Quick.so.5
> #5  0x00007ffff57549bc in QSGRenderer::renderScene(unsigned int) () at /usr/lib/libQt5Quick.so.5
> #6  0x00007ffff578f030 in QSGDefaultRenderContext::renderNextFrame(QSGRenderer*, unsigned int) () at /usr/lib/libQt5Quick.so.5
> #7  0x00007ffff57f2db5 in QQuickWindowPrivate::renderSceneGraph(QSize const&) () at /usr/lib/libQt5Quick.so.5
> #8  0x00007ffff5781275 in  () at /usr/lib/libQt5Quick.so.5
> #9  0x00007ffff57820a5 in  () at /usr/lib/libQt5Quick.so.5
> #10 0x00007ffff1f0f935 in QWindow::event(QEvent*) () at /usr/lib/libQt5Gui.so.5
> #11 0x00007ffff57fe65c in QQuickWindow::event(QEvent*) () at /usr/lib/libQt5Quick.so.5
> #12 0x00007ffff799b4a4 in PlasmaQuick::Dialog::event(QEvent*) () at /usr/lib/libKF5PlasmaQuick.so.5
> #13 0x00007ffff2fa6a74 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
> #14 0x00007ffff2fae341 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
> #15 0x00007ffff195ccb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
> #16 0x00007ffff1f04146 in QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) () at /usr/lib/libQt5Gui.so.5
> #17 0x00007ffff1f04e7e in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/libQt5Gui.so.5
> #18 0x00007ffff1edeb7c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Gui.so.5
> #19 0x00007fffe36ed72d in  () at /usr/lib/libQt5XcbQpa.so.5
> #20 0x00007ffff195b94c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
> #21 0x00007ffff1963c46 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
> #22 0x000055555557064e in  ()
> #23 0x00007ffff0fc906b in __libc_start_main () at /usr/lib/libc.so.6
> #24 0x0000555555570aca in _start ()

Please do not hesitate to ask me for any other information you need. This is my first time submitting a Mesa bug and I might not be foreseeing all the necessary information.

Thanks.
Comment 1 Marina Chernish 2018-07-17 14:53:51 UTC
Hi,

Similar issue was observed in following way: on the Plasma Wayland desktop were opened several application windows and hovered over system panel clock by mouse cursor (it reproduces not usually and could need several attempts). When clock pop-up appears the desktop hangs showing blinking clock pop-up. 
Dmesg shows error: segfault at 1ac ip .... sp .... error 6 in libwayland-client.so.0.3.0 (see also attachement)

I use following configuration:
OS: Linux 4.14.54-1-Manjaro x86_64
DRI: Intel(R) Ivybridge 
Mesa: 18.1.1
Plasma-Wayland 5.13.2-1
qt: 5.11.1-1

Could you please provide your dmesg output when this described issue happened?
Comment 2 Marina Chernish 2018-07-17 14:55:24 UTC
Created attachment 140667 [details]
dmesg output while Plasma hangs
Comment 3 Marina Chernish 2018-07-17 14:55:43 UTC
Also I am going to install mesa 18.1.0 and reproduce the issue (in ideal case, if I don't reproduce it, I will bisect mesa)
Comment 4 magiblot 2018-07-17 23:18:17 UTC
Hi Cherry, thanks for commenting. For some reason I see nothing related to the crash in dmesg.

If you want, you can debug the crash with gdb. For example, to run a Wayland session from tty:

> gdb --args bash /usr/bin/startplasmacompositor

A compiled mesa with debug symbols can be downloaded from the unofficial mesa-git repository. I added the following to pacman.conf, although I'm on Arch Linux. With this installed, backtraces will contain useful references to the source code.

[mesa-git]
SigLevel = PackageOptional
Server = https://pkgbuild.com/~lcarlier/$repo/$arch
Comment 5 Marina Chernish 2018-07-18 12:56:11 UTC
Created attachment 140688 [details]
Output for Plasma while is hangs
Comment 6 Marina Chernish 2018-07-18 12:57:35 UTC
Hi magiblot,

Thank you for your advising regarding gdb! I also will try it.

So far I'm trying to assume my current observations and if they are related to yours.
I have two following ways leading to the bug:
1) Open XFCE and start Plasma from its terminal: startplasmacompositor. Wait till Plasma session starts and open some application windows (in my case I opened Octopi), try to change its size. 
After this all sessions stopped and OS begins to restart but hangs. Only restart helps in this case.
2) Open Plasma Wayland desktop while login in (making it single working desktop) open some application windows (in my case I opened terminal, Octopi and Firefox). Also I have Octopi notifier in the Task manager which reminds I have some outdated applications. Bug reproduces usually when I hover by mouse cursor over this Octopi notifier and then over the clock so both pop-ups are getting open (Octopi and clock pop-ups). Task panel and also desktop with all its functionality hangs and I have only blinking clock pop-up.
Also no dmesg information related to this issues. But managed to catch plasma's output in case of 1st crash (attached in previous comment).

All mentioned bugs are reproduced on mesa 18.1.0-1 and Plasma 5.12.5-1 installed.

Could you please try these steps so figure out as you have same behaviour?
Comment 7 magiblot 2018-07-18 20:02:17 UTC
Well, that's a lot of applications I would have to install to follow your steps, so I suggest that you get a gdb backtrace to determine if it's the same issue.

Forget the command I said, that's not the good one. In my case, the screen freezes instead of bringing me back to the console. So, it should be easier with these steps:

0. Add the kernel parameter 'sysrq_always_enabled=1' to the boot manager**.
1. Run 'startplasmacompositor'
2. In a terminal, run 'killall plasmashell'
3. Change to a tty, log in to your user and run 'env DISPLAY=:0 gdb plasmashell'
4. In the gdb prompt, run 'set logging on'.
5. Then start plasmashell with 'run'.
6. Switch back to Plasma 5 with the proper Alt+F? key combination.
7. After some seconds, the task bar will become visible again.
8. Reproduce the crash.
9. If the screen is frozen, press Alt+SysRq+R (unraw keyboard) two times, and then switch to the tty where gdb is running.
10. gdb should have noticed about the crash. Run 'bt'. Because of step 4, this has been saved to 'gdb.txt' in your home directory.

**In my case this is done by adding that as the last option in the GRUB_CMDLINE_LINUX_DEFAULT string of /etc/default/grub. To update the boot settings, I have to run 'sudo grub-mkconfig -o /boot/grub/grub.cfg' and reboot the system.
Comment 8 Marina Chernish 2018-07-26 17:07:58 UTC
Hi magiblot,

It is so kind from your side to provide such detailed description of way how to catch the debug information.
I carefully followed these steps but unfortunately faced problem in running plasmashell under gdb.
Here is log output that was obtained after trying to start plasmashell under gdb (having mesa from unofficial repository you mentioned):


GNU gdb (GDB) 8.1
Copyright (C) 2018 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-pc-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 plasmashell...(no debugging symbols found)...done.
(gdb) set logging on
Copying output to gdb.txt.
(gdb) run
Starting program: /usr/bin/plasmashell 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe2af6700 (LWP 1482)]
[New Thread 0x7fffe1ad0700 (LWP 1483)]
org.kde.plasmaquick: Applet preload policy set to 1
[New Thread 0x7fffdadb7700 (LWP 1484)]
Using Wayland-EGL
wl_drm@25: error 0: authenicate failed
failed to initialize EGL display
trying to show an empty dialog
Using the 'xdg-shell-v6' shell integration
The Wayland connection experienced a fatal error (Protocol error)
[Thread 0x7fffe2af6700 (LWP 1482) exited]
[Thread 0x7fffdadb7700 (LWP 1484) exited]
[Thread 0x7ffff7f8df00 (LWP 1476) exited]
[Inferior 1 (process 1476) exited with code 01]
(gdb) q


Could you please suggest a way how to deal with this problem?
Comment 9 magiblot 2018-07-27 13:22:14 UTC
Okay, so it is not possible for you to run plasmashell from tty.
Let's try attaching gdb to the already running process. Follow these steps (some are copied from my previous message):

0. Add the kernel parameter 'sysrq_always_enabled=1' to the boot manager.
1. Run 'startplasmacompositor'
2. Switch to a tty, log in to your user and run 'sudo gdb -p $(pidof plasmashell)'
3. In the gdb prompt, run 'set logging on', and then 'continue'.
4. Switch back to Plasma 5 with the proper Alt+F? key combination.
5. Reproduce the crash.
6. If the screen is frozen, press Alt+SysRq+R (unraw keyboard), and then switch to the tty where gdb is running.
7. gdb should have noticed about the crash. Run 'bt'. Because of 'set logging on', this has been saved to 'gdb.txt' in your home directory.
Comment 10 Marina Chernish 2018-07-30 12:28:17 UTC
Hi magiblot,

I’m so much grateful for your helping and support in digging up the issue. The last suggested way finely was successful but unfortunately my log output looks differently then yours:

0x00007f02850cfffc in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#0  0x00007f02850cfffc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007f0285f2c2fc in QWaitCondition::wait(QMutex*, unsigned long) () at /usr/lib/libQt5Core.so.5
#2  0x00007f0289f15423 in  () at /usr/lib/libQt5Quick.so.5
#3  0x00007f0289f17a17 in  () at /usr/lib/libQt5Quick.so.5
#4  0x00007f0289f1807b in  () at /usr/lib/libQt5Quick.so.5
#5  0x00007f028668c935 in QWindow::event(QEvent*) () at /usr/lib/libQt5Gui.so.5
#6  0x00007f0289f7b65c in QQuickWindow::event(QEvent*) () at /usr/lib/libQt5Quick.so.5
#7  0x00007f028c1184a4 in PlasmaQuick::Dialog::event(QEvent*) () at /usr/lib/libKF5PlasmaQuick.so.5
#8  0x00007f01e4f42b96 in  () at /usr/lib/qt/qml/org/kde/plasma/core/libcorebindingsplugin.so
#9  0x00007f0287723a74 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#10 0x00007f028772b341 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#11 0x00007f02860d9cb9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#12 0x00007f0286681146 in QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) () at /usr/lib/libQt5Gui.so.5
#13 0x00007f0286681e7e in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/libQt5Gui.so.5
#14 0x00007f028665bb7c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Gui.so.5
#15 0x00007f0277dc357d in  () at /usr/lib/libQt5WaylandClient.so.5
#16 0x00007f02860d894c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#17 0x00007f02860e0c46 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#18 0x000055ba8acc564e in  ()
#19 0x00007f028574606b in __libc_start_main () at /usr/lib/libc.so.6
#20 0x000055ba8acc5aca in _start ()
Detaching from program: /usr/bin/plasmashell, process 701

So looks I found some another issue than yours and it wasn’t possible to reproduce your one :(
It would be helpful if you mentioned which plasma addons, utils or related applications you also have installed. Possibly some of them could cause this problem.
Comment 11 magiblot 2018-07-30 14:06:52 UTC
You are welcome.

I didn't install any additional addons and I don't think the crash is related to any of my applications. Anyway, I believe this is not important because it looks like plasmashell isn't the process which suffers the crash in your case. After taking a better look at your second attachment, it seems that kwin_wayland (the Window Manager) is the process which suffers the crash:

> 
> /bin/startplasmacompositor: line 234:   836 Aborted                 (core dumped) /usr/bin/kwin_wayland --xwayland --libinput --exit-with-session=/usr/lib/startplasma
> 

So I suggest you try to reproduce the issue again but attaching gdb to the kwin_wayland process instead of plasmashell: 'sudo gdb -p $(pidof kwin_wayland)'

Cheers.
Comment 12 Marina Chernish 2018-08-08 13:55:47 UTC
Hi magiblot,

I've attached kwin_wayland to gdb but I don't see any related messages in log:

Continuing.

Thread 1 "kwin_wayland" received signal SIGINT, Interrupt.
0x00007f23aaa10fa6 in ppoll () from /usr/lib/libc.so.6
#0  0x00007f23aaa10fa6 in ppoll () at /usr/lib/libc.so.6
#1  0x00007f23ab551e11 in qt_safe_poll(pollfd*, unsigned long, timespec const*) () at /usr/lib/libQt5Core.so.5
#2  0x00007f23ab5533fb in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#3  0x00007f239533c72e in  () at /usr/lib/qt/plugins/platforms/KWinQpaPlugin.so
#4  0x00007f23ab50194c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#5  0x00007f23ab509c46 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#6  0x000056521fab7df6 in  ()
#7  0x00007f23aa94606b in __libc_start_main () at /usr/lib/libc.so.6
#8  0x000056521fab862a in _start ()
Detaching from program: /usr/bin/kwin_wayland, process 612

only this was caught while issue was reproduced.
Comment 13 magiblot 2018-08-08 14:15:40 UTC
If SIGINT is the only signal kwin_wayland gets during the issue, then it's not the process which suffers the crash. Nevertheless, it looks strange to me that kwin_wayland gets a SIGINT from another process (since it's the same signal you send when you press CTRL+C in the console).

It seems that you will have to investigate further into the issue until you can track down the crashing process. You can try debugging other processes which you suspect might be implied.

Cheers.
Comment 14 magiblot 2018-09-23 17:24:19 UTC
Problem still persists as of mesa-git 104860.18a6e426f3.
Please have a look at it or at least tell me if I should provide any more info.

> Thread 1 "plasmashell" received signal SIGSEGV, Segmentation fault.
> 0x00007f28fd56dc96 in intel_miptree_level_has_hiz (mt=0x0, level=0)
> pmap_tree.c:1908
> 1908	   return mt->level[level].has_hiz;
> #0  0x00007f28fd56dc96 in intel_miptree_level_has_hiz (mt=0x0, level=0)
>     at intel_mipmap_tree.c:1908
> #1  0x00007f28fd56c06f in intel_renderbuffer_has_hiz (irb=irb@entry=0x559f6d968a20)
>     at intel_fbo.c:933
> #2  0x00007f28fd53dc8e in brw_fast_clear_depth (ctx=0x559f6e2017d0) at brw_clear.c:114
> #3  0x00007f28fd53dc8e in brw_clear (ctx=0x559f6e2017d0, mask=50) at brw_clear.c:258
> #4  0x00007f2911298bdd in QSGBatchRenderer::Renderer::renderBatches() ()
>     at /usr/lib/libQt5Quick.so.5
> #5  0x00007f291129e4b3 in QSGBatchRenderer::Renderer::render() ()
>     at /usr/lib/libQt5Quick.so.5
> #6  0x00007f291128e89e in QSGRenderer::renderScene(QSGBindable const&) ()
>     at /usr/lib/libQt5Quick.so.5
> #7  0x00007f291128ed6c in QSGRenderer::renderScene(unsigned int) ()
>     at /usr/lib/libQt5Quick.so.5
> #8  0x00007f29112c93f0 in QSGDefaultRenderContext::renderNextFrame(QSGRenderer*, unsigned int) () at /usr/lib/libQt5Quick.so.5
> #9  0x00007f291132d1c5 in QQuickWindowPrivate::renderSceneGraph(QSize const&) ()
>     at /usr/lib/libQt5Quick.so.5
> #10 0x00007f29112bb634 in  () at /usr/lib/libQt5Quick.so.5
> #11 0x00007f29112bc435 in  () at /usr/lib/libQt5Quick.so.5
> #12 0x00007f290fc1ba95 in QWindow::event(QEvent*) () at /usr/lib/libQt5Gui.so.5
> #13 0x00007f2911338a5c in QQuickWindow::event(QEvent*) () at /usr/lib/libQt5Quick.so.5
> #14 0x00007f29120f5744 in PlasmaQuick::Dialog::event(QEvent*) ()
>     at /usr/lib/libKF5PlasmaQuick.so.5
> #15 0x00007f29102bfe14 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
>     at /usr/lib/libQt5Widgets.so.5
> #16 0x00007f29102c76e1 in QApplication::notify(QObject*, QEvent*) ()
>     at /usr/lib/libQt5Widgets.so.5
> #17 0x00007f290f866c39 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
>     at /usr/lib/libQt5Core.so.5
> #18 0x00007f290fc103b6 in QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) () at /usr/lib/libQt5Gui.so.5
> #19 0x00007f290fc110ee in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/libQt5Gui.so.5
> #20 0x00007f290fbeaa3c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Gui.so.5
> #21 0x00007f2908579e1d in  () at /usr/lib/libQt5XcbQpa.so.5
> #22 0x00007f290f8658cc in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
>     at /usr/lib/libQt5Core.so.5
> #23 0x00007f290f86dbc6 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
> #24 0x0000559f6d72dd3e in  ()
> #25 0x00007f290f2c6223 in __libc_start_main () at /usr/lib/libc.so.6
> #26 0x0000559f6d72e1be in _start ()

Thank you.
Comment 15 magiblot 2018-11-03 20:47:36 UTC
Still happening with mesa-git 105404.9007c0ed26

> #0  0x00007f1c8fa55e06 in intel_miptree_level_has_hiz (mt=0x0, level=0) at intel_mipmap_tree.c:1910
> #1  0x00007f1c8fa5404f in intel_renderbuffer_has_hiz (irb=irb@entry=0x5568342a4a40) at intel_fbo.c:944
> #2  0x00007f1c8fa2668e in brw_fast_clear_depth (ctx=0x556831ebafa0) at brw_clear.c:114
> #3  0x00007f1c8fa2668e in brw_clear (ctx=0x556831ebafa0, mask=50) at brw_clear.c:258
> #4  0x00007f1ca62f3bdd in QSGBatchRenderer::Renderer::renderBatches() () at /usr/lib/libQt5Quick.so.5
> #5  0x00007f1ca62f94b3 in QSGBatchRenderer::Renderer::render() () at /usr/lib/libQt5Quick.so.5
> #6  0x00007f1ca62e989e in QSGRenderer::renderScene(QSGBindable const&) () at /usr/lib/libQt5Quick.so.5
> #7  0x00007f1ca62e9d6c in QSGRenderer::renderScene(unsigned int) () at /usr/lib/libQt5Quick.so.5
> #8  0x00007f1ca63243f0 in QSGDefaultRenderContext::renderNextFrame(QSGRenderer*, unsigned int) ()
>     at /usr/lib/libQt5Quick.so.5
> #9  0x00007f1ca63881c5 in QQuickWindowPrivate::renderSceneGraph(QSize const&) () at /usr/lib/libQt5Quick.so.5
> #10 0x00007f1ca6316634 in  () at /usr/lib/libQt5Quick.so.5
> #11 0x00007f1ca6317435 in  () at /usr/lib/libQt5Quick.so.5
> #12 0x00007f1ca4c6aa95 in QWindow::event(QEvent*) () at /usr/lib/libQt5Gui.so.5
> #13 0x00007f1ca6393a5c in QQuickWindow::event(QEvent*) () at /usr/lib/libQt5Quick.so.5
> #14 0x00007f1ca6ab0744 in PlasmaQuick::Dialog::event(QEvent*) () at /usr/lib/libKF5PlasmaQuick.so.5
> #15 0x00007f1ca530ce14 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
>     at /usr/lib/libQt5Widgets.so.5
> #16 0x00007f1ca53146e1 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
> #17 0x00007f1ca48b3c39 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
> #18 0x00007f1ca4c5f3b6 in QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent*) () at /usr/lib/libQt5Gui.so.5
> #19 0x00007f1ca4c600ee in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/libQt5Gui.so.5
> #20 0x00007f1ca4c39a3c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Gui.so.5
> #21 0x00007f1c9db2de1d in  () at /usr/lib/libQt5XcbQpa.so.5
> #22 0x00007f1ca48b28cc in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
>     at /usr/lib/libQt5Core.so.5
> #23 0x00007f1ca48babc6 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
> #24 0x000055682f748d2e in  ()
> #25 0x00007f1ca4313223 in __libc_start_main () at /usr/lib/libc.so.6
> #26 0x000055682f7491de in _start ()
Comment 16 Danylo 2018-11-05 12:20:59 UTC
Created attachment 142368 [details] [review]
mipmap creation error logs

Hi,

Sorry that this bug got forgotten...
Since we cannot reproduce this locally - let's add some logs and see what's going wrong. I'm attaching a patch with additional logging. 

If you have some time then try to reproduce the issue with my patch applied - run startplasmacompositor with INTEL_DEBUG=fbo or even INTEL_DEBUG=fbo,mip (may be quite verbose) and post its output here.

From your backtrace the miptree is nullptr, probably there was an error during its creation however there is a lack of logs for such case, hence the patch.

I hope it will shed the light on the cause.
Comment 17 magiblot 2018-11-05 12:42:03 UTC
(In reply to Danylo from comment #16)

Thanks Danylo. I'm aware this is not an easy bug. I will find the time to recompile mesa with the submitted patch and run the experiment.

I'm a bit worried about compiling mesa, however. Do I need to compile the whole of mesa, or is there any trick to compile only the modified components?

Thank you very much.
Comment 18 Danylo 2018-11-05 13:26:30 UTC
Created attachment 142369 [details]
pkgbuild for patched mesa

There are two way to test the patch:

1. Manually clone mesa repository, apply patch, build it, and launch startplasmacompositor with LIBGL_DRIVERS_PATH=path_to_compiled_mesa/lib/dri

See https://www.mesa3d.org/meson.html for build instructions, instead of "meson configure build/" you can compile less with:

meson configure build/ \
       -D b_ndebug=false \
       -D buildtype=debug \
       -D prefix=path_to_compiled_mesa \
       -D platforms=x11,wayland,drm,surfaceless \
       -D dri-drivers=i965 \
       -D gallium-drivers= \
       -D vulkan-drivers=intel \
       -D dri3=true \
       -D egl=true \
       -D gbm=true \
       -D gles1=true \
       -D gles2=true \
       -D glvnd=true \
       -D glx=dri \
       -D libunwind=true \
       -D lmsensors=true \
       -D shared-glapi=true \
       -D valgrind=false \

Next compilations with "ninja -C build/" will be incremental.

2. Since you are on Arch you can use custom pkgbuild as a more convenient way, it will be installed system-wide but you'll later just reinstall mesa from the official repo. Downside is that Mesa will need full rebuild (but it's not that long) if I provide other patches. 

I'm attaching PKGBUILD which will also apply my patch, you'll need to place it in separate directory, run makepkg there and then "makepkg --install" (see https://wiki.archlinux.org/index.php/makepkg)
Comment 19 magiblot 2018-11-06 01:24:42 UTC
Created attachment 142379 [details]
debug log having applied the patch above

(In reply to Danylo from comment #18)

It was very kind of you to provide a specific PKGBUILD for this purpose. It indeed compiled much faster than I expected.

I was able to test the crash again, but got different results. I have been unable to catch plasmashell getting SIGSEGV. It is just Xwayland who gets SIGABRT twice and then exits.

I have already seen this before (not back when I opened this report) but plasmashell would at times still get SIGSEGV. This doesn't seem to be the case anymore.

Some time ago I found the crash this report is about can be worked around with 'QT_QPA_PLATFORM=wayland-egl', which will force all Qt applications into native Wayland rendering (and I guess plasmashell is one of them). So Xwayland can be considered suspect of this issue.

If there is a bug in Qt, Xwayland or another library, then I imagine the SIGSEGV was caused by either of these messing up before mesa finished rendering their items (and thus causing the miptree not to be created properly). I guess your patches just make mesa less vulnerable against this.

I'm enclosing the log for one of the crashes, with INTEL_DEBUG=fbo,mip. I have no actual knowledge about rendering, so maybe you find more meaning in it.

Thank you very much.
Comment 20 Danylo 2018-11-06 12:13:26 UTC
The only error in logs is:

> Xwayland: ../xorg-server-1.20.1/hw/xwayland/xwayland-present.c:516: 
> xwl_present_flips_stop: Assertion `xwl_window->present_window == window' failed.

Which looks like a cause of latest crash, it probably should be reported to Wayland.

The PKGBUILD I provided produced debug build, before making any conclusion, could you change

> -D buildtype=debug \

to

> -D buildtype=plain \

and rebuild the package. If mesa doesn't crash in debug build but will crash in release that would tell us something.
Comment 21 magiblot 2018-11-08 23:07:33 UTC
(In reply to Danylo from comment #20)

Well, that made no difference.

However, the Xwayland error message leads to the already reported bug https://bugs.freedesktop.org/show_bug.cgi?id=106930, which I would have liked to run across before blaming mesa. I guess I'll be joining that discussion soon.

I can't even reproduce the segmentation fault with mesa-git anymore, so it seems like mesa has nothing to learn from this bug report.

Anyway, I must thank you again for your help. Not only I learned some things, but I wouldn't have found the source of the error if it weren't by your advice.

Cheers.
Comment 22 Danylo 2018-11-09 11:59:55 UTC
(In reply to magiblot from comment #21)

Interesting, good luck with the new bug!
Comment 23 pmargeti34 2018-12-13 16:48:40 UTC
Just to add to this, I am experiencing the exact same issue using AMD GPU. Using opensource drivers on Arch Linux, with plasma 5.14.4 and Mesa 18.3.1
Comment 24 magiblot 2018-12-22 21:31:33 UTC
(In reply to pmargeti34 from comment #23)
> Just to add to this, I am experiencing the exact same issue using AMD GPU.
> Using opensource drivers on Arch Linux, with plasma 5.14.4 and Mesa 18.3.1

Hi pmargeti34, I have added you to the CC list of the proper bug report for this issue. Mesa used to crash for me but in my last checks (see comment #21) I found out the actual problem originates in XWayland.

Cheers.
Comment 25 Denis 2019-06-26 09:29:04 UTC
hi guys, as I see, related issue in Xwayland was fixed, so I am closing current issue as "not a mesa bug".
In case if you find out that the problem wasn't solved for you with updated xwayland (included that commit), please fill free to reopen current issue with new logs and details. Thanks.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.