Making progress. Added a DebugLevel option with a value of 10 to the
wacom sections in xorg.conf. Also found out that the package xserver-
xorg-core-dbg containing the required Xorg debug symbols does exist, it
just isn't printed by dpkg -l. With those tools in place, the situation
looks like this:

First, the devices are activated via InitInput:
#0  xf86WcmDevOpen (pWcm=0x911c700) at ../../../src/xdrv/xf86Wacom.c:783
#1  0xb6bbdc2f in xf86WcmDevProc (pWcm=0x911c700, what=0) at 
../../../src/xdrv/xf86Wacom.c:1034
#2  0x0808662f in ActivateDevice (dev=0x911c700) at ../../dix/devices.c:447
#3  0x080d8c7e in xf86NewInputDevice (idev=0x8f53450, pdev=0xbfd9dddc, enable=1 
'\001')
    at ../../../../hw/xfree86/common/xf86Xinput.c:544
#4  0x080ae3c6 in InitInput (argc=2, argv=0xbfd9dec4) at 
../../../../hw/xfree86/common/xf86Init.c:1328
#5  0x0807229a in main (argc=2, argv=0xbfd9dec4, envp=Cannot access memory at 
address 0x6c
) at ../../dix/main.c:369

As the device isn't plugged in, initialization fails, which is to be
expected.

Next, the device is uninitialized, still from within InitInput:
#0  xf86WcmUninit (drv=0x8f59cd8, local=0x911c658, flags=0) at 
../../../src/xdrv/wcmConfig.c:367
#1  0x080d8bf7 in xf86NewInputDevice (idev=0x8f53450, pdev=0xbfd9dddc, enable=1 
'\001')
    at ../../../../hw/xfree86/common/xf86Xinput.c:562
#2  0x080ae3c6 in InitInput (argc=2, argv=0xbfd9dec4) at 
../../../../hw/xfree86/common/xf86Init.c:1328
#3  0x0807229a in main (argc=2, argv=0xbfd9dec4, envp=Cannot access memory at 
address 0x20

As part of the uninit, priv gets freed:
xf86WcmUninit (drv=0x993acd8, local=0x9afd658, flags=0) at 
../../../src/xdrv/wcmConfig.c:383
383             xfree(priv);

Later on, the device gets initialized again, this time via InitAndStartDevices:
#0  0xb6b8daa0 in xf86WcmDevProc (pWcm=0x9afd700, what=0) at 
../../../src/xdrv/xf86Wacom.c:1014
#1  0x0808662f in ActivateDevice (dev=0x9afd700) at ../../dix/devices.c:447
#2  0x08086732 in InitAndStartDevices () at ../../dix/devices.c:637
#3  0x0807229f in main (argc=2, argv=0xbfb6bc94, envp=0x0) at 
../../dix/main.c:370

The problem is the xfree(priv) in xf86WcmUninit. It is guarded by a
#ifndef WCM_XORG_XSERVER_1_6 preprocessor switch, and the comment seems
to indicate the issue we experience, but somehow this preprocessor magic
fails.

>From what I can tell, configure correctly detects the version and sets
its shell variable WCM_XORG_XSERVER_1_6 accordingly. Looking at the
build log for this line should verify this:

checking if Xorg is version 1.6 or later... yes

It seems that the shell variable from make doesn't get turned into a
preprocessor switch. Adding that flag to CFLAGS in debian/rules is easy,
though rather hackish. Doesn't completely solve the issue, though, only
makes me progress a bit farther. Up to the next call to xf86WcmDevOpen,
to be precise. At that point, priv has changed, and its common pointer
is NULL.

Adding a watchpoint for the memory address of the private pointer, I
find it gets set to zero in a xalloc call in xf86WcmInit, for the second
round of initialization from InitAndStartDevices. So it seems the local
data was freed, but still got reused.

Now the basic question is this: is it correct that the X server tries to 
initialize the wacom devices twice?
If yes, then either the private data shouldn't be freed, or new private data 
allocated. If not, then that should be avoided.

-- 
Xorg crashed with SIGSEGV in ActivateDevice() - wacom tablet
https://bugs.launchpad.net/bugs/336401
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to