Bug 235111 - KCategorizedView draws garbage and hits an assert if not ScrollPerPixel
Summary: KCategorizedView draws garbage and hits an assert if not ScrollPerPixel
Status: RESOLVED WORKSFORME
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdeui (show other bugs)
Version: 4.4
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-22 22:29 UTC by Marco Martin
Modified: 2021-01-06 04:34 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot (234.11 KB, image/png)
2010-05-06 04:33 UTC, Weng Xuetian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Martin 2010-04-22 22:29:32 UTC
Version:            (using Devel)
Compiler:          gcc 4.4.1 [gcc-4_4-branch revision 150839] (SUSE Linux) 
OS:                Linux
Installed from:    Compiled sources

svn version of kdelibs: 1117720

if i create a KCategorizedView and is not either in icon mode (like systemsettings)
or the verticalScrollMode is not QListView::ScrollPerPixel, after the list is scrolled, it can be either badly drawn or crash, hitting an assert.
A simple way to trigger this is to apply this patch on the systray plasma applet:

Index: workspace/plasma/generic/applets/systemtray/ui/applet.cpp
===================================================================
--- workspace/plasma/generic/applets/systemtray/ui/applet.cpp   (revision 1117718)
+++ workspace/plasma/generic/applets/systemtray/ui/applet.cpp   (working copy)
@@ -481,7 +481,6 @@
 
         m_plasmoidTasksUi.visibleItemsView->setCategoryDrawer(new KCategoryDrawerV3(m_plasmoidTasksUi.visibleItemsView));
         m_plasmoidTasksUi.visibleItemsView->setMouseTracking(true);
-        m_plasmoidTasksUi.visibleItemsView->setVerticalScrollMode(QListView::ScrollPerPixel);
 
         KCategorizedSortFilterProxyModel *visibleItemsModel = new KCategorizedSortFilterProxyModel();
 


this is the backtrace:
the view seems to scroll "too much", after all the items go offscreen this crash is produced. i guess the view is attempting to fetch a modelitem out of boundaries.
this happens only if the model has been set as categorizedmodel and the view had a categorydrawer set

Application: Plasma Widget Viewer (plasmoidviewer), signal: Aborted
[Current thread is 1 (Thread 0xb259d720 (LWP 6615))]

Thread 2 (Thread 0xa6e8eb70 (LWP 6616)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb6aea0c2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xb6b688ad in QWaitConditionPrivate::wait (this=0x8473818, time=30000) at thread/qwaitcondition_unix.cpp:85
#3  0xb6b686cb in QWaitCondition::wait (this=0x847377c, mutex=0x8473778, time=30000) at thread/qwaitcondition_unix.cpp:159
#4  0xb6b5ac0e in QThreadPoolThread::run (this=0x82877f0) at concurrent/qthreadpool.cpp:140
#5  0xb6b6764f in QThreadPrivate::start (arg=0x82877f0) at thread/qthread_unix.cpp:248
#6  0xb6ae56e5 in start_thread () from /lib/libpthread.so.0
#7  0xb6ae5600 in ?? () from /lib/libpthread.so.0

Thread 1 (Thread 0xb259d720 (LWP 6615)):
[KCrash Handler]
#7  0xffffe424 in __kernel_vsyscall ()
#8  0xb5ced0cf in raise () from /lib/libc.so.6
#9  0xb5cee9e7 in abort () from /lib/libc.so.6
#10 0xb6b5da20 in qt_message_output (msgType=QtFatalMsg, buf=
    0x84106b8 "ASSERT failure in QVector<T>::at: \"index out of range\", file ../../include/QtCore/../../src/corelib/tools/qvector.h, line 338") at global/qglobal.cpp:2248
#11 0xb6b5dac6 in qt_message (msgType=QtFatalMsg, msg=0xb6cd6648 "ASSERT failure in %s: \"%s\", file %s, line %d", ap=0xbfc7e3d4 "\271A\201\266\217A\201\266XA\201\266R\001")
    at global/qglobal.cpp:2294
#12 0xb6b5ddbc in qFatal (msg=0xb6cd6648 "ASSERT failure in %s: \"%s\", file %s, line %d") at global/qglobal.cpp:2477
#13 0xb6b5d681 in qt_assert_x (where=0xb68141b9 "QVector<T>::at", what=0xb681418f "index out of range", file=0xb6814158 "../../include/QtCore/../../src/corelib/tools/qvector.h", line=338)
    at global/qglobal.cpp:2019
