cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl crashes on comparing null pointer

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 28 Jan 2007 23:36:29 +0100 (CET)

On Sun, 28 Jan 2007, Shmulik Regev wrote:

> I tried debugging the problem I reported and I can confirm it happens from
> time to time, although I wasn't able to cleanly reproduce it. Perhaps it
> happens when connections are reused in a specific sequence and redirections
> are automatically followed. Anyway, I recommend using the null pointer
> protection check I've sent.

But if a pointer like this is "randomly" set to NULL during execution, it is a
sign of something really seriously broken. Wouldn't it then make better sense
to just bail out really hard with a fatal error? That's a pointer that should
be set after connect in the first request of a connection and all subsequent
requests should be able to read it.

Have you tried using valgrind and/or libcurl's memory debug system or similar
to see if you could detect any memory usage badness?

It could in fact also be your application causing this.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-01-28