[Mesa-dev] [PATCH] Fix crash in update_framebuffer_state

David Weber weber.aulendorf at gmail.com
Wed Jul 16 15:02:11 PDT 2014


Hi,

GPU: Radeon HD 5770
mesa: 10.2.2 with gallium/llvm backend
llvm: 3.4.2
linux: 3.15.3
xf86-video-ati: 7.4.0

Switching from the software to the OpenGL backend in Gwenview with EGL
enabled QT4 crashes with the following BT:
state_tracker/st_atom_framebuffer.c:60:update_framebuffer_size:
Assertion `surface' failed.

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007fffe09e7ec1 in _debug_assert_fail (expr=0x7fffe0f9f85c
"surface", file=0x7fffe0f9f838 "state_tracker/st_atom_framebuffer.c",
line=60,
    function=0x7fffe0f9f9a0 <__func__.33915>
"update_framebuffer_size") at util/u_debug.c:277
277     util/u_debug.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  0x00007fffe09e7ec1 in _debug_assert_fail (expr=0x7fffe0f9f85c
"surface", file=0x7fffe0f9f838 "state_tracker/st_atom_framebuffer.c",
line=60,
    function=0x7fffe0f9f9a0 <__func__.33915>
"update_framebuffer_size") at util/u_debug.c:277
#1  0x00007fffe0c8715d in update_framebuffer_size
(framebuffer=0x17f82b0, surface=0x0) at
state_tracker/st_atom_framebuffer.c:60
#2  0x00007fffe0c87446 in update_framebuffer_state (st=0x17f76d0) at
state_tracker/st_atom_framebuffer.c:132
#3  0x00007fffe0c84457 in st_validate_state (st=0x17f76d0) at
state_tracker/st_atom.c:213
#4  0x00007fffe0c91618 in st_Clear (ctx=0x17b3a30, mask=2) at
state_tracker/st_cb_clear.c:446
#5  0x00007fffe0b10a39 in _mesa_Clear (mask=16384) at main/clear.c:226
#6  0x00007ffff20c9aaa in ?? () from /usr/lib64/qt4/libQtOpenGL.so.4
#7  0x00007ffff4a21cfb in QPainter::begin(QPaintDevice*) () from
/usr/lib64/qt4/libQtGui.so.4
#8  0x00007ffff4a22768 in QPainter::QPainter(QPaintDevice*) () from
/usr/lib64/qt4/libQtGui.so.4
#9  0x00007ffff4ec9544 in QGraphicsView::paintEvent(QPaintEvent*) ()
from /usr/lib64/qt4/libQtGui.so.4
#10 0x00007ffff49221f0 in QWidget::event(QEvent*) () from
/usr/lib64/qt4/libQtGui.so.4
#11 0x00007ffff4cb595e in QFrame::event(QEvent*) () from
/usr/lib64/qt4/libQtGui.so.4
#12 0x00007ffff4ecd32b in QGraphicsView::viewportEvent(QEvent*) ()
from /usr/lib64/qt4/libQtGui.so.4
#13 0x00007ffff6a9f223 in
QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*,
QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#14 0x00007ffff48d4bac in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#15 0x00007ffff48d7602 in QApplication::notify(QObject*, QEvent*) ()
from /usr/lib64/qt4/libQtGui.so.4
#16 0x00007ffff5600a08 in KApplication::notify(QObject*, QEvent*) ()
from /usr/lib64/libkdeui.so.5
#17 0x00007ffff6a9f0ad in QCoreApplication::notifyInternal(QObject*,
QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#18 0x00007ffff492705f in QWidgetPrivate::drawWidget(QPaintDevice*,
QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*)
() from /usr/lib64/qt4/libQtGui.so.4
#19 0x00007ffff4ae5639 in QWidgetPrivate::repaint_sys(QRegion const&)
() from /usr/lib64/qt4/libQtGui.so.4
#20 0x00007ffff49159e4 in QWidgetPrivate::syncBackingStore() () from
/usr/lib64/qt4/libQtGui.so.4
#21 0x00007ffff4922691 in QWidget::event(QEvent*) () from
/usr/lib64/qt4/libQtGui.so.4
#22 0x00007ffff209fd0a in QGLWidget::event(QEvent*) () from
/usr/lib64/qt4/libQtOpenGL.so.4
#23 0x00007ffff48d4bcc in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#24 0x00007ffff48d7602 in QApplication::notify(QObject*, QEvent*) ()
from /usr/lib64/qt4/libQtGui.so.4
#25 0x00007ffff5600a08 in KApplication::notify(QObject*, QEvent*) ()
from /usr/lib64/libkdeui.so.5
#26 0x00007ffff6a9f0ad in QCoreApplication::notifyInternal(QObject*,
QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#27 0x00007ffff6aa26e8 in
QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
() from /usr/lib64/qt4/libQtCore.so.4
#28 0x00007ffff6acd653 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#29 0x00007ffff05e4a94 in g_main_context_dispatch () from
/usr/lib64/libglib-2.0.so.0
#30 0x00007ffff05e4df0 in ?? () from /usr/lib64/libglib-2.0.so.0
#31 0x00007ffff05e4eac in g_main_context_iteration () from
/usr/lib64/libglib-2.0.so.0
#32 0x00007ffff6acd7c6 in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
() from /usr/lib64/qt4/libQtCore.so.4
#33 0x00007ffff4975f26 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#34 0x00007ffff6a9dcef in
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
from /usr/lib64/qt4/libQtCore.so.4
#35 0x00007ffff6a9dfd0 in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/usr/lib64/qt4/libQtCore.so.4
#36 0x00007ffff4d6e147 in QDialog::exec() () from /usr/lib64/qt4/libQtGui.so.4
#37 0x000000000044c7f3 in Gwenview::MainWindow::showConfigDialog
(this=0xaf1e30) at /home/weber/work/gwenview/app/mainwindow.cpp:1468
#38 0x00007ffff6ab3644 in QMetaObject::activate(QObject*, QMetaObject
const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#39 0x00007ffff48ce752 in QAction::triggered(bool) () from
/usr/lib64/qt4/libQtGui.so.4
#40 0x00007ffff48cfb00 in QAction::activate(QAction::ActionEvent) ()
from /usr/lib64/qt4/libQtGui.so.4
#41 0x00007ffff4ceef83 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#42 0x00007ffff4cf4179 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#43 0x00007ffff56bb44e in KMenu::mouseReleaseEvent(QMouseEvent*) ()
from /usr/lib64/libkdeui.so.5
#44 0x00007ffff492223b in QWidget::event(QEvent*) () from
/usr/lib64/qt4/libQtGui.so.4
#45 0x00007ffff4cf58b3 in QMenu::event(QEvent*) () from
/usr/lib64/qt4/libQtGui.so.4
#46 0x00007ffff48d4bcc in QApplicationPrivate::notify_helper(QObject*,
QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#47 0x00007ffff48d7e79 in QApplication::notify(QObject*, QEvent*) ()
from /usr/lib64/qt4/libQtGui.so.4
#48 0x00007ffff5600a08 in KApplication::notify(QObject*, QEvent*) ()
from /usr/lib64/libkdeui.so.5
#49 0x00007ffff6a9f0ad in QCoreApplication::notifyInternal(QObject*,
QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#50 0x00007ffff48dad03 in
QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*,
QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /usr/lib64/qt4/libQtGui.so.4
#51 0x00007ffff494e40c in ?? () from /usr/lib64/qt4/libQtGui.so.4
#52 0x00007ffff494d301 in QApplication::x11ProcessEvent(_XEvent*) ()
from /usr/lib64/qt4/libQtGui.so.4
#53 0x00007ffff4975e52 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#54 0x00007ffff05e4a94 in g_main_context_dispatch () from
/usr/lib64/libglib-2.0.so.0
#55 0x00007ffff05e4df0 in ?? () from /usr/lib64/libglib-2.0.so.0
#56 0x00007ffff05e4eac in g_main_context_iteration () from
/usr/lib64/libglib-2.0.so.0
#57 0x00007ffff6acd7ee in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
() from /usr/lib64/qt4/libQtCore.so.4
#58 0x00007ffff4975f26 in ?? () from /usr/lib64/qt4/libQtGui.so.4
#59 0x00007ffff6a9dcef in
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
from /usr/lib64/qt4/libQtCore.so.4
#60 0x00007ffff6a9dfd0 in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/usr/lib64/qt4/libQtCore.so.4
#61 0x00007ffff6aa32c8 in QCoreApplication::exec() () from
/usr/lib64/qt4/libQtCore.so.4
#62 0x0000000000429d36 in main (argc=<optimized out>,
argv=0x7fffffffdb58) at /home/weber/work/gwenview/app/main.cpp:139

I've no idea what the whole code is doing but I took a quick guess to
get at least rid of the crash.

The OpenGL backend is still nonfunctional and Gwenview still crashes
on a clean start but this is probably a QT bug, see:
https://bugs.gentoo.org/show_bug.cgi?id=405989
Possibly releated:
https://bugs.kde.org/show_bug.cgi?id=198294
https://bugreports.qt-project.org/browse/QTBUG-12836

Cheers,
David

>From 68939d1cfe3c94e8cda5cfc2e6d941ddd979e0bd Mon Sep 17 00:00:00 2001
From: David Weber <weber.aulendorf at googlemail.com>
Date: Wed, 16 Jul 2014 23:34:52 +0200
Subject: [PATCH] Don't update framebuffer size without surface

---
 src/mesa/state_tracker/st_atom_framebuffer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c
b/src/mesa/state_tracker/st_atom_framebuffer.c
index b195c55..7c2eec0 100644
--- a/src/mesa/state_tracker/st_atom_framebuffer.c
+++ b/src/mesa/state_tracker/st_atom_framebuffer.c
@@ -127,9 +127,9 @@ update_framebuffer_state( struct st_context *st )
       if (strb->is_rtt) {
          /* rendering to a GL texture, may have to update surface */
          st_update_renderbuffer_surface(st, strb);
+         pipe_surface_reference(&framebuffer->zsbuf, strb->surface);
+         update_framebuffer_size(framebuffer, strb->surface);
       }
-      pipe_surface_reference(&framebuffer->zsbuf, strb->surface);
-      update_framebuffer_size(framebuffer, strb->surface);
    }
    else {
       strb = st_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer);
-- 
2.0.0


More information about the mesa-dev mailing list