Thread overview
[dmd-beta] rdmd heisenbug
Jul 09, 2011
Walter Bright
Jul 10, 2011
Jason House
Jul 10, 2011
Walter Bright
Jul 10, 2011
Johannes Pfau
Jul 15, 2011
Vladimir Panteleev
Jul 15, 2011
Walter Bright
July 09, 2011
We've got a real heisenbug going on with rdmd.

Anything that causes the memory layout of rdmd to be different causes it to start working. This includes running it under the debugger. This includes adding any printfs, compiling rdmd with the debug build of dmd, etc.

I suspect the problem is use of uninitialized memory in druntime/phobos.

Anyone have any ideas?
July 09, 2011
Valgrind. I know the GC will cause false alarms, but you should be able to disable that for the test.

Sent from my iPhone

On Jul 9, 2011, at 7:58 PM, Walter Bright <walter at digitalmars.com> wrote:

> We've got a real heisenbug going on with rdmd.
> 
> Anything that causes the memory layout of rdmd to be different causes it to start working. This includes running it under the debugger. This includes adding any printfs, compiling rdmd with the debug build of dmd, etc.
> 
> I suspect the problem is use of uninitialized memory in druntime/phobos.
> 
> Anyone have any ideas?
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
July 09, 2011

On 7/9/2011 6:21 PM, Jason House wrote:
> Valgrind. I know the GC will cause false alarms, but you should be able to disable that for the test.

No errors detected with valgrind.
July 10, 2011
Am 10.07.2011 01:58, schrieb Walter Bright:
> We've got a real heisenbug going on with rdmd.
>
> Anything that causes the memory layout of rdmd to be different causes it to start working. This includes running it under the debugger. This includes adding any printfs, compiling rdmd with the debug build of dmd, etc.
>
> I suspect the problem is use of uninitialized memory in druntime/phobos.
>
> Anyone have any ideas?
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
If it's a regression, you can maybe track it down with git bisect ( http://progit.org/book/ch6-5.html ). But if even unrelated changes change the result, that might not work.

-- 
Johannes Pfau

July 15, 2011
Reposting my message from two days ago. I've also filed http://d.puremagic.com/issues/show_bug.cgi?id=6308 since then.

On Sun, 10 Jul 2011 02:58:04 +0300, Walter Bright <walter at digitalmars.com> wrote:

> We've got a real heisenbug going on with rdmd.
>
> Anything that causes the memory layout of rdmd to be different causes it to start working. This includes running it under the debugger. This includes adding any printfs, compiling rdmd with the debug build of dmd, etc.
>
> I suspect the problem is use of uninitialized memory in druntime/phobos.
>
> Anyone have any ideas?

I did a bit of research on this a few days ago. Using a certain debugger and the map file, I found that the crash occurred in the autogenerated scope(exit) for getDependencies - the block of code that calls the File destructor. I didn't look too closely, but it looked like a bad "this" pointer is passed to the File dtor. I tried a full DMD/Phobos regression test, but didn't really get anywhere.

Just now, I tried to write the following program to test an unrelated problem I encountered earlier, regarding destruction of temporaries and DMC libc's low file count.

import std.stdio;

void main()
{
	foreach (i; 0..100)
		foreach (line; File("test.d").byLine)
			{}
}

The program crashes. I have a feeling that it's the same problem as with rdmd.

Hope this helps.

-- 
Best regards,
    Vladimir                            mailto:vladimir at thecybershadow.net
July 15, 2011
Thanks for working on this. I added your other comments to the bug report, as they contain valuable information.

On 7/15/2011 9:39 AM, Vladimir Panteleev wrote:
> Reposting my message from two days ago. I've also filed http://d.puremagic.com/issues/show_bug.cgi?id=6308 since then.
>