#737915 xnest: segv on mouse entering second nest screen

Package:
xnest
Source:
xorg-server
Description:
Nested X server
Submitter:
Kevin Ryde
Date:
2015-07-25 21:48:08 UTC
Severity:
normal
#737915#5
Date:
2014-02-06 22:46:32 UTC
From:
To:
If Xnest is run with two screens then when the mouse pointer is moved
into the second screen it dies with a segfault.  Eg.

    Xnest -scrns 2 :1
    move mouse into second screen
    =>
    segv

If the mouse is already in the second screen window then move out and
then back in to provoke the problem.

    (EE) Backtrace:
    (EE) 0: Xnest (xorg_backtrace+0x49) [0xb7721389]
    (EE) 1: Xnest (0xb7613000+0x112114) [0xb7725114]
    (EE) 2: linux-gate.so.1 (__kernel_rt_sigreturn+0x0) [0xb75f140c]
    (EE) 3: Xnest (0xb7613000+0x1c934) [0xb762f934]
    (EE) 4: Xnest (miPointerUpdateSprite+0x178) [0xb763e908]
    (EE) 5: Xnest (0xb7613000+0x2bc8e) [0xb763ec8e]
    (EE) 6: Xnest (0xb7613000+0x2470b) [0xb763770b]
    (EE) 7: Xnest (0xb7613000+0xe2955) [0xb76f5955]
    (EE) 8: Xnest (miPointerWarpCursor+0xee) [0xb763e6fe]
    (EE) 9: Xnest (0xb7613000+0x2bb72) [0xb763eb72]
    (EE) 10: Xnest (0xb7613000+0xe10a6) [0xb76f40a6]
    (EE) 11: Xnest (0xb7613000+0xe13ca) [0xb76f43ca]
    (EE) 12: Xnest (0xb7613000+0x1d41a) [0xb763041a]
    (EE) 13: Xnest (0xb7613000+0x1faf4) [0xb7632af4]
    (EE) 14: Xnest (WakeupHandler+0x6a) [0xb76efe0a]
    (EE) 15: Xnest (WaitForSomething+0x18b) [0xb771e75b]
    (EE) 16: Xnest (0xb7613000+0xd866e) [0xb76eb66e]
    (EE) 17: Xnest (0xb7613000+0x1a53a) [0xb762d53a]
    (EE) 18: /lib/i386-linux-gnu/i686/cmov/libc.so.6 (__libc_start_main+0xf5) [0xb70d68c5]
    (EE) 19: Xnest (0xb7613000+0x1a918) [0xb762d918]
    (EE)
    (EE) Segmentation fault at address 0x0

#737915#12
Date:
2015-07-25 21:45:33 UTC
From:
To:
Hi,

it seems that running Xnest with the -nocursor option is a workaround. I
didn't test it extensively, but I was able to open two screens with
xterms and copy from one to the other screen.

I was not able to debug it on Debian, because there I didn't have debug
information available, but on my Gentoo installation I could reproduce
it and have a closer look. There it  was xnest from
xorg-xserver-1.6.4-r2, the bug report is for 1.14.5, but the bug also
persists on Debian with xnest 1.17.2-1 and the workaround was tested
with this version.

The sigsegv happens in

hw/xnest/Cursor.c:142

137	void
138	xnestSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
        CursorPtr pCursor, int x,
139	               int y)
140	{
141	    if (pCursor) {
142	        XDefineCursor(xnestDisplay,
143	                      xnestDefaultWindows[pScreen->myNum],
144	                      xnestCursor(pCursor, pScreen));
145	    }
146	}

I guess the problem is with xnestCursor which is a macro that calls a
macro and does wired things.

With the -nocurser option Xnest still crashes when terminating the
program - but somewhere else.

Best,
Gert