cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: crash memory

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 1 Dec 2006 23:43:41 +0100 (CET)

On Fri, 1 Dec 2006, leonardo.bolanos wrote:

> I have a multithread implementation with curl-7.16.0 + traces,

Using the multi or easy interface?

> and i'm testing failover. So we shutdown apache while many of connections
> are active.

How many? Are they all connected to the same IP/host? At what state are the
connections when you "test failover"? What exactly do you do when you test
that?

Is this (easy) repeatable?

> I have a crash in two parts of the code.
> 1) conn_free()
> ...free(conn);
>
> app caused an Access Violation (0xc0000005)
>
> in trace a saw that there are two conn_free with same number.
>
> conn_free connection #3
> conn_free connection #3

That looks really bad!

> 2) CreateConnection
> conn = (struct connectdata *)calloc(sizeof(struct connectdata), 1);
>
> app caused an Access Violation (0xc0000005)
> in module ntdll.dll at 001b:77fcb0ca.
>
> HEAP[NK90Simuld.exe]: HEAP: Free Heap block a609b08 modified at a609b30 after
> it was freed

Ouch, this would indicate something wrote outside of their boundaries prior to
this call. Do you have any memory debug tool, like purify, valgrind, efence or
similar that could help catch this?

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