fixed bug in wl_list
Marty Jack
martyj19 at comcast.net
Sat Mar 12 11:47:09 PST 2011
On 03/12/2011 02:20 PM, Bill Spitzak wrote:
> On 03/12/2011 04:28 AM, Marty Jack wrote:
>> I have never encountered a system where it was believed to be desirable to allow something to be removed twice. It is important to keep data structures clean. If anything you would be more likely to see a debugging mode where the lists were fully checked after every insert or remove to make sure they are internally consistent, especially if they are important to keeping the system running. It's not that much different from memory allocation. A block is allocated, or it is free, and a double free is a bug.
>
> Making it crash at the moment the second remove is attempted is better than it leaving the data corrupted and crashing later. It makes it a lot easier to find out why it went wrong.
>
> I think that is what the newest version of the patch is doing, right?
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
Yes definitely, but I still contend we need to understand where the first remove happens and it becomes a dangling reference. Or, if it's the case that some of these blocks are in a list and some not, I would claim a better design is to tag them explicitly.
This is nature's way of telling me I should read the rest of the code that I haven't yet so I understand what is going on.
More information about the wayland-devel
mailing list