Re: Troubleshooting segfault



On 8/4/05, Jonathan Hayward <christos jonathan hayward gmail com> wrote:
>  Thank you. I hadn't used valgrind; it reports my game as crashing at the
> same time, under the same conditions, as gdb. There were no problems
> reported prior to the segfault gdb had picked up.
>  
>  When I used valgrind, I the segfault appeared to be coming from
> gtk_entry_get_text(GTK_ENTRY(GtkWidget *entry)).
>
>  If a buffer overflow had overwritten the pointer, would valgrind observe
> it? If valgrind doesn't report problems before the segmentation violation,
> does it mean that there probably isn't a memory error other than the segv?

It depends a bit on the version of valgrind and how you started it up.
By default I think it just checks for memory leaks --- you need to
turn on memory access checking. There's another flag that will dump
you into gdb the instant valgrind detects a memory error.

You'll know when it's working because you'll see a bunch of harmless
warnings about the behaviour of X.

John



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]