Well, the actual problem is that something was removed twice. And I know where this place is, but I couldn't know if you would like to remove elements multiple times with no problems, or treat the list very carefully and remove elements only once. But then there should be a way to know if an element is already in a list or not. So if there is a way to know that, why not make a check inside wl_list_remove, just to make sure.<div>
<br></div><div>I'll fix it the way you want it to be :)</div><div><br></div><div>Regards,</div><div>Iskren<br><br><div class="gmail_quote">On Sat, Mar 12, 2011 at 1:07 PM, Marty Jack <span dir="ltr"><<a href="mailto:martyj19@comcast.net">martyj19@comcast.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5"><br>
<br>
On 03/11/2011 07:32 PM, Iskren Chernev wrote:<br>
> Hello,<br>
><br>
> I found a bug and fixed it with the patch :)<br>
><br>
> *to reproduce:*<br>
> run compositor on top of x11<br>
><br>
> repeat<br>
> run flower<br>
> drag & drop it a little<br>
> move the pointer in and out of the compositor/flower<br>
> Ctrl+C the flower client<br>
><br>
> it would break eventually<br>
><br>
> *problem:*<br>
> I found that the linked list surface->destroy_listener_list got corrupted at some point (it was not circular any more, strange next/prev etc), which causes the crash.<br>
><br>
> *solution:*<br>
> The problem was in wl_list_remove -- when you erase an element, you don't mark it as 'erased', by setting prev/next to NULL for example. Then if you erase it again the list becomes corrupt. I nullified the prev/next and check in the begining of wl_list_remove for not-in-list elements and just ignore them. That seems to fix it.<br>
><br>
> Regards,<br>
> Iskren<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> wayland-devel mailing list<br>
> <a href="mailto:wayland-devel@lists.freedesktop.org">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>
<br>
Unfortunately your fix only papers over the real problem, which is that the list got corrupted at some point. It would not actually solve the problem. The source of the corruption needs to be located and fixed; it could be removing something twice, inserting something twice, or the like. You could push ahead with this if you were interested.<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">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>
</blockquote></div><br></div>