Heap corruption in reading struct fields in ctor

deadalnix deadalnix at gmail.com
Wed Dec 19 20:45:51 PST 2012


On Thursday, 20 December 2012 at 04:15:31 UTC, H. S. Teoh wrote:
> On Thu, Dec 20, 2012 at 04:37:25AM +0100, deadalnix wrote:
>> Can you tell more about what is the corruption ?
>> 
>> Are you getting garbage elements from front ? Can you use a 
>> debugger
>> or add some writeln to show some pointer addresses ?
>
> Yeah it's garbage elements from front. I'll try a debugger, but 
> this
> problem only happens in git dmd, not in gdc, and dmd 
> executables are a
> bit of a pain to deal with in gdb.
>

Can you try to check if the pointer of the returned string is the 
right one (IE, buff) but happen to contain garbage or the pointer 
itself is garbage ?

>
>> Is GC.collect() changing something (like triggering the problem
>> earlier) ?
>
> I don't think it's the GC, because this program is so tiny.
>

I'm mentioning that because it does look like my GC issue.


More information about the Digitalmars-d mailing list