[Vortex] How to correctly close a connection?

Francis Brosnan Blazquez francis at aspl.es
Mon Oct 13 15:30:08 CEST 2008


> Hi Francis, so I did. Here is the log output:

Hi Robert,

> ==15524== Thread 2:
> ==15524== Invalid free() / delete / delete[]
> ==15524==    at 0x401D43C: free (vg_replace_malloc.c:323)

It's not the connection but a data stored in the connection (via
vortex_connection_set_data or vortex_connection_set_data_full). In fact,
it is failing to dealloc a data pointer, not the key. 

Looking at this point, the axl hash is trying to deallocate a pointer
(with no data; wrong address) with the associated free (maybe axl_free).

> ==15524==    by 0x45DF60C: axl_hash_free (axl_hash.c:1216)
> ==15524==    by 0x45B18F7: vortex_hash_destroy (vortex_hash.c:357)
> ==15524==    by 0x459ADF0: vortex_connection_free (vortex_connection.c:2494)
> ==15524==    by 0x45AFD60: __vortex_reader_build_set_to_watch_aux (vortex_reader.c:971)
> ==15524==    by 0x45B100C: __vortex_reader_run (vortex_reader.c:1228)
> ==15524==    by 0x460823F: start_thread (in /lib/tls/i686/cmov/libpthread-2.3.6.so)
> ==15524==    by 0x411A49D: clone (in /lib/tls/i686/cmov/libc-2.3.6.so)
> ==15524==  Address 0x45e72f8 is not stack'd, malloc'd or (recently) free'd
> 
> Any idea?

I'd check all calls done to store user defined data via
vortex_connection_set_data or vortex_connection_set_data_full. The
application is setting a pointer to nothing (with an associated dealloc
function built on top of free). 

Another approach will be to check when 0x401D43C is stored on the
connection (do a break on vortex_connection_set_data_full to check each
value stored). 

Cheers!
-- 
Francis Brosnan Blazquez <francis at aspl.es>
Advanced Software Production Line, S.L.



More information about the Vortex mailing list