<div dir="ltr"><div><div><div>Hi,<br><br></div>so I changed my patches so that they can handle the new_id use-case. I've been testing them now for some time and it looks working.<br>Unfortunately, the change needed to dig more into wayland, so it is more bug-prone. This is still just an alternative to your patches.<br>A benefit I see in my patches is that if we'll ever need make some another similar changes, this series prepares a ground for it.<br></div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 27, 2015 at 3:54 PM, Marek Chalupa <span dir="ltr"><<a href="mailto:mchqwerty@gmail.com" target="_blank">mchqwerty@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Mar 24, 2015 at 5:47 AM, Hardening <span dir="ltr"><<a href="mailto:rdp.effort@gmail.com" target="_blank">rdp.effort@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>Le 19/03/2015 09:11, Marek Chalupa a écrit :<br>
</span><span>> When server looses some capability (like pointer or keyboard),<br>
> it takes some time to get this information to clients.<br>
> When client sends request with new_id argument to the object<br>
> that has been just destroyed on server-side (client<br>
> does not know about it yet), we still have to create the resource.<br>
> If we wouldn't do it then the client will get invalid id error once it<br>
> tries to use the new object. But if we create it, then we have to<br>
> take care that all the requests but destructor are ignored,<br>
> because we do not have the server-side object anymore.<br>
> (eventually, client will destroy the resource, because<br>
> it will get the information about server-side object destruction)<br>
><br>
> This patch solves this ugly race by adding wl_resource_set_intact()<br>
> function that marks the resource as intact. When resource is intact<br>
> it ignores all requests and events but destructors. The trick is in<br>
> adding flag into the request's siganture that says: "hey! I'm<br>
> destructor". Server then can skip non-destructor actions on intact<br>
> resource.<br>
><br>
<br>
</span><span>Hello Marek,<br>
nice to have some feedback on this subject. I like your implementation<br>
(and you have a unitary test which is really nice), anyway I feel like<br>
it doesn't handle the case of inert objects that are requested with a<br>
method that "return" an object. For example an inert seat that is<br>
requested for get_keyboard(), in this case I think should we should bind<br>
an inert keyboard. I have worked on this subject to solve that exact<br>
problem. Today the seat can't be released because: we don't have the<br>
method to do it, and we have the race problem that prevent us from<br>
freeing the seat.<br>
<br>
Regards.<br>
<br></span></blockquote><div><br></div></div></div><div>Yeah, you're right. When the object is inert, then it won't call anything but destructor, which would break new_id messages on this object... OK, this could be solved by looking into the signature for new_id arg, so the new condition would be:<br><br></div><div>if (is_inert && (!message_is_destructor || !has_new_id))<br></div><div> do_not_invoke<br></div><div><br>And then programmer must check if the resource is innert when creating new resource for new id (which would not be much pain, since usually we don't want to do anything with inert resource, so we'd check for it anyway).<br><br>Anyway, In you're approach there's this problem solved by inheriting the inertness from parent interface, which is really nice.<br></div><span class=""><div><br><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
--<br>
David FORT<br>
website: <a href="http://www.hardening-consulting.com/" target="_blank">http://www.hardening-consulting.com/</a><br>
<br>
<br>
<br>
</span><div><div>_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org" target="_blank">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</div></div></blockquote></span></div><br></div></div>
</blockquote></div><br></div>