Bug 273353 - Wacom Tablet kded module crashed
Summary: Wacom Tablet kded module crashed
Status: RESOLVED FIXED
Alias: None
Product: wacomtablet
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Jörg Ehrichs
URL:
Keywords:
: 274346 274608 274935 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-05-15 17:08 UTC by Oldřich Jedlička
Modified: 2011-06-06 15:14 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oldřich Jedlička 2011-05-15 17:08:31 UTC
Application: kded4 ($Id$)
KDE Platform Version: 4.6.3 (4.6.3) (Compiled from sources)
Qt Version: 4.7.3
Operating System: Linux 2.6.39-drm+ i686
Distribution (Platform): Gentoo Packages

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

I've just started the system, wacomtablet was automatically started.

-- Backtrace:
Application: KDE démon (kdeinit4), signal: Segmentation fault
[Current thread is 1 (Thread 0xb57fb710 (LWP 8126))]

Thread 4 (Thread 0xab130b70 (LWP 8131)):
#0  0xb7756424 in __kernel_vsyscall ()
#1  0xb5f50e46 in __poll (fds=0xb5fe4ff4, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#2  0xb59d444c in g_poll (fds=0x8e8d268, nfds=1, timeout=-1) at gpoll.c:132
#3  0xb59c8292 in g_main_context_poll (context=0x8ea3608, block=<value optimized out>, dispatch=1, self=0xaa800468) at gmain.c:3404
#4  g_main_context_iterate (context=0x8ea3608, block=<value optimized out>, dispatch=1, self=0xaa800468) at gmain.c:3086
#5  0xb59c8585 in g_main_context_iteration (context=0x8ea3608, may_block=1) at gmain.c:3154
#6  0xb6db0cf4 in QEventDispatcherGlib::processEvents (this=0x8e88cc0, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#7  0xb6d7f4fa in QEventLoop::processEvents (this=0xab1302c0, flags=) at kernel/qeventloop.cpp:149
#8  0xb6d7f8f4 in QEventLoop::exec (this=0xab1302c0, flags=...) at kernel/qeventloop.cpp:201
#9  0xb6c75262 in QThread::exec (this=0x8e8d4d8) at thread/qthread.cpp:492
#10 0xab21cc18 in AgentListener::run (this=0x8e8d4d8) at /mnt/data/tmp/portage/net-wireless/bluedevil-1.1-r1/work/bluedevil-1.1/src/daemon/kded/agentlistener.cpp:40
#11 0xb6c7804b in QThreadPrivate::start (arg=0x8e8d4d8) at thread/qthread_unix.cpp:320
#12 0xb6bface2 in start_thread (arg=0xab130b70) at pthread_create.c:301
#13 0xb5f5b67e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:133

Thread 3 (Thread 0xaa7ffb70 (LWP 8136)):
#0  0xb5a96276 in clock_gettime (clock_id=1, tp=0xaa7feff0) at ../sysdeps/unix/clock_gettime.c:100
#1  0xb6cd5f24 in do_gettime () at tools/qelapsedtimer_unix.cpp:123
#2  qt_gettime () at tools/qelapsedtimer_unix.cpp:140
#3  0xb6db293d in QTimerInfoList::updateCurrentTime (this=0x8eaeecc) at kernel/qeventdispatcher_unix.cpp:339
#4  0xb6db2c16 in QTimerInfoList::timerWait (this=0x8eaeecc, tm=...) at kernel/qeventdispatcher_unix.cpp:442
#5  0xb6db0eb0 in timerSourcePrepareHelper (src=<value optimized out>, timeout=0xaa7ff10c) at kernel/qeventdispatcher_glib.cpp:136
#6  0xb6db0f40 in timerSourcePrepare (source=0x0, timeout=0xb5a99ff4) at kernel/qeventdispatcher_glib.cpp:169
#7  0xb59c7be8 in g_main_context_prepare (context=0x8ebeb38, priority=0xaa7ff17c) at gmain.c:2761
#8  0xb59c7fec in g_main_context_iterate (context=0x8ebeb38, block=<value optimized out>, dispatch=1, self=0x8eaf250) at gmain.c:3071
#9  0xb59c8585 in g_main_context_iteration (context=0x8ebeb38, may_block=1) at gmain.c:3154
#10 0xb6db0cf4 in QEventDispatcherGlib::processEvents (this=0x8ebeab8, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#11 0xb6d7f4fa in QEventLoop::processEvents (this=0xaa7ff2a0, flags=) at kernel/qeventloop.cpp:149
#12 0xb6d7f8f4 in QEventLoop::exec (this=0xaa7ff2a0, flags=...) at kernel/qeventloop.cpp:201
#13 0xb6c75262 in QThread::exec (this=0x8eaf198) at thread/qthread.cpp:492
#14 0xb6d5bc5e in QInotifyFileSystemWatcherEngine::run (this=0x8eaf198) at io/qfilesystemwatcher_inotify.cpp:248
#15 0xb6c7804b in QThreadPrivate::start (arg=0x8eaf198) at thread/qthread_unix.cpp:320
#16 0xb6bface2 in start_thread (arg=0xaa7ffb70) at pthread_create.c:301
#17 0xb5f5b67e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:133

Thread 2 (Thread 0xa962fb70 (LWP 8148)):
#0  0xb7756424 in __kernel_vsyscall ()
#1  0xb5f50e46 in __poll (fds=0xb5fe4ff4, nfds=3, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#2  0xb59d444c in g_poll (fds=0x8e2ad38, nfds=3, timeout=-1) at gpoll.c:132
#3  0xb59c8292 in g_main_context_poll (context=0x8f2cf38, block=<value optimized out>, dispatch=1, self=0x8f2cfd8) at gmain.c:3404
#4  g_main_context_iterate (context=0x8f2cf38, block=<value optimized out>, dispatch=1, self=0x8f2cfd8) at gmain.c:3086
#5  0xb59c8853 in g_main_loop_run (loop=0x8e2ad28) at gmain.c:3299
#6  0xa96dc168 in gdbus_shared_thread_func (data=0x0) at gdbusprivate.c:276
#7  0xb59ec25e in g_thread_create_proxy (data=0x8f2cfd8) at gthread.c:1897
#8  0xb6bface2 in start_thread (arg=0xa962fb70) at pthread_create.c:301
#9  0xb5f5b67e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:133

Thread 1 (Thread 0xb57fb710 (LWP 8126)):
[KCrash Handler]
#7  Wacom::XDeviceEventNotifier::x11Event (this=0x8e94a78, event=0xbff0a340) at /mnt/data/tmp/portage/kde-misc/wacomtablet-1.3.1/work/wacomtablet-v1.3.1/src/kded/xdeviceeventnotifier.cpp:69
#8  0xb74e06af in publicx11Event (this=0xbff0a690, _event=0xbff0a340) at /mnt/data/tmp/portage/kde-base/kdelibs-4.6.3-r1/work/kdelibs-4.6.3/kdeui/kernel/kapplication.cpp:918
#9  KApplication::x11EventFilter (this=0xbff0a690, _event=0xbff0a340) at /mnt/data/tmp/portage/kde-base/kdelibs-4.6.3-r1/work/kdelibs-4.6.3/kdeui/kernel/kapplication.cpp:969
#10 0xb629a8b7 in qt_x11EventFilter (ev=0xbff0a340) at kernel/qapplication_x11.cpp:435
#11 0xb62abbbf in QApplication::x11ProcessEvent (this=0xbff0a690, event=0xbff0a340) at kernel/qapplication_x11.cpp:3299
#12 0xb62da224 in x11EventSourceDispatch (s=0x8d89d00, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#13 0xb59c443d in g_main_dispatch (context=0x8d89268) at gmain.c:2440
#14 g_main_context_dispatch (context=0x8d89268) at gmain.c:3013
#15 0xb59c83cb in g_main_context_iterate (context=0x8d89268, block=<value optimized out>, dispatch=1, self=0x8cdb280) at gmain.c:3091
#16 0xb59c8585 in g_main_context_iteration (context=0x8d89268, may_block=1) at gmain.c:3154
#17 0xb6db0cbc in QEventDispatcherGlib::processEvents (this=0x8d57648, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#18 0xb62d9b41 in QGuiEventDispatcherGlib::processEvents (this=0x8d57648, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#19 0xb6d7f4fa in QEventLoop::processEvents (this=0xbff0a5f4, flags=) at kernel/qeventloop.cpp:149
#20 0xb6d7f8f4 in QEventLoop::exec (this=0xbff0a5f4, flags=...) at kernel/qeventloop.cpp:201
#21 0xb6d82238 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1008
#22 0xb6212a7f in QApplication::exec () at kernel/qapplication.cpp:3736
#23 0xb533f0cc in kdemain (argc=1, argv=0x8d28888) at /mnt/data/tmp/portage/kde-base/kdelibs-4.6.3-r1/work/kdelibs-4.6.3/kded/kded.cpp:925
#24 0x0804ecb9 in launch (argc=<value optimized out>, _name=<value optimized out>, args=<value optimized out>, cwd=0x0, envc=0, envs=0x0, reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x8051fd7 "0") at /mnt/data/tmp/portage/kde-base/kdelibs-4.6.3-r1/work/kdelibs-4.6.3/kinit/kinit.cpp:734
#25 0x08050c0c in main (argc=2, argv=0xbff0ac04, envp=0xbff0ac10) at /mnt/data/tmp/portage/kde-base/kdelibs-4.6.3-r1/work/kdelibs-4.6.3/kinit/kinit.cpp:1849

