cURL / Mailing Lists / curl-library / Single Mail

curl-library

crash memory

From: leonardo.bolanos <leonardo.bolanos_at_nekotec.com.mx>
Date: Fri, 01 Dec 2006 15:24:50 -0500

Hi all

I have a multithread implementation with curl-7.16.0 + traces, and i'm
testing failover. So we shutdown apache while many of connections are
active.

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

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

This is the curl trace from last conn_free connection memory a609b30,
to CreateConnection crash function.

Info<0B0C8DB0>: conn_free connection #3 conn 0xa609b30
Info<0B0C8DB0>: Store Assign Connection #3 conn 0x9ca0018 conn2 (nil)
Info<0B0C8DB0>: remove_entry_if_stale name (nil) TimeOut 0 inuse 34
Info<0B0C8DB0>: Curl_resolv<0xa448998> name (nil) 34
Info<0B0C8DB0>: About to connect() to 192.168.0.129 port 8080 (#3)
Info<0B0C8DB0>: Trying 192.168.0.129...
Info<0AEFE540>: Expire cleared
Info<0AEFE540>: Curl_resolv<0xa448998> name (nil) 34
Info<0AEFE540>: Empty reply from server
Info<0AEFE540>: Connection #11 conn 0x9bde6e8 to host 192.168.0.129 left
intact
Info<0B0862F0>: Expire cleared
Info<0B0862F0>: Curl_resolv<0xa448998> name (nil) 33
Info<0B0862F0>: Empty reply from server
Info<0B0862F0>: Connection #12 conn 0xb0d1308 to host 192.168.0.129 left
intact
Info<0B0C0858>: Expire cleared
Info<0B0C0858>: Curl_resolv<0xa448998> name (nil) 32
Info<0B0C0858>: Empty reply from server
Info<0B0C0858>: Connection #9 conn 0xa06c9a8 to host 192.168.0.129 left
intact
Info<0B028068>: Expire cleared
Info<0B028068>: Curl_resolv<0xa448998> name (nil) 31
Info<0B028068>: Empty reply from server
Info<0B028068>: Connection #10 conn 0xaee9708 to host 192.168.0.129 left
intact
Info<0B0C8DB0>: Connection refused
Info<0B0C8DB0>: Failed connect to 192.168.0.129:8080; No error
Info<0B0C8DB0>: Expire cleared
Info<0B0C8DB0>: Curl_hostcache_prune
Info<0B0C8DB0>: Closing connection #3 conn 0x9ca0018 conn2 0x9ca0018
Info<0B0C8DB0>: conn_free connection #3 conn 0x9ca0018
Info<0B0AFDA8>: Connection refused
Info<0B0AFDA8>: Failed connect to 192.168.0.129:8080; No error
Info<0B0AFDA8>: Expire cleared
Info<0B0AFDA8>: Curl_hostcache_prune
Info<0B0AFDA8>: Closing connection #0 conn 0x9873a28 conn2 0x9873a28
Info<0B0AFDA8>: conn_free connection #0 conn 0x9873a28
Info<0B0A7850>: Connection refused
Info<0B0A7850>: Failed connect to 192.168.0.129:8080; No error
Info<0B0A7850>: Expire cleared
Info<0B0A7850>: Curl_hostcache_prune
Info<0B0A7850>: Closing connection #2 conn 0xae2c328 conn2 0xae2c328
Info<0B0A7850>: conn_free connection #2 conn 0xae2c328
Info<0AF5BE80>: Connection refused
Info<0AF5BE80>: Failed connect to 192.168.0.129:8080; No error
Info<0AF5BE80>: Expire cleared
Info<0AF5BE80>: Curl_hostcache_prune
Info<0AF5BE80>: Closing connection #1 conn 0x9af0018 conn2 0x9af0018
Info<0AF5BE80>: conn_free connection #1 conn 0x9af0018
Info<0B09F2F8>: Creating connection #-1 conn 0x9ca0018
Info<0B09F2F8>: Examining connection #4 conn 0x99ec388 for reuse
Info<0B09F2F8>: Connection #4 conn 0x99ec388 conn2 0x99ec388 seems to be
dead!
Info<0B09F2F8>: Curl_hostcache_prune
Info<0B09F2F8>: Closing connection #4 conn 0x99ec388 conn2 0x99ec388
Info<0B09F2F8>: conn_free connection #4 conn 0x99ec388
Info<0B09F2F8>: Store Assign Connection #0 conn 0x9ca0018 conn2 (nil)
Info<0B09F2F8>: remove_entry_if_stale name (nil) TimeOut 0 inuse 31
Info<0B09F2F8>: Curl_resolv<0xa448998> name (nil) 31
Info<0B09F2F8>: About to connect() to 192.168.0.129 port 8080 (#0)
Info<0B09F2F8>: Trying 192.168.0.129...
Info<0AE00BE0>: Creating connection #-1 conn 0x99ec388
Info<0AE00BE0>: Examining connection #0 conn 0x9ca0018 for reuse
Info<0AE00BE0>: Examining connection #5 conn 0xb061230 for reuse
Info<0AE00BE0>: Connection #5 conn 0xb061230 conn2 0xb061230 seems to be
dead!
Info<0AE00BE0>: Curl_hostcache_prune
Info<0AE00BE0>: Closing connection #5 conn 0xb061230 conn2 0xb061230
Info<0AE00BE0>: conn_free connection #5 conn 0xb061230
Info<0AE00BE0>: Store Assign Connection #1 conn 0x99ec388 conn2 (nil)
Info<0AE00BE0>: remove_entry_if_stale name (nil) TimeOut 0 inuse 32
Info<0AE00BE0>: Curl_resolv<0xa448998> name (nil) 32
Info<0AE00BE0>: About to connect() to 192.168.0.129 port 8080 (#1)
Info<0AE00BE0>: Trying 192.168.0.129...
Info<0B09F2F8>: Connection refused
Info<0B09F2F8>: Failed connect to 192.168.0.129:8080; No error
Info<0B09F2F8>: Expire cleared
Info<0B09F2F8>: Curl_hostcache_prune
Info<0B09F2F8>: Closing connection #0 conn 0x9ca0018 conn2 0x9ca0018
Info<0B09F2F8>: conn_free connection #0 conn 0x9ca0018
Info<0AE00BE0>: Connection refused
Info<0AE00BE0>: Failed connect to 192.168.0.129:8080; No error
Info<0AE00BE0>: Expire cleared
Info<0AE00BE0>: Curl_hostcache_prune
Info<0AE00BE0>: Closing connection #1 conn 0x99ec388 conn2 0x99ec388
Info<0AE00BE0>: conn_free connection #1 conn 0x99ec388
Info<0B0862F0>: Creating connection #-1 conn 0x99ec388
Info<0B0862F0>: Examining connection #6 conn 0x9d0e130 for reuse
Info<0B0862F0>: Connection #6 conn 0x9d0e130 conn2 0x9d0e130 seems to be
dead!
Info<0B0862F0>: Curl_hostcache_prune
Info<0B0862F0>: Closing connection #6 conn 0x9d0e130 conn2 0x9d0e130
Info<0B0862F0>: conn_free connection #6 conn 0x9d0e130
Info<0B0862F0>: Store Assign Connection #0 conn 0x99ec388 conn2 (nil)
Info<0B0862F0>: remove_entry_if_stale name (nil) TimeOut 0 inuse 33
Info<0B0862F0>: Curl_resolv<0xa448998> name (nil) 33
Info<0B0862F0>: About to connect() to 192.168.0.129 port 8080 (#0)
Info<0B0862F0>: Trying 192.168.0.129...
Info<0ABF7910>: Creating connection #-1 conn 0x9ca0018
Info<0ABF7910>: Examining connection #0 conn 0x99ec388 for reuse
Info<0ABF7910>: Examining connection #7 conn 0x973ad08 for reuse
Info<0ABF7910>: Connection #7 conn 0x973ad08 conn2 0x973ad08 seems to be
dead!
Info<0ABF7910>: Curl_hostcache_prune
Info<0ABF7910>: Closing connection #7 conn 0x973ad08 conn2 0x973ad08
Info<0ABF7910>: conn_free connection #7 conn 0x973ad08
Info<0ABF7910>: Store Assign Connection #1 conn 0x9ca0018 conn2 (nil)
Info<0ABF7910>: remove_entry_if_stale name (nil) TimeOut 0 inuse 34
Info<0ABF7910>: Curl_resolv<0xa448998> name (nil) 34
Info<0ABF7910>: About to connect() to 192.168.0.129 port 8080 (#1)
Info<0ABF7910>: Trying 192.168.0.129...

Anyone can help me

Thanks in advance.

-- 
Hector Leonardo Bolaņos Muņoz
Developer Engineer
Received on 2006-12-01