After display protocol error communication between wayland protocol and client is broken.

Pekka Paalanen ppaalanen at gmail.com
Thu Jan 31 14:27:31 UTC 2019


On Thu, 31 Jan 2019 18:40:57 +0530
Ikshwaku Chauhan <ikshwaku.ec2004 at gmail.com> wrote:

> Hello Pekka,
> 
> Thanks for your inputs and we are able to find further why we are getting
> the "Protocol Error".
> Please provide you inputs for below query:
> 
> As we are very frequently create and destroy surface, during this at one
> instance "controller_surface_create" function from ivi-controller.c which
> tries to create the wl_resources is not able to create the wl_resources,
> because surface is already destroyed and this function returns without
> creating the resources from below mentioned part of the function
> 
>     layout_surface = lyt->get_surface_from_id(id_surface);
>     if (layout_surface == NULL) {
>         return;
>     }
> So, here ivi-controller is not notifying any error event for this.
> as per the ivi-controller.xml, ivi-controller have one error interface that
> can be set, if any error encountered by ivi-controller interface.
> Is there a way by which we can notify the client about the error?

Hi,

I don't see any error, nor a need for one. Because of the inherent
races you have built into your software architecture, erroring out is
not an option.

You have to create the wl_resource, no matter what. If you don't have a
layout_surface to go with it, then create a wl_resource without it, and
make sure all request handlers can cope with it. I presume the client
will soon hear from somewhere that the window does not exist anymore
(or maybe it destroyed it itself already) and destroys the protocol
object by sending a destroy request, which will then destroy the
wl_resource.

Such wl_resources that point to "nothing" are called "inert" in Wayland
parlance. They must be created, processed and destroyed according to
the protocol flow, even if they are not backed by any implementation.
They are a common workaround for races when the design cannot be
improved, to achieve a reliable system.

> Attaching ivi-controller.c file for reference.

Sorry, I don't have time to look at that.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20190131/2dcbd139/attachment.sig>


More information about the wayland-devel mailing list