mirror of
https://github.com/rkd77/elinks.git
synced 2024-09-14 00:48:28 -04:00
00f5831812
Call stacks reported by valgrind: ==14702== at 0x80DD791: read_from_socket (socket.c:945) ==14702== by 0x8104D0C: read_more_http_data (http.c:1180) ==14702== by 0x81052FE: read_http_data (http.c:1388) ==14702== by 0x80DD69B: read_select (socket.c:910) ==14702== by 0x80D27AA: select_loop (select.c:307) ==14702== by 0x80D1ADE: main (main.c:358) ==14702== Address 0x4F4E598 is 56 bytes inside a block of size 81 free'd ==14702== at 0x402210F: free (vg_replace_malloc.c:233) ==14702== by 0x812BED8: debug_mem_free (memdebug.c:484) ==14702== by 0x80D7C82: done_connection (connection.c:479) ==14702== by 0x80D8A44: abort_connection (connection.c:769) ==14702== by 0x80D99CE: cancel_download (connection.c:1053) ==14702== by 0x8110EB6: abort_download (download.c:143) ==14702== by 0x81115BC: download_data_store (download.c:337) ==14702== by 0x8111AFB: download_data (download.c:446) ==14702== by 0x80D7B33: notify_connection_callbacks (connection.c:458) ==14702== by 0x80D781E: set_connection_state (connection.c:388) ==14702== by 0x80D7132: set_connection_socket_state (connection.c:234) ==14702== by 0x80DD78D: read_from_socket (socket.c:943) read_from_socket() attempted to read socket->fd in order to set handlers on it, but the socket had already been freed. Incidentally, socket->fd was -1, which would have resulted in an assertion failure if valgrind hadn't caught the bug first. To fix this, add a list of weak references to sockets. read_from_socket() registers a weak reference on entry and unregisters it before exit. done_socket() breaks any weak references to the specified socket. read_from_socket() then checks whether the weak reference was broken, and doesn't access the socket any more if so. |
||
---|---|---|
.. | ||
ssl | ||
connection.c | ||
connection.h | ||
dns.c | ||
dns.h | ||
Makefile | ||
progress.c | ||
progress.h | ||
socket.c | ||
socket.h | ||
state.c | ||
state.h |