On Thu, 2008-05-08 at 02:16 -0400, Zero Altitude wrote:
> I apologize: can you clarify the watchpoint suggestion?  If you mean
> "while running the program" as in, while apache is still running and
> not crashed, this is virtually impossible -- as I said, the segfault
> occurs only once in a few thousand uploads.

Yes. Obviously, don't use the production machine for this. Rather, set
up a test instance somewhere and then hit it with a lot of uploads (you
should be able to use ab for that).

Watchpoint in GDB enable you to see when things change. Like this:
-------------------------------------------------
You can use a watchpoint to stop execution whenever the value of an
expression changes, without having to predict a particular place where
this may happen.  (This is sometimes called a "data breakpoint".)  The
expression may be as simple as the value of a single variable, or as
complex as many variables combined by operators.  Examples include:

   * A reference to the value of a single variable.

   * An address cast to an appropriate data type.  For example, `*(int
     *)0x12345678' will watch a 4-byte region at the specified address
     (assuming an `int' occupies 4 bytes).

   * An arbitrarily complex expression, such as `a*b + c/d'.  The
     expression can use any operators valid in the program's native
     language (*note Languages::).
-------------------------------------------------

So, in your case, see when handle becomes negative. When it does, GDB
will stop execution and you'll see what code caused that memory location
to change. My bet is that something completely unrelated is stomping
over this, thus causing a segfault.

-- 
Bojan

Reply via email to