bug-3dldf
[Top][All Lists]
Advanced

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

[bug-3dldf] Segmentation fault error


From: Laurence Finston
Subject: [bug-3dldf] Segmentation fault error
Date: Mon, 23 Aug 2004 18:08:56 +0200 (MEST)

Hi Glen,

Please "cc" `help-3dldf' and `bug-3dldf' for these sorts of
topics, and don't encrypt.  Maybe someone else will have
similar questions someday.

A "Segmentation fault" error in 3DLDF almost always means
a problem with an uninitialized pointer.  When it's tested
against 0, it passes the test, so execution proceeds on the
assumption that the region of memory it points to contains
an object of a particular type.  When it tries to access it,
the segmentation fault error occurs.

Almost every function in 3DLDF, if not every function,
defines a `bool DEBUG' variable.  When you've located where
the error occurs, e.g., by means of a backtrace in GDB, set
`DEBUG' to `true' in one or more functions, unless the
backtrace indicates clearly enough where the problem is.  It
should work to set `DEBUG' to `true' within the debugger,
but this doesn't work on my installation when I'm using
threads.  Debugging is a lot easier when multithreading is
disabled, but that doesn't work right now.  If you have to
reset `DEBUG' by hand, then you have to rebuild, of course,
before running `3dldf' again.

If you're lucky, it will be clear which pointer is causing
the problem.  Then you can set initialize it to 0 when it's
declared.  If it's a data member of, say, `Scanner_Type',
then you'll have to initialize it in the constructors.

Please ALWAYS tell me what you needed to do to fix the error, so I
can fix it in my sources.

Laurence









reply via email to

[Prev in Thread] Current Thread [Next in Thread]