Well, the actual problem is that something was removed twice. And I know where this place is, but I couldn&#39;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&#39;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">&lt;<a href="mailto:martyj19@comcast.net">martyj19@comcast.net</a>&gt;</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>
&gt; Hello,<br>
&gt;<br>
&gt; I found a bug and fixed it with the patch :)<br>
&gt;<br>
&gt; *to reproduce:*<br>
&gt; run compositor on top of x11<br>
&gt;<br>
&gt; repeat<br>
&gt;    run flower<br>
&gt;    drag &amp; drop it a little<br>
&gt;    move the pointer in and out of the compositor/flower<br>
&gt;    Ctrl+C the flower client<br>
&gt;<br>
&gt; it would break eventually<br>
&gt;<br>
&gt; *problem:*<br>
&gt; I found that the linked list surface-&gt;destroy_listener_list got corrupted at some point (it was not circular any more, strange next/prev etc), which causes the crash.<br>
&gt;<br>
&gt; *solution:*<br>
&gt; The problem was in wl_list_remove -- when you erase an element, you don&#39;t mark it as &#39;erased&#39;, 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>


&gt;<br>
&gt; Regards,<br>
&gt; Iskren<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; wayland-devel mailing list<br>
&gt; <a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
&gt; <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>