"Couldn't open mtdev" crashing X

Thomas Bushnell, BSG tb at becket.net
Fri May 27 03:42:37 UTC 2011


So I wrote a small program (fortunately the install system has a compiler
toolchain; no emacs, but at least vi) which does the relevant ioctl from
mtdev on the multitouch device, and it works like a charm.

I was a little concerned that the nonblocking IO on the file descriptor
might cause this ioctl to return EAGAIN or something like that, but afaict,
that's not the case.

I'm not confident of the environment inside the X server code for things
like this. The segfault seems to happen inside mtdev_open--which seems to be
getting called multiple times for different devices, not only the actual
multitouch display. (It gets called for the keyboard, eg)

So anyway, the stack trace is roughly this:

0: X (xorg_backtrace)
1: X (--some address--)
2: (vdso) (__kernel_rt_sigreturn...)
3: /usr/lib/mtdev.so.1 (mtdev_open+0x22)
4: /usr/lib/xorg/modules/input/evdev_drv.so
...

Unless the compiler is inlining mtdev_init, I don't see any code in
mtdev_open that could segfault if it wanted to. It's all local variables,
function calls, and branches.

I don't have binaries with symbols, but let me see if I can figure out
what's going on with gdb attached to X.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-installer/attachments/20110526/cc7aa50c/attachment.html>


More information about the Ubuntu-installer mailing list