[Bug 72] New: valgrind: use of unitialized values in the gcx module

Thomas Kuehne thomas-dloop at kuehne.cn
Sat Mar 25 01:09:37 PST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Walter Bright schrieb am 2006-03-25:
>
><d-bugmail at puremagic.com> wrote in message 
> news:bug-72-3 at http.d.puremagic.com/bugzilla/...
>> Use of uninitialised value of size 4
>>   at 0x8067370: _D6gcbits6GCBits3setFkZv (in /tmp/dstress/log)
>>   by 0x8066A24: _D3gcx3Gcx4markFPvPvZv (in /tmp/dstress/log)
>>   by 0x8066BB7: _D3gcx3Gcx11fullcollectFPvZk (in /tmp/dstress/log)
>>   by 0x8066A79: _D3gcx3Gcx16fullcollectshellFZk (in /tmp/dstress/log)
>>   by 0x8065BAF: _D3gcx2GC12mallocNoSyncFkZPv (in /tmp/dstress/log)
>>   by 0x8065AF6: _D3gcx2GC6mallocFkZPv (in /tmp/dstress/log)
>>   by 0x806000D: _d_arrayappendc (in /tmp/dstress/log)
>
> I don't know what to make of this. Here's the code in question:
>
> void set(uint i)
> in
> {
>     assert(i < nbits);
> }
> body
> {
>     //(cast(bit *)(data + 1))[i] = 1;
>     data[1 + (i >> BITS_SHIFT)] |= (1 << (i & BITS_MASK));
> }
>
> Where's the use of an uninitialized value? 

Seems to be a side effect of the "-release" flag.

compiling phobos with no flags:
=> no uninitialized value messages

compiling phobos with "-inline":
=> no uninitialized value messages

compiling phobos with "-O":
=> no unitialized value messages

compiling phobos with "-release":
=> "_D6gcbits6GCBits3setFkZv" message twice

compiling phobos with "-inline -O":
=> no unitialized value messages

compiling phobos with "-inline -release":
=> "_D6gcbits6GCBits3setFkZv" message twice

compiling phobos with "-O -release":
=> "_D6gcbits6GCBits3setFkZv" message twice

compiling phobos with "-inline -O -release":
=> "_D6gcbits6GCBits3setFkZv" message twice

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFEJRYy3w+/yD4P9tIRAlbtAJ4vez0F6J9sq157uToFxNhX0muxigCgwkD5
QTFqxrhpoQrKAtUd10DmLZ4=
=+Idk
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-bugs mailing list