[Haskell-cafe] Crash!

Dan Piponi dpiponi at gmail.com
Thu Oct 23 16:56:38 EDT 2008

On Thu, Oct 23, 2008 at 1:26 PM, Andrew Coppin
<andrewcoppin at btinternet.com> wrote:
> Does anybody know of any tools for definitely pinning down stuff like this?
> Surely C programmers have their code crash several hundred times a day due
> to bugs like this...

Curiously, the tool I often use with C/C++ to track down things like
overrunning past the end of arrays was written by a GHC developer.
It's valgrind. If the problem is happening in a foreign C/C++
function, and the executable has debugging information pointing to
valid source for those functions, then valgrind might help with
Haskell too. Even without source, testing with the 'fail' example
earlier in this thread, it at least tells me the problem was trying to
read from memory location zero, more information than just
"Segmentation Fault".

More information about the Haskell-Cafe mailing list