Thread overview
valgrind? electric fence?
Jun 03, 2007
Jason House
Jun 03, 2007
Frank Benoit
Jun 03, 2007
Thomas Kuehne
Jun 11, 2007
Jason House
Jun 03, 2007
Regan Heath
June 03, 2007
Does anyone know if valgrind or similar products can work with D?  If so, how?  If not, does anyone know of the next best thing?  (like running the GC after every line of code in a particular function?)

Needless to say, I have a bug that's driving me crazy.  Somewhere fairly late in a loop equivalent to "for (int i=0; i<36100; i++) doSomething();", my program crashes in seemingly normal code with normal state.  doSomething passes all of its unit tests and passes my nieve code inspection.  I could even be looking in the wrong spot since the code is multithreaded...  (but the other threads are stuck in the equivalent of "while(foo()==false) yield;" while waiting for the other thing to finish.  (foo is a very simple function)
June 03, 2007
Jason House schrieb:
> Does anyone know if valgrind or similar products can work with D?  If so, how?  If not, does anyone know of the next best thing?  (like running the GC after every line of code in a particular function?)
> 

I never used valgrind, but i know that there are ppl that use valgrind on linux with D (probably GDC).
June 03, 2007
Jason House Wrote:
> Does anyone know if valgrind or similar products can work with D?  If so, how?  If not, does anyone know of the next best thing?  (like running the GC after every line of code in a particular function?)
> 
> Needless to say, I have a bug that's driving me crazy.  Somewhere fairly late in a loop equivalent to "for (int i=0; i<36100; i++) doSomething();", my program crashes in seemingly normal code with normal state.  doSomething passes all of its unit tests and passes my nieve code inspection.  I could even be looking in the wrong spot since the code is multithreaded...  (but the other threads are stuck in the equivalent of "while(foo()==false) yield;" while waiting for the other thing to finish.  (foo is a very simple function)

I'm looking for a challenge, if you want you can send me the code (my email is valid) and I'll see if I can find the bug.  If the code is closed source I'll even promise not to keep it afterwards, or leak it in any way shape or form.

Regan Heath
June 03, 2007
Frank Benoit schrieb am 2007-06-03:
> Jason House schrieb:
>> Does anyone know if valgrind or similar products can work with D?  If so, how?  If not, does anyone know of the next best thing?  (like running the GC after every line of code in a particular function?)
>> 
>
> I never used valgrind, but i know that there are ppl that use valgrind on linux with D (probably GDC).

Simply compile the application with debugging information and use
valgrind as you would do with a plain C application. Valgrind's bug
tracker contains a patch to add D demangler support. The demangling
information is dated and using http://ddemangled.kuehne.cn
(either as a standalone or a pluging) should result in better results.

Thomas


June 11, 2007
Frank Benoit wrote:
> Jason House schrieb:
>> Does anyone know if valgrind or similar products can work with D?  If
>> so, how?  If not, does anyone know of the next best thing?  (like
>> running the GC after every line of code in a particular function?)
>>
> 
> I never used valgrind, but i know that there are ppl that use valgrind
> on linux with D (probably GDC).

I'd be interested in hearing from others who have used valgrind with gdc.  It found issues immediately...  But it left me scratching my head.  It seems like code that should work doesn't in subtle ways.  For example, I opened a bug with the gdc project for my simplest example:
https://sourceforge.net/tracker/?func=detail&atid=791252&aid=1734477&group_id=154306

In the original code that drove me to experiment with this, the bug was reproducible on many platforms with gdc and never with dmd.  I only tested with valgrind on a single system, so I don't know if the valgrind insanity applies to other platforms.  I'd like to know if others have had similar issues.