wayland/protocol/tests.xml
Derek Foreman c05f4f86ea client: Don't disconnect on receipt of object events destined for zombies
Server side objects give protocol designers exciting ways to break clients.
For example, if a client deletes an object at the same time the server is
sending an event containing a new object to that object, then we currently
silently drop that event. If a following event in the buffer from an
object that has not yet been deleted also contains a new object, the wl_map
constraint that new objects must be 1 higher than the current highest
object count is violated.  This results in a disconnect.

Instead, let's augment the zombie accounting code to keep the entire proxy
around on deletion, for both client and server generated objects.

This way we can create and immediately delete objects that are destined for
zombie proxies - thus creating zombie descendants.

We can go no further to clean this up in the client library - we can't call
a destructor because the protocol might dictate that child objects will be
automatically destroyed on the destruction of the parent.

So we turn a situation that would lead to an erroneous disconnect into one
that may or may not leak object ids depending on protocol definition.

Fixes #74
for some definition of "fix" anyway.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2021-08-26 07:38:28 -05:00

83 lines
2.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<protocol name="build_time_wayland_tests">
<copyright>
Copyright © 2017 Samsung Electronics Co., Ltd
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice (including the
next paragraph) shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
</copyright>
<interface name="fd_passer" version="2">
<description summary="Sends an event with an fd">
A trivial interface for fd passing tests.
</description>
<request name="destroy" type="destructor"/>
<event name="pre_fd"/>
<event name="fd">
<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>
<interface name="noop" version="1">
<description summary="An interface that does nothing">
A trivial interface.
</description>
<request name="destroy" type="destructor"/>
</interface>
<interface name="necromancer" version="1">
<description summary="Helper for creating zombie objects">
Simple interface for generating server side objects to use in
zombie tests.
</description>
<request name="destroy" type="destructor"/>
<request name="create_server_object">
<description summary="create a new server side object">
Create a new server side object.
</description>
</request>
<event name="server_object">
<description summary="server side object">
</description>
<arg name="id" type="new_id" interface="noop" summary="server side object"/>
</event>
</interface>
</protocol>