www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Valgrind

reply =?iso-8859-1?Q?Robert_M._M=FCnch?= <robert.muench saphirion.com> writes:
Hi, I just found quite old posts about Valgrind and D. Can someone give 
me a short update, what the state of support for D is and if there is 
anythings special to take into account. Thanks a lot.

-- 
Robert M. MŁnch
http://www.saphirion.com
smarter | better | faster
Apr 20 2015
parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
On Monday, 20 April 2015 at 13:16:23 UTC, Robert M. M√ľnch wrote:
 Hi, I just found quite old posts about Valgrind and D. Can 
 someone give me a short update, what the state of support for D 
 is and if there is anythings special to take into account. 
 Thanks a lot.
The only special thing to take in to account is that valgrind will choke on DMD generated floating point code, so really you have to use GDC or LDC if you want to use valgrind.
Apr 20 2015
next sibling parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
On Monday, 20 April 2015 at 13:28:57 UTC, John Colvin wrote:
 On Monday, 20 April 2015 at 13:16:23 UTC, Robert M. M√ľnch wrote:
 Hi, I just found quite old posts about Valgrind and D. Can 
 someone give me a short update, what the state of support for 
 D is and if there is anythings special to take into account. 
 Thanks a lot.
The only special thing to take in to account is that valgrind will choke on DMD generated floating point code, so really you have to use GDC or LDC if you want to use valgrind.
Correction: The only special thing I know of.
Apr 20 2015
next sibling parent reply =?iso-8859-1?Q?Robert_M._M=FCnch?= <robert.muench saphirion.com> writes:
On 2015-04-20 13:29:57 +0000, John Colvin said:

 On Monday, 20 April 2015 at 13:28:57 UTC, John Colvin wrote:
 On Monday, 20 April 2015 at 13:16:23 UTC, Robert M. MŁnch wrote:
 Hi, I just found quite old posts about Valgrind and D. Can someone give 
 me a short update, what the state of support for D is and if there is 
 anythings special to take into account. Thanks a lot.
The only special thing to take in to account is that valgrind will choke on DMD generated floating point code, so really you have to use GDC or LDC if you want to use valgrind.
Correction: The only special thing I know of.
Ok, thanks. Were the causes ever analyzed? I'm a bit wondering why it happens on floating point stuff... -- Robert M. MŁnch http://www.saphirion.com smarter | better | faster
Apr 20 2015
parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
On Monday, 20 April 2015 at 16:58:18 UTC, Robert M. M√ľnch wrote:
 On 2015-04-20 13:29:57 +0000, John Colvin said:

 On Monday, 20 April 2015 at 13:28:57 UTC, John Colvin wrote:
 On Monday, 20 April 2015 at 13:16:23 UTC, Robert M. M√ľnch 
 wrote:
 Hi, I just found quite old posts about Valgrind and D. Can 
 someone give me a short update, what the state of support 
 for D is and if there is anythings special to take into 
 account. Thanks a lot.
The only special thing to take in to account is that valgrind will choke on DMD generated floating point code, so really you have to use GDC or LDC if you want to use valgrind.
Correction: The only special thing I know of.
Ok, thanks. Were the causes ever analyzed? I'm a bit wondering why it happens on floating point stuff...
valgrind doesn't have full support for x87 code, which dmd emits all over the place.
Apr 20 2015
parent "Nick B" <nick.barbalich gmail.com> writes:
On Monday, 20 April 2015 at 17:25:55 UTC, John Colvin wrote:
 On Monday, 20 April 2015 at 16:58:18 UTC, Robert M. M√ľnch wrote:
 On 2015-04-20 13:29:57 +0000, John Colvin said:
 Were the causes ever analyzed? I'm a bit wondering why it 
 happens on floating point stuff...
valgrind doesn't have full support for x87 code, which dmd emits all over the place.
There is company is Germany, which does Valgrind consultancy, http://www.open-works.net/contact.html which could fix this issue, if you are prepared to throw some money their way. Nick
Apr 20 2015
prev sibling parent "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
On Monday, 20 April 2015 at 13:29:58 UTC, John Colvin wrote:
 On Monday, 20 April 2015 at 13:28:57 UTC, John Colvin wrote:
 On Monday, 20 April 2015 at 13:16:23 UTC, Robert M. M√ľnch 
 wrote:
 Hi, I just found quite old posts about Valgrind and D. Can 
 someone give me a short update, what the state of support for 
 D is and if there is anythings special to take into account. 
 Thanks a lot.
The only special thing to take in to account is that valgrind will choke on DMD generated floating point code, so really you have to use GDC or LDC if you want to use valgrind.
Correction: The only special thing I know of.
AFAIK, this has been fixed a long time ago.
Apr 20 2015
prev sibling parent reply "Martin Nowak" <code dawg.eu> writes:
On Monday, 20 April 2015 at 13:28:57 UTC, John Colvin wrote:
 The only special thing to take in to account is that valgrind 
 will choke on DMD generated floating point code
I actually fixed this problem a while ago. https://github.com/D-Programming-Language/dmd/pull/4368 An actual problem with valgrind is the GC, because most of it's operations appear to valgrind as memory corruptions. You can GC.disable() collections, use gcstub.d, or help Vladimir with his valgrind/GC support to make things work. http://dlang.org/phobos/core_memory.html#.GC.disable https://github.com/D-Programming-Language/druntime/blob/master/src/gcstub/gc.d https://github.com/CyberShadow/druntime/commits/valgrind
Apr 20 2015
parent Brad Roberts via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
Valgrind has a mechanism for teaching it how to ignore certain patterns. 
  A long time ago I setup suppressions for the gc, but the code has 
changed out from under that version so the work would need to be redone.

On 4/20/2015 7:23 PM, Martin Nowak via Digitalmars-d-learn wrote:
 On Monday, 20 April 2015 at 13:28:57 UTC, John Colvin wrote:
 The only special thing to take in to account is that valgrind will
 choke on DMD generated floating point code
I actually fixed this problem a while ago. https://github.com/D-Programming-Language/dmd/pull/4368 An actual problem with valgrind is the GC, because most of it's operations appear to valgrind as memory corruptions. You can GC.disable() collections, use gcstub.d, or help Vladimir with his valgrind/GC support to make things work. http://dlang.org/phobos/core_memory.html#.GC.disable https://github.com/D-Programming-Language/druntime/blob/master/src/gcstub/gc.d https://github.com/CyberShadow/druntime/commits/valgrind
Apr 20 2015