Thread overview
valgrind
Sep 24, 2003
pts+d
Sep 24, 2003
Walter
Oct 15, 2003
Ilya Minkov
September 24, 2003
Dear All,

valgrind is a Linux memory error detector. When I run

dmd -O hello.d; valgrind ./hello

, everything is fine. But it doesn't work without -O, because it gives me the unfriendly error message

==21650== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux.
==21650== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
==21650== Using valgrind-20030725, a program supervision framework for
x86-linux.
==21650== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
==21650== Estimated CPU clock rate is 804 MHz
==21650== For more details, rerun with: -v
==21650==
disInstr: unhandled instruction bytes: 0xC8 0xC 0x0 0x0

This might be an issue for Valgrind, not DMD, but I think it would be important to have DMD and Valgrind working together, so we would be able to track down memory errors much easier.

pts


September 24, 2003
It looks like a bug in valgrind. 0xC8 is the ENTER instruction, and has been around on the PC since the 80286! It works with -O because dmd doesn't generate an ENTER with -O, as ENTER is a bit slow.

<pts+d@math.bme.hu> wrote in message news:bkse8p$13od$1@digitaldaemon.com...
> Dear All,
>
> valgrind is a Linux memory error detector. When I run
>
> dmd -O hello.d; valgrind ./hello
>
> , everything is fine. But it doesn't work without -O, because it gives me
the
> unfriendly error message
>
> ==21650== Memcheck, a.k.a. Valgrind, a memory error detector for
x86-linux.
> ==21650== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
> ==21650== Using valgrind-20030725, a program supervision framework for
> x86-linux.
> ==21650== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
> ==21650== Estimated CPU clock rate is 804 MHz
> ==21650== For more details, rerun with: -v
> ==21650==
> disInstr: unhandled instruction bytes: 0xC8 0xC 0x0 0x0
>
> This might be an issue for Valgrind, not DMD, but I think it would be
important
> to have DMD and Valgrind working together, so we would be able to track
down
> memory errors much easier.
>
> pts
>
>


October 15, 2003
pts+d@math.bme.hu wrote:

> This might be an issue for Valgrind, not DMD, but I think it would be important
> to have DMD and Valgrind working together, so we would be able to track down
> memory errors much easier.

Doesn't garbage collection make it impossible to track down "memory errors" anyway? How do you debug your memory, say in Java? :)

And the need is not that critical as in C and C++.

-eye