I've got a patch for disabling memory pooling in dispatch, see the JIRA:

DISPATCH-121: Allow pool allocation to be switched for plain allocation
at build time.

The idea is to get better info from tools like valgrind. This shows up a
leak in the unit_tests, which may be a test bug:

==30007==    at 0x4A0645D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==30007==    by 0x4C3EB9A: new_qd_connection_t (server.c:42)
==30007==    by 0x4C421C0: qd_user_fd (server.c:1200)
==30007==    by 0x40347E: test_user_fd (server_test.c:117)
==30007==    by 0x40359F: server_tests (server_test.c:143)
==30007==    by 0x40312A: main (run_unit_tests.c:49)
==30007== 
==30007== 200 (152 direct, 48 indirect) bytes in 1 blocks are definitely lost 
in loss record 3,144 of 4,960
==30007==    at 0x4A0645D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==30007==    by 0x4C3EB9A: new_qd_connection_t (server.c:42)
==30007==    by 0x4C421C0: qd_user_fd (server.c:1200)
==30007==    by 0x4034A1: test_user_fd (server_test.c:118)
==30007==    by 0x40359F: server_tests (server_test.c:143)
==30007==    by 0x40312A: main (run_unit_tests.c:49)
==30007== 

But also there are invalid read errors in system tests. Attached are those from 
system_tests_two_routers

I'm looking at these, anyone who's interested in helping that would be great :)

