Re: segmentation fault when window closes



On Wed, 22 Sep 2010 23:14:20 +0100
Piscium <groknok gmail com> wrote:
> I created a example program to summarize the relevant details of my
> application. It is listed below. Interestingly the example does _not_
> crash. But I must be doing something wrong, and the fact that the
> example does not crash must be a coincidence. I wonder if anybody can
> spot what is wrong?

The cause of your segfault is not connected with this code.  The problem
with memory handling errors is that they usually create a segfault some
distance from the source of the error (often at the point when an
access is made to already freed memory which no longer forms part of
the memory image of the running program or which causes the program to
try to read memory or jump to code outside its image and/or its code
block, or to dereference a null pointer).

valgrind is in my experience by far the best tool for tracking these
kinds of things down.

Chris


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