Bug 259362 - Crash on deleting snow shader
Summary: Crash on deleting snow shader
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-09 20:14 UTC by Daniel Lipowicz
Modified: 2011-01-31 22:06 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
reset mShader (340 bytes, patch)
2010-12-09 21:42 UTC, Thomas Lübking
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Lipowicz 2010-12-09 20:14:44 UTC
Application: kwin (4.5.80 (4.6 Beta1))
KDE Platform Version: 4.5.85 (4.6 Beta2) (Compiled from sources)
Qt Version: 4.7.1
Operating System: Linux 2.6.37-8-generic i686
Distribution: Ubuntu natty (development branch)

-- Information about the crash:
- What I was doing when the application crashed:

- Unusual behavior I noticed:

- Custom settings of the application:

Kwin crashed while running the Snow effect KDE.
..............................................

-- Backtrace:
Application: KWin (kwin), signal: Aborted
[Current thread is 1 (Thread 0xb780b940 (LWP 1495))]

Thread 3 (Thread 0xae196b70 (LWP 1641)):
#0  0x00413416 in __kernel_vsyscall ()
#1  0x00743391 in select () at ../sysdeps/unix/syscall-template.S:82
#2  0x03c918bb in qt_safe_select (nfds=17, fdread=0x8a37b68, fdwrite=0x8a37d7c, fdexcept=0x8a37f90, orig_timeout=0x0) at kernel/qcore_unix.cpp:82
#3  0x03c95c09 in QEventDispatcherUNIX::select (this=0x8af0518, nfds=17, readfds=0x8a37b68, writefds=0x8a37d7c, exceptfds=0x8a37f90, timeout=0x0) at kernel/qeventdispatcher_unix.cpp:631
#4  0x03c96b8b in QEventDispatcherUNIXPrivate::doSelect (this=0x8a37a70, flags=..., timeout=0x0) at kernel/qeventdispatcher_unix.cpp:219
#5  0x03c97836 in QEventDispatcherUNIX::processEvents (this=0x8af0518, flags=...) at kernel/qeventdispatcher_unix.cpp:918
#6  0x03c667d9 in QEventLoop::processEvents (this=0xae196280, flags=...) at kernel/qeventloop.cpp:149
#7  0x03c66a72 in QEventLoop::exec (this=0xae196280, flags=...) at kernel/qeventloop.cpp:201
#8  0x03b70be8 in QThread::exec (this=0x8ac8e60) at thread/qthread.cpp:490
#9  0x03c4871b in QInotifyFileSystemWatcherEngine::run (this=0x8ac8e60) at io/qfilesystemwatcher_inotify.cpp:248
#10 0x03b73669 in QThreadPrivate::start (arg=0x8ac8e60) at thread/qthread_unix.cpp:285
#11 0x00658cc9 in start_thread (arg=0xae196b70) at pthread_create.c:304
#12 0x0074a6be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 2 (Thread 0xad995b70 (LWP 1642)):
#0  0x00413416 in __kernel_vsyscall ()
#1  0x0065d4dc in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:169
#2  0x00757dbd in __pthread_cond_wait (cond=0x12672b0, mutex=0x1267298) at forward.c:139
#3  0x0114e4b7 in QTWTF::TCMalloc_PageHeap::scavengerThread (this=0x12621c0) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#4  0x0114e4f1 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=0x12621c0) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#5  0x00658cc9 in start_thread (arg=0xad995b70) at pthread_create.c:304
#6  0x0074a6be in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 1 (Thread 0xb780b940 (LWP 1495)):
[KCrash Handler]
#7  0x00413416 in __kernel_vsyscall ()
#8  0x006a4941 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#9  0x006a7e42 in abort () at abort.c:92
#10 0x006dc305 in __libc_message (do_abort=2, fmt=0x7b42a0 "*** glibc detected *** %s: %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:189
#11 0x006e6501 in malloc_printerr (action=<value optimized out>, str=0x6 <Address 0x6 out of bounds>, ptr=0x8f689c8) at malloc.c:6283
#12 0x006eaec6 in __libc_free (mem=0x6) at malloc.c:3699
#13 0x00612451 in operator delete(void*) () from /usr/lib/libstdc++.so.6
#14 0x050d73f6 in KWin::SnowEffect::toggle (this=0x8ec1750) at ../../../kwin/effects/snow/snow.cpp:278
#15 0x05059971 in KWin::SnowEffect::qt_metacall (this=0x8ec1750, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0xbf9336a8) at moc_snow.cpp:74
#16 0x03c6dc0a in QMetaObject::metacall (object=0x8ec1750, cl=QMetaObject::InvokeMetaMethod, idx=4, argv=0xbf9336a8) at kernel/qmetaobject.cpp:237
#17 0x03c7d9ff in QMetaObject::activate (sender=0x8e29738, m=0x4a47390, local_signal_index=1, argv=0xbf9336a8) at kernel/qobject.cpp:3280
#18 0x041006a9 in QAction::triggered (this=0x8e29738, _t1=false) at .moc/release-shared/moc_qaction.cpp:263
#19 0x04100908 in QAction::activate (this=0x8e29738, event=QAction::Trigger) at kernel/qaction.cpp:1257
#20 0x00a0507d in trigger (this=0x86ff8d0, componentUnique=..., actionUnique=..., timestamp=2057821) at /usr/include/qt4/QtGui/qaction.h:218
#21 KGlobalAccelPrivate::_k_invokeAction (this=0x86ff8d0, componentUnique=..., actionUnique=..., timestamp=2057821) at ../../kdeui/shortcuts/kglobalaccel.cpp:449
#22 0x00a07bc5 in KGlobalAccel::qt_metacall (this=0x8711d80, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0xbf933890) at ./kglobalaccel.moc:77
#23 0x03c6dc0a in QMetaObject::metacall (object=0x8711d80, cl=QMetaObject::InvokeMetaMethod, idx=4, argv=0xbf933890) at kernel/qmetaobject.cpp:237
#24 0x03c7d9ff in QMetaObject::activate (sender=0x86ff4e8, m=0xb765c4, local_signal_index=0, argv=0xbf933890) at kernel/qobject.cpp:3280
#25 0x00b220bb in OrgKdeKglobalaccelComponentInterface::globalShortcutPressed (this=0x86ff4e8, _t1=..., _t2=..., _t3=2057821) at kglobalaccel_component_interface.moc:150
#26 0x00b226d7 in OrgKdeKglobalaccelComponentInterface::qt_metacall (this=0x86ff4e8, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0xbf933a9c) at kglobalaccel_component_interface.moc:98
#27 0x003901ed in QDBusConnectionPrivate::deliverCall (this=0x8577150, object=0x86ff4e8, msg=..., metaTypes=..., slotIdx=5) at qdbusintegrator.cpp:919
#28 0x0039b437 in QDBusCallDeliveryEvent::placeMetaCall (this=0x904ba60, object=0x86ff4e8) at qdbusintegrator_p.h:103
#29 0x03c7c8b7 in QObject::event (this=0x86ff4e8, e=0x904ba60) at kernel/qobject.cpp:1219
#30 0x04107814 in QApplicationPrivate::notify_helper (this=0x857e230, receiver=0x86ff4e8, e=0x904ba60) at kernel/qapplication.cpp:4445
#31 0x0410c31e in QApplication::notify (this=0xbf9342c4, receiver=0x86ff4e8, e=0x904ba60) at kernel/qapplication.cpp:3845
#32 0x009b690a in KApplication::notify (this=0xbf9342c4, receiver=0x86ff4e8, event=0x904ba60) at ../../kdeui/kernel/kapplication.cpp:311
#33 0x00efaf9f in KWin::Application::notify (this=0xbf9342c4, o=0x86ff4e8, e=0x904ba60) at ../../kwin/main.cpp:376
#34 0x03c6760b in QCoreApplication::notifyInternal (this=0xbf9342c4, receiver=0x86ff4e8, event=0x904ba60) at kernel/qcoreapplication.cpp:732
#35 0x03c6b1c9 in sendEvent (receiver=0x0, event_type=0, data=0x855ee10) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#36 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x855ee10) at kernel/qcoreapplication.cpp:1373
#37 0x03c6b35d in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1266
#38 0x041ba869 in sendPostedEvents (this=0x857df30, flags=...) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#39 QEventDispatcherX11::processEvents (this=0x857df30, flags=...) at kernel/qeventdispatcher_x11.cpp:75
#40 0x03c667d9 in QEventLoop::processEvents (this=0xbf934204, flags=...) at kernel/qeventloop.cpp:149
#41 0x03c66a72 in QEventLoop::exec (this=0xbf934204, flags=...) at kernel/qeventloop.cpp:201
#42 0x03c6b41c in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1009
#43 0x041056b7 in QApplication::exec () at kernel/qapplication.cpp:3719
#44 0x00efda92 in kdemain (argc=3, argv=0xbf934544) at ../../kwin/main.cpp:542
#45 0x080485bb in main (argc=3, argv=0xbf934544) at kwin_dummy.cpp:3

Possible duplicates by query: bug 257702, bug 257697, bug 257248, bug 257160, bug 255771.

Reported using DrKonqi
Comment 1 Thomas Lübking 2010-12-09 21:42:36 UTC
Created attachment 54371 [details]
reset mShader

could be memory corruption, but could be confusion about the mActive state, so i guess that accomplishing "delete mShader;" by "mShader = NULL;" won't harm =)
-> ok to commit?

@Daniel
can you somehow reproduce the issue?
Comment 2 Martin Flöser 2010-12-09 22:07:09 UTC
> could be memory corruption, but could be confusion about the mActive state,
> so i guess that accomplishing "delete mShader;" by "mShader = NULL;" won't
> harm =) -> ok to commit?
seems safe to go in, though I doubt that this was causing it.

Anyway I just looked at the code and realized I have to rewrite it for ES :-(
Comment 3 Thomas Lübking 2010-12-09 22:13:57 UTC
SVN commit 1204966 by luebking:

reset mShader after deletion

CCBUG: 259362


 M  +1 -0      snow.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1204966
Comment 4 Thomas Lübking 2010-12-09 22:18:07 UTC
no, could be pretty much everything (the nasty thing about memory corruptions) - just looked suspicous.
Comment 5 Daniel Lipowicz 2010-12-10 07:52:15 UTC
Yes, the problem is when you want to run snow effect

W dniu 09.12.2010 21:42, Thomas Lübking  pisze:
> can you somehow reproduce the issue?
>
Comment 6 Thomas Lübking 2010-12-10 16:29:00 UTC
Everytime?(??)

Since the particular code should actually not be called on activating the snow effect there might be some sort of double trigger (hanging key or whatever) within two frames (so that once the shader got deleted & invalidated, there's been no occasion to recreate it in paintScreen() after the toggle/on and before the successive toggle/off)

@Daniel:
can you compile in the patch and see whether the issue is gone?
Comment 7 Martin Flöser 2011-01-31 22:06:20 UTC
Git commit 3e8c9a65e2b165cd153ac15ccb59e30880de9258 by Martin Gr����lin.
Pushed by graesslin into branch 'graesslin/kwin-cleanup'.

Removing Snow Effect.

The usefulness of the snow effect is doubtable and it is rather
difficult to port the effect to the new rendering architecture
introduced with GLES. It is probably easier to rewrite the complete
effect from scratch, therefore it is removed for now.

I might consider readding it for 4.7.

This kind of "fixes" snow related bug reports.
BUG: 259362
BUG: 254498
FIXED-IN: 4.7.0

M  +0    -3    kwin/effects/CMakeLists.txt     
M  +0    -6    kwin/effects/configs_builtins.cpp     
D  +0    -33   kwin/effects/snow/CMakeLists.txt     
D  +0    -33   kwin/effects/snow/data/snow.frag     
D  +0    -47   kwin/effects/snow/data/snow.vert     
D  +0    -450  kwin/effects/snow/snow.cpp     
D  +0    -171  kwin/effects/snow/snow.desktop     
D  +0    -107  kwin/effects/snow/snow.h     
D  +0    -138  kwin/effects/snow/snow_config.cpp     
D  +0    -86   kwin/effects/snow/snow_config.desktop     
D  +0    -59   kwin/effects/snow/snow_config.h     
D  +0    -200  kwin/effects/snow/snow_config.ui     

http://commits.kde.org/a5d5b61a/3e8c9a65e2b165cd153ac15ccb59e30880de9258