diff options
| author | Derek Foreman <derekf@osg.samsung.com> | 2017-12-06 11:22:25 -0600 |
|---|---|---|
| committer | Daniel Stone <daniels@collabora.com> | 2018-01-09 15:20:00 +0000 |
| commit | ff992951a7e6da0a8e54786ef7371ae420ce6c9c (patch) | |
| tree | 98b722598f05dd541a6fbf1a9f2b7c154664e943 /protocol | |
| parent | tests: Add a test for fd leaks on zombie objects (diff) | |
| download | wayland-ff992951a7e6da0a8e54786ef7371ae420ce6c9c.tar wayland-ff992951a7e6da0a8e54786ef7371ae420ce6c9c.tar.gz wayland-ff992951a7e6da0a8e54786ef7371ae420ce6c9c.tar.bz2 wayland-ff992951a7e6da0a8e54786ef7371ae420ce6c9c.tar.lz wayland-ff992951a7e6da0a8e54786ef7371ae420ce6c9c.tar.xz wayland-ff992951a7e6da0a8e54786ef7371ae420ce6c9c.tar.zst wayland-ff992951a7e6da0a8e54786ef7371ae420ce6c9c.zip | |
tests: Check for wrong fd delivery with zombie objects
Until recently, if an event attempting to deliver an fd to a zombie
object was demarshalled after the object was made into a zombie, we
leaked the fd and left it in the buffer.
If another event attempting to deliver an fd to a live object was in that
same buffer, the zombie's fd would be delivered instead.
This test recreates that situation.
While this is a ridiculously contrived way to force this race - delivering
an event from a destruction handler - I do have reports of this race
being hit in real world code.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'protocol')
| -rw-r--r-- | protocol/tests.xml | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/protocol/tests.xml b/protocol/tests.xml index 77f6e24..ea56ae4 100644 --- a/protocol/tests.xml +++ b/protocol/tests.xml @@ -26,7 +26,7 @@ SOFTWARE. </copyright> - <interface name="fd_passer" version="1"> + <interface name="fd_passer" version="2"> <description summary="Sends an event with an fd"> A trivial interface for fd passing tests. </description> @@ -39,5 +39,14 @@ <description summary="passes a file descriptor"/> <arg name="fd" type="fd" summary="file descriptor"/> </event> + + <!-- Version 2 additions --> + <request name="conjoin" since="2"> + <description summary="register another fd passer with this one"> + Tells this fd passer object about another one to send events + to for more complicated fd leak tests. + </description> + <arg name="passer" type="object" interface="fd_passer"/> + </request> </interface> </protocol> |
