On Thu, 31 Jan 2019 18:40:57 +0530 Ikshwaku Chauhan <ikshwaku.ec2...@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
pgp7UAlriD5Nx.pgp
Description: OpenPGP digital signature
_______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel