Unix Programming - Re: gdb (linux) "print" command clears memory corruption - so how

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > January 2004 > Re: gdb (linux) "print" command clears memory corruption - so how





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: gdb (linux) "print" command clears memory corruption - so how
=?iso-8859-1?q?M=E5ns_Rullg=E5rd?=

2004-01-23, 5:02 pm

kreuiter@netscape.net (Gavin Kreuiter) writes:
quote:

> I am looking for some advice on how to debug a program when the
> debugger "print" command actually clears the corruption. This is not
> the usual non-initialised memory problem, because the program aborts
> with a SIGBUS inside the debugger as well. But when I use the print
> command inside the debugger, the program completes normally.



You have a Schrödinger bug, i.e. one that changes when you observe it.
Since you are running Linux, I'd suggest you try out valgrind,
http://valgrind.kde.org/. It's a debugger that will usually catch
most kinds of memory related bugs.
quote:

> (I orignally posted this to comp.lang.c, but suspect that I might have
> chosen the wrong newsgroup. Perhaps someone can also advise me how I
> determine which group to post a query to; is there a FAQ on choosing
> newsgroups?)



Browse the list of groups and find those that look appropriate to you.
Then fetch the FAQ for those groups, and see if it looks right. It
might even answer your question.

--
Måns Rullgård
mru@kth.se
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com