ChugR commented on a change in pull request #445: DISPATCH-1246: clean up core link endpoints on shutdown URL: https://github.com/apache/qpid-dispatch/pull/445#discussion_r252687262
########## File path: src/router_core/connections.c ########## @@ -1227,9 +1223,7 @@ static void qdr_connection_closed_CT(qdr_core_t *core, qdr_action_t *action, boo qdr_connection_work_t *work = DEQ_HEAD(conn->work_list); while (work) { DEQ_REMOVE_HEAD(conn->work_list); - qdr_terminus_free(work->source); - qdr_terminus_free(work->target); - free_qdr_connection_work_t(work); + qdr_connection_work_free_CT(work); Review comment: This branch produces a valgrind InvalidRead when the work item is used after it is free'd. ` kind = InvalidRead (count=1) Invalid read of size 1 Stack: (qdr_deliver_continue_peers_CT) /home/chug/git/qpid-dispatch/src/router_core/transfer.c:1236 (qdr_deliver_continue_CT) /home/chug/git/qpid-dispatch/src/router_core/transfer.c:1269 ` But it doesn't look like the work was free'd by this code: ` Address 0x143aaa79 is 41 bytes inside a block of size 48 free'd: (free) /builddir/build/BUILD/valgrind-3.14.0/coregrind/m_replacemalloc/vg_replace_malloc.c:540 (free_qdr_link_work_t) /home/chug/git/qpid-dispatch/src/router_core/router_core.c:36 (qdr_connection_process) /home/chug/git/qpid-dispatch/src/router_core/connections.c:341 ` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org