How to debug the xserver?

Tiago Vignatti tiago.vignatti at linux.intel.com
Fri Aug 31 05:03:30 PDT 2012


Hi,

On 08/30/2012 09:03 AM, Bill Spitzak wrote:
> The xserver crashes immediately on me in realloc. So far all the
> information I can get is a backtrace and event messages (this is just
> after attempting to launch "xev" which caused weston to run Xorg):
>
> I recompiled with --enable-debug but there is hardly any more information:
>
> [22:53:35.626] xfixes version: 4.0
> [22:53:35.682] created wm
> [22:53:35.682] XCB_CREATE_NOTIFY (window 2097152, width 10, height 10,
> ours)
> [22:53:35.682] XCB_PROPERTY_NOTIFY: window 305,
> _NET_SUPPORTING_WM_CHECK: WINDOW/32, length 4 (value_len 1): huh?
> [22:53:35.683] XCB_PROPERTY_NOTIFY: window 305, _NET_SUPPORTED: ATOM/32,
> length 4 (value_len 1): _NET_WM_MOVERESIZE
> [22:53:35.683] XCB_CREATE_NOTIFY (window 2097153, width 10, height 10,
> ours)
> *** glibc detected *** /home/spitzak/install/bin/Xorg: realloc():
> invalid next size: 0x0a30c9f0 ***
> ======= Backtrace: =========
> /lib/i386-linux-gnu/libc.so.6(+0x73e42)[0x5d0e42]
> /lib/i386-linux-gnu/libc.so.6(+0x7698f)[0x5d398f]
> /lib/i386-linux-gnu/libc.so.6(realloc+0xe7)[0x5d5347]
> /home/spitzak/install/bin/Xorg(ListenOnOpenFD+0xf0)[0x81c27c0]
> /home/spitzak/install/lib/xorg/modules/extensions/libxwayland.so(+0x21a3)[0x8411a3]
>
> /usr/lib/i386-linux-gnu/libffi.so.6(ffi_call_SYSV+0x1a)[0xa7135a]
> /usr/lib/i386-linux-gnu/libffi.so.6(ffi_call+0x6f)[0xa7108f]
> /home/spitzak/install/lib/libwayland-client.so.0(+0x4b03)[0xe8bb03]
> /home/spitzak/install/lib/libwayland-client.so.0(wl_display_iterate+0x1a6)[0xe8a0b6]
>
> /home/spitzak/install/lib/xorg/modules/extensions/libxwayland.so(+0x244b)[0x84144b]
>
> /home/spitzak/install/bin/Xorg(WakeupHandler+0x65)[0x807aae5]
> /home/spitzak/install/bin/Xorg(WaitForSomething+0x1a5)[0x81bd775]
> /home/spitzak/install/bin/Xorg[0x8076702]
> /home/spitzak/install/bin/Xorg[0x80643aa]
> /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x5764d3]
> /home/spitzak/install/bin/Xorg[0x80646d9]
> ======= Memory map: ========
> 00110000-0013a000 r-xp 00000000 08:01 4325425
> /lib/i386-linux-gnu/libm-2.15.s...

you need to update your xtrans library:
http://lists.freedesktop.org/archives/wayland-devel/2012-August/005157.html


> Any ideas on how to perhaps get the x server running in a debugger? I
> tried changing the launch line to "gdb --args Xorg ..." but it did not
> work because it appears the tty is disconnected.
>
> Since this is memory corruption it may be that running valgrind might
> find something?

In general we attach Xorg process in gdb (e.g sudo gdb -p `pidof 
/home/tiago/install/bin/Xorg`), but it's a little bit more trickier for 
the case where Xorg is crashing in its start and you'd need two gdb.

So start the first gdb, set a break point on Weston 
weston_xserver_handle_event and run the program; open a X app and gdb 
will stop on that function; you'll have to step line by line until X 
process is forked and once that happens you attach another gdb on that 
process; now you have one gdb on Xorg and another for Weston.

Valgrind is not attachable OTOH and what we can do is start it Weston 
with --trace-children=yes

     Tiago



More information about the wayland-devel mailing list