<div dir="ltr"><div><span style="font-size:14px;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Hi pekka</span></div><div><span style="font-size:14px;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div>
<span style="font-size:14px">I find the last_error is caused by wl_display_flush()-->wl_connection_flush(). The sendmsg() return fail.</span><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">Many applications write code like this:</span></div><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">redraw()</span></div><div><span style="font-size:14px">{</span></div><div><span style="font-size:14px">wl_surface_commit();</span></div><div><span style="font-size:14px">wl_display_sync();</span></div><div><span style="font-size:14px">wl_display_flush();</span></div><div><span style="font-size:14px">}</span></div><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">while (1) {</span></div><div><span style="font-size:14px">redraw();</span></div><div><span style="font-size:14px">}</span></div><div><span style="font-size:14px"><br></span><div><br></div><div>The code will block to wait buffer release eventĀ if there is no free buffer. But if display->last_error happen, the wl_display_dispatch_queue() fail too. Does the application use the wl_display_flush() right?</div><div><br></div><div>Thank you!</div><div><br></div><div>Best Regards</div><div>Nancy</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-06-14 18:33 GMT+08:00 Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, 14 Jun 2018 16:59:35 +0800<br>
zou lan <<a href="mailto:nancy.lan.zou@gmail.com">nancy.lan.zou@gmail.com</a>> wrote:<br>
<br>
> Dear pekka & All:<br>
> <br>
> I find a wayland application report error about allocate memory fail.<br>
> I check the code, after request to weston to allocate dma buffer, it call<br>
> wl_display_roundtrip().<br>
> But this function return very fast, it doesn't block until the create<br>
> events back.<br>
> <br>
> I suspect the display->last_error is not 0. Then the wl_display_roundtrip()<br>
> return fast because of the last_error. Does it right?<br>
<br>
</span>Hi,<br>
<br>
sounds plausible.<br>
<span class=""><br>
> I find the following log:<br>
> <br>
> wl_display@1: error 0: invalid object 10<br>
<br>
</span>Your application has a bug.<br>
<span class=""><br>
> Does the application need to handle the display errors? How could I make<br>
> the last_error not impact wl_display_roundtrip?<br>
<br>
</span>All protocol errors are always fatal: they cause the client to be<br>
disconnected and render the client wl_display unusable. The application<br>
can only report the error somewhere and quit.<br>
<br>
Protocol errors always imply a bug. Usually the bug is in the client<br>
code, but it could be in compositor code as well.<br>
<br>
<br>
Thanks,<br>
pq<br>
</blockquote></div><br></div>