use of tet_fork (easy part)

Jamey Sharp jamey at minilop.net
Tue Dec 20 21:24:54 EET 2005


This is regarding this bug report:
	https://bugs.freedesktop.org/show_bug.cgi?id=4387

It so happens that in the reference implementation of Xlib, very little
sanity checking is done on the sequence number stream. As a result, the
test suite can get away with creating a new Display, forking, and using
that Display in both the parent and the child, under limited
circumstances.

On Xlib/XCB, the test suite dies with an assertion failure when it tries
to do this. Fortunately, it only does it in three tests. I'll address
the two easy ones in this mail: XGrabServer and XUngrabServer, in
Xlib10.

They both call opendisplay(), from xts5/src/lib/opendisp.c, to get a
display that looks like it's used only in the child after the fork. But
since opendisplay uses regid, after the test is over the parent calls
XCloseDisplay, and at that point the test dies with an assertion
failure.

My patch calls XOpenDisplay directly instead of opendisplay, which means
the tests leak a connection -- but they're about to exit anyway, so it
had no effect on later test results. To fix the leak, perhaps in these
cases the child process can explicitly call XCloseDisplay after
cleartimeout? Or perhaps the parent and child can be swapped?

--Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.x.org/archives/xorg-test/attachments/20051220/52ffccfd/attachment.pgp 


More information about the xorg-test mailing list