[phobos] Strange access violation Mandelbug with AAs + Appender

David Simcha dsimcha at gmail.com
Fri Aug 20 18:53:39 PDT 2010


I've taken a look at this code and I'm utterly confused by it.  I highly 
doubt I'll be tackling this bug.  I think that if whoever wrote this 
can't fix it for next release, it should be rolled back to the 2.047 
version.

On 8/19/2010 3:07 PM, Shin Fujishiro wrote:
> David Simcha<dsimcha at gmail.com>  wrote:
>    
>> http://d.puremagic.com/issues/show_bug.cgi?id=4681
>>
>> This is a really bad one.  Someone please check to make sure I'm not doing
>> anything really silly and that this isn't specific to some obscure detail of
>> my setup.  If others can reproduce this, it's a really bad one and probably
>> warrants an emergency release.
>>      
> Seems like a bug of Appender.writeCapacity().  It often writes 'cap' to
> wrong address; the following assertion fails:
> ==========
> diff --git phobos/std/array.d phobos/std/array.d
> index 6b62733..e6d3a62 100644
> --- phobos/std/array.d
> +++ phobos/std/array.d
> @@ -736,10 +736,12 @@ private:
>           auto p = cast(ubyte*) (pArray.ptr + pArray.length);
>           if (cap<  ubyte.max)
>           {
> +            assert(p + 1<= GC.addrOf(pArray.ptr) + GC.sizeOf(pArray.ptr));
>               *p = cast(ubyte) cap;
>           }
>           else if (cap<  ushort.max)
>           {
> +            assert(p + 3<= GC.addrOf(pArray.ptr) + GC.sizeOf(pArray.ptr));
>               *p++ = ubyte.max;
>               *p++ = cast(ubyte) cap;
>               *p++ = cast(ubyte) (cap>>  8);
> ==========
>
>
> Shin
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>
>    



More information about the phobos mailing list