==6834== 12 bytes in 1 blocks are definitely lost in loss record 17 of 5,118
==6834==    at 0x4C2745D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6834==    by 0x59790B9: strdup (strdup.c:42)
==6834==    by 0x4E4A959: qd_entity_get_string (entity.c:50)
==6834==    by 0x4E4AB7E: qd_entity_opt_string (entity.c:79)
==6834==    by 0x4E4A3E1: qd_dispatch_configure_container (dispatch.c:101)
==6834==    by 0x3069405D8B: ffi_call_unix64 (in /usr/lib64/libffi.so.6.0.1)
==6834==    by 0x30694056BB: ffi_call (in /usr/lib64/libffi.so.6.0.1)
==6834==    by 0x105CBC8A: _ctypes_callproc (callproc.c:832)
==6834==    by 0x105C5A84: PyCFuncPtr_call (_ctypes.c:3929)
==6834==    by 0x3B8F84A0D2: PyObject_Call (abstract.c:2529)
==6834==    by 0x3B8F8DE37B: PyEval_EvalFrameEx (ceval.c:4316)
==6834==    by 0x3B8F8E097F: PyEval_EvalFrameEx (ceval.c:4184)
==6834== 
==6834== 76 bytes in 1 blocks are definitely lost in loss record 2,995 of 5,118
==6834==    at 0x4C2745D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6834==    by 0x4E68EDD: qd_alloc (alloc_pool.c:171)
==6834==    by 0x4E47EF3: new_qd_link_t (container.c:62)
==6834==    by 0x4E4820F: setup_incoming_link (container.c:169)
==6834==    by 0x4E4895A: process_handler (container.c:373)
==6834==    by 0x4E48D7B: handler (container.c:482)
==6834==    by 0x4E63DD5: process_connector (server.c:387)
==6834==    by 0x4E64650: thread_run (server.c:615)
==6834==    by 0x52D1EE4: start_thread (pthread_create.c:309)
==6834==    by 0x59E7D1C: clone (clone.S:111)
==6834== 
==6834== 76 bytes in 1 blocks are definitely lost in loss record 2,996 of 5,118
==6834==    at 0x4C2745D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6834==    by 0x4E68EDD: qd_alloc (alloc_pool.c:171)
==6834==    by 0x4E47EF3: new_qd_link_t (container.c:62)
==6834==    by 0x4E48092: setup_outgoing_link (container.c:124)
==6834==    by 0x4E48945: process_handler (container.c:371)
==6834==    by 0x4E48D7B: handler (container.c:482)
==6834==    by 0x4E63DD5: process_connector (server.c:387)
==6834==    by 0x4E64650: thread_run (server.c:615)
==6834==    by 0x52D1EE4: start_thread (pthread_create.c:309)
==6834==    by 0x59E7D1C: clone (clone.S:111)
==6834== 
==6834== 272 (100 direct, 172 indirect) bytes in 1 blocks are definitely lost 
in loss record 3,898 of 5,118
==6834==    at 0x4C2745D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6834==    by 0x4E68EDD: qd_alloc (alloc_pool.c:171)
==6834==    by 0x4E597FF: new_qd_router_node_t (router_node.c:59)
==6834==    by 0x4E6091B: qd_add_router (router_pynode.c:94)
==6834==    by 0x3B8F8E0BC3: PyEval_EvalFrameEx (ceval.c:4098)
==6834==    by 0x3B8F8E21DC: PyEval_EvalCodeEx (ceval.c:3330)
==6834==    by 0x3B8F86F0D7: function_call (funcobject.c:526)
==6834==    by 0x3B8F84A0D2: PyObject_Call (abstract.c:2529)
==6834==    by 0x3B8F8590C4: instancemethod_call (classobject.c:2602)
==6834==    by 0x3B8F84A0D2: PyObject_Call (abstract.c:2529)
==6834==    by 0x3B8F8A1196: slot_tp_init (typeobject.c:5692)
==6834==    by 0x3B8F89FEAE: type_call (typeobject.c:745)
==6834== 
==6829== Invalid read of size 4
==6829==    at 0x50A0830: pn_link_state (engine.c:1305)
==6829==    by 0x4E49BD2: qd_link_activate (container.c:793)
==6829==    by 0x4E5CA89: router_disposition_handler (router_node.c:1043)
==6829==    by 0x4E4852D: do_updated (container.c:256)
==6829==    by 0x4E48B01: process_handler (container.c:409)
==6829==    by 0x4E48D7B: handler (container.c:482)
==6829==    by 0x4E63DD5: process_connector (server.c:387)
==6829==    by 0x4E64650: thread_run (server.c:615)
==6829==    by 0x4E65525: qd_server_run (server.c:933)
==6829==    by 0x401C42: main_process (main.c:134)
==6829==    by 0x4024E2: main (main.c:334)
==6829==  Address 0xeae4464 is 20 bytes inside a block of size 472 free'd
==6829==    at 0x4C28577: free (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6829==    by 0x5094545: pn_class_decref (object.c:103)
==6829==    by 0x50A1D7F: pn_event_finalize_cast (event.c:190)
==6829==    by 0x5094527: pn_class_decref (object.c:97)
==6829==    by 0x50A1F21: pn_collector_pop (event.c:167)
==6829==    by 0x4E48B1E: process_handler (container.c:418)
==6829==    by 0x4E48D7B: handler (container.c:482)
==6829==    by 0x4E63DD5: process_connector (server.c:387)
==6829==    by 0x4E64650: thread_run (server.c:615)
==6829==    by 0x52D1EE4: start_thread (pthread_create.c:309)
==6829==    by 0x59E7D1C: clone (clone.S:111)
==6829== 
==6829== 12 bytes in 1 blocks are definitely lost in loss record 16 of 4,694
==6829==    at 0x4C2745D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6829==    by 0x59790B9: strdup (strdup.c:42)
==6829==    by 0x4E4A959: qd_entity_get_string (entity.c:50)
==6829==    by 0x4E4AB7E: qd_entity_opt_string (entity.c:79)
==6829==    by 0x4E4A3E1: qd_dispatch_configure_container (dispatch.c:101)
==6829==    by 0x3069405D8B: ffi_call_unix64 (in /usr/lib64/libffi.so.6.0.1)
==6829==    by 0x30694056BB: ffi_call (in /usr/lib64/libffi.so.6.0.1)
==6829==    by 0x10DCBC8A: _ctypes_callproc (callproc.c:832)
==6829==    by 0x10DC5A84: PyCFuncPtr_call (_ctypes.c:3929)
==6829==    by 0x3B8F84A0D2: PyObject_Call (abstract.c:2529)
==6829==    by 0x3B8F8DE37B: PyEval_EvalFrameEx (ceval.c:4316)
==6829==    by 0x3B8F8E097F: PyEval_EvalFrameEx (ceval.c:4184)
==6829== 
==6829== 76 bytes in 1 blocks are definitely lost in loss record 2,605 of 4,694
==6829==    at 0x4C2745D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6829==    by 0x4E68EDD: qd_alloc (alloc_pool.c:171)
==6829==    by 0x4E47EF3: new_qd_link_t (container.c:62)
==6829==    by 0x4E4820F: setup_incoming_link (container.c:169)
==6829==    by 0x4E4895A: process_handler (container.c:373)
==6829==    by 0x4E48D7B: handler (container.c:482)
==6829==    by 0x4E63DD5: process_connector (server.c:387)
==6829==    by 0x4E64650: thread_run (server.c:615)
==6829==    by 0x52D1EE4: start_thread (pthread_create.c:309)
==6829==    by 0x59E7D1C: clone (clone.S:111)
==6829== 
==6829== 152 bytes in 2 blocks are definitely lost in loss record 3,275 of 4,694
==6829==    at 0x4C2745D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6829==    by 0x4E68EDD: qd_alloc (alloc_pool.c:171)
==6829==    by 0x4E47EF3: new_qd_link_t (container.c:62)
==6829==    by 0x4E48092: setup_outgoing_link (container.c:124)
==6829==    by 0x4E48945: process_handler (container.c:371)
==6829==    by 0x4E48D7B: handler (container.c:482)
==6829==    by 0x4E63DD5: process_connector (server.c:387)
==6829==    by 0x4E64650: thread_run (server.c:615)
==6829==    by 0x52D1EE4: start_thread (pthread_create.c:309)
==6829==    by 0x59E7D1C: clone (clone.S:111)
==6829== 
==6829== 168 (84 direct, 84 indirect) bytes in 1 blocks are definitely lost in 
loss record 3,329 of 4,694
==6829==    at 0x4C2745D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6829==    by 0x4E68EDD: qd_alloc (alloc_pool.c:171)
==6829==    by 0x4E59713: new_qd_routed_event_t (router_node.c:57)
==6829==    by 0x4E5BFBC: router_forward_to_remote_subscribers_LH 
(router_node.c:747)
==6829==    by 0x4E5C5C2: router_rx_handler (router_node.c:945)
==6829==    by 0x4E48471: do_receive (container.c:232)
==6829==    by 0x4E48AE5: process_handler (container.c:406)
==6829==    by 0x4E48D7B: handler (container.c:482)
==6829==    by 0x4E63DD5: process_connector (server.c:387)
==6829==    by 0x4E64650: thread_run (server.c:615)
==6829==    by 0x4E65525: qd_server_run (server.c:933)
==6829==    by 0x401C42: main_process (main.c:134)
==6829== 
==6829== 272 (100 direct, 172 indirect) bytes in 1 blocks are definitely lost 
in loss record 3,503 of 4,694
==6829==    at 0x4C2745D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6829==    by 0x4E68EDD: qd_alloc (alloc_pool.c:171)
==6829==    by 0x4E597FF: new_qd_router_node_t (router_node.c:59)
==6829==    by 0x4E6091B: qd_add_router (router_pynode.c:94)
==6829==    by 0x3B8F8E0BC3: PyEval_EvalFrameEx (ceval.c:4098)
==6829==    by 0x3B8F8E21DC: PyEval_EvalCodeEx (ceval.c:3330)
==6829==    by 0x3B8F86F0D7: function_call (funcobject.c:526)
==6829==    by 0x3B8F84A0D2: PyObject_Call (abstract.c:2529)
==6829==    by 0x3B8F8590C4: instancemethod_call (classobject.c:2602)
==6829==    by 0x3B8F84A0D2: PyObject_Call (abstract.c:2529)
==6829==    by 0x3B8F8A1196: slot_tp_init (typeobject.c:5692)
==6829==    by 0x3B8F89FEAE: type_call (typeobject.c:745)
==6829== 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to