#14 0xb60e9011 in QVector<int>::at (this=0x83cb85c, i=11) at ../../include/QtCore/../../src/corelib/tools/qvector.h:338
#15 0xb66a3de7 in QListModeViewBase::verticalOffset (this=0x83cb830) at itemviews/qlistview.cpp:2108
#16 0xb669ec4f in QListView::verticalOffset (this=0x83ac998) at itemviews/qlistview.cpp:1096
#17 0xb668b9a7 in QAbstractItemViewPrivate::contentsOffset (this=0x82f49e0) at ../../include/QtGui/private/../../../src/gui/itemviews/qabstractitemview_p.h:294
#18 0xb611330d in QWidgetPrivate::paintBackground (this=0x83ac9b8, painter=0xbfc7e5e8, rgn=..., flags=0) at kernel/qwidget.cpp:2197
#19 0xb6119d33 in QWidgetPrivate::drawWidget (this=0x83ac9b8, pdev=0x8357434, rgn=..., offset=..., flags=4, sharedPainter=0x0, backingStore=0x83573f8) at kernel/qwidget.cpp:5337
#20 0xb630276c in QWidgetBackingStore::sync (this=0x83573f8) at painting/qbackingstore.cpp:1292
#21 0xb611165f in QWidgetPrivate::syncBackingStore (this=0x83ef068) at kernel/qwidget.cpp:1684
#22 0xb61212c5 in QWidget::event (this=0x83aa538, event=0x83ff5a0) at kernel/qwidget.cpp:8333
#23 0xb60bfb2a in QApplicationPrivate::notify_helper (this=0x808eb40, receiver=0x83aa538, e=0x83ff5a0) at kernel/qapplication.cpp:4302
#24 0xb60bf990 in QApplication::notify (this=0xbfc7f2ac, receiver=0x83aa538, e=0x83ff5a0) at kernel/qapplication.cpp:4267
#25 0xb761b7d0 in KApplication::notify (this=0xbfc7f2ac, receiver=0x83aa538, event=0x83ff5a0) at /home/diau/svn/KDE/kdelibs/kdeui/kernel/kapplication.cpp:302
#26 0xb6c655ba in QCoreApplication::notifyInternal (this=0xbfc7f2ac, receiver=0x83aa538, event=0x83ff5a0) at kernel/qcoreapplication.cpp:704
#27 0xb6c6890f in QCoreApplication::sendEvent (receiver=0x83aa538, event=0x83ff5a0) at kernel/qcoreapplication.h:215
#28 0xb6c665e2 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x80787e0) at kernel/qcoreapplication.cpp:1342
#29 0xb6c6629b in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1238
#30 0xb6c979a0 in QCoreApplication::sendPostedEvents () at kernel/qcoreapplication.h:220
#31 0xb6c963a3 in postEventSourceDispatch (s=0x8090f20) at kernel/qeventdispatcher_glib.cpp:276
#32 0xb42494c2 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#33 0xb424cd98 in ?? () from /usr/lib/libglib-2.0.so.0
#34 0xb424cebe in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#35 0xb6c971dc in QEventDispatcherGlib::processEvents (this=0x808eb20, flags=...) at kernel/qeventdispatcher_glib.cpp:412
#36 0xb6181468 in QGuiEventDispatcherGlib::processEvents (this=0x808eb20, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#37 0xb6c63057 in QEventLoop::processEvents (this=0xbfc7f1ec, flags=...) at kernel/qeventloop.cpp:149
#38 0xb6c6319b in QEventLoop::exec (this=0xbfc7f1ec, flags=...) at kernel/qeventloop.cpp:197
#39 0xb6c65c60 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:981
#40 0xb60bcffe in QApplication::exec () at kernel/qapplication.cpp:3581
#41 0x080513d8 in main (argc=4, argv=0xbfc7f5f4) at /home/diau/svn/KDE/kdebase/workspace/plasma/generic/shells/plasmoidviewer/main.cpp:231
Comment 1 Weng Xuetian 2010-05-06 04:33:52 UTC
Created attachment 43288 [details]
Screenshot

A screenshot in dolphin
Comment 2 Justin Zobel 2020-12-07 05:09:29 UTC
As it has been a while since this was reported, can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved.

I have set the bug status to "needsinfo" pending your response, please change back to "reported" or "resolved/worksforme" when you respond, thank you.
Comment 3 Bug Janitor Service 2020-12-22 04:34:31 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Bug Janitor Service 2021-01-06 04:34:03 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!