Reported using DrKonqi
Comment 1 Oldřich Jedlička 2011-05-15 17:11:15 UTC
This belongs to wacomtablet application, version 1.3.1, but DrKonqi didn't offer me to change it even I know it is there. There is problem in handling XGenericEventCookie - accessing cookie->data without first calling XGetEventData. So the cookie->data is null and there is a segmentation fault as a result.
Comment 2 Jörg Ehrichs 2011-05-20 09:42:47 UTC
This happens when I change things in a hurry.
Still wonder why this didn't chrash my Kubuntu system though.

I have to find the reason why my tablet wasn't recognized since I changed to Kubuntu Natty than.

Short Question, does the 1.3.0 work for you? The only Change inbetween them is the line that cause the seg fault.
Comment 3 Oldřich Jedlička 2011-05-20 22:02:51 UTC
(In reply to comment #2)
> Short Question, does the 1.3.0 work for you? The only Change inbetween them is
> the line that cause the seg fault.

Short answer - yes.

From the documentation (man page of XGetEventData) the cookie->data is null until you call XGetEventData. The data have to be freed with a call to XFreeEventData. The code in 1.3.1 doesn't call XGetEventData, but it calls XFreeEventData - this looks wrong.

The question might be why the data pointer is usable when you access it on Kubuntu Natty without calling XGetEventData first (maybe somebody called it before you). I'm just guessing, I have actually no experience in this area.
Comment 4 Jörg Ehrichs 2011-05-29 10:35:26 UTC
Somehow the coockie data is retrieved somewhere else before my routine runs. Thats why XGetEventData retrusn false and does not detect a tablet anymore on my system and my "fix" didn't crash the system.

Nonetheless, I call XGetEventData again and now check if the data pointer is valid. This should again work for all systems.

Could you please get the latest version from git and check this.
Don't want to release another crashy release into the wild
Comment 5 Jörg Ehrichs 2011-05-30 13:33:27 UTC
*** Bug 274346 has been marked as a duplicate of this bug. ***
Comment 6 Jörg Ehrichs 2011-06-01 08:51:05 UTC
*** Bug 274608 has been marked as a duplicate of this bug. ***
Comment 7 Oldřich Jedlička 2011-06-01 09:13:04 UTC
I will test it during this week, thanks.

I've reviewed the patch and I think you should actually call XFreeEventData only in case the XGetEventData returned TRUE.
Comment 8 Oldřich Jedlička 2011-06-03 06:58:35 UTC
I've tested the current git master and it works for me. It looks fine now, thanks :-)
Comment 9 Christoph Feck 2011-06-06 14:47:15 UTC
*** Bug 274935 has been marked as a duplicate of this bug. ***