Valgrind command:
export MDS_LOG_LEVEL=5; valgrind --error-exitcode=1 --track-origins=yes --leak-check=yes --errors-for-leak-kinds=definite mdstest [suite] [test]
List of errors:
1) Access an uninitialized value
==2172== Command: mdstest 9 7
==2172== Parent PID: 2167
==2172==
==2172== Thread 2:
==2172== Conditional jump or move depends on uninitialised value(s)
==2172== at 0x50A12F4: mds_mcm_ll_data_rcv (mds_c_sndrcv.c:4727)
==2172== by 0x50A9A19: mds_mdtm_send_tcp (mds_dt_trans.c:516)
==2172== by 0x509FC46: mcm_msg_cpy_send.constprop.21 (mds_c_sndrcv.c:1479)
==2172== by 0x50A01F3: mds_mcm_send_msg_enc (mds_c_sndrcv.c:1240)
==2172== by 0x50A07BF: mcm_pvt_red_snd_process_common (mds_c_sndrcv.c:2664)
==2172== by 0x50A37A2: mcm_pvt_normal_svc_snd_rsp (mds_c_sndrcv.c:3705)
==2172== by 0x50A37A2: mds_mcm_send (mds_c_sndrcv.c:835)
==2172== by 0x50A37A2: mds_send (mds_c_sndrcv.c:458)
==2172== by 0x50ABF6B: ncsmds_api (mds_papi.c:165)
==2172== by 0x12E799: mds_send_response (mdstipc_conf.c:1213)
==2172== by 0x116166: tet_adest_rcvr_thread (mdstipc_api.c:5207)
==2172== by 0x52EC6DA: start_thread (pthread_create.c:463)
==2172== by 0x562561E: clone (clone.S:95)
==2172== Uninitialised value was created by a stack allocation
==2172== at 0x12D210: mds_service_install (mdstipc_conf.c:419)
2) Access an uninitialized value
==737== Command: mdstest 1 1
==737== Parent PID: 732
==737==
==737== Conditional jump or move depends on uninitialised value(s)
==737== at 0x55608AA: vfprintf (vfprintf.c:1642)
==737== by 0x5635FC8: __vsnprintf_chk (vsnprintf_chk.c:63)
==737== by 0x507B8AF: vsnprintf (stdio2.h:78)
==737== by 0x507B8AF: Write<512> (log_message.h:265)
==737== by 0x507B8AF: LogTraceClient::CreateLogEntryInternal(base::LogMessage::Severity, timespec, char const*, __va_list_tag*) (logtrace_client.cc:124)
==737== by 0x507BF37: LogTraceClient::LogInternal(base::LogMessage::Severity, timespec, char const*, __va_list_tag*) (logtrace_client.cc:107)
==737== by 0x507C02F: LogTraceClient::Log(base::LogMessage::Severity, char const*, __va_list_tag*) (logtrace_client.cc:99)
==737== by 0x50AAB62: log_mds_info (mds_log.cc:113)
==737== by 0x50ACBF0: mds_svc_op_uninstall (mds_svc_op.c:374)
==737== by 0x50AC057: ncsmds_api (mds_papi.c:147)
==737== by 0x12D528: mds_service_uninstall (mdstipc_conf.c:478)
==737== by 0x110218: tet_svc_install_tp_01 (mdstipc_api.c:120)
==737== by 0x1305E8: run_test_case (utest.c:178)
==737== by 0x130A2D: test_run (utest.c:226)
==737== Uninitialised value was created by a stack allocation
==737== at 0x12D420: mds_service_uninstall (mdstipc_conf.c:465)
3) Invalid read:
==6173== Command: mdstest 27 1
==6173== Parent PID: 6172
==6173==
==6173== Thread 2:
==6173== Invalid read of size 4
==6173== at 0x5082180: ncs_sel_obj_ind (os_defs.c:1259)
==6173== by 0x50B5765: (anonymous namespace)::process_all_events() (mds_tipc_fctrl_intf.cc:243)
==6173== by 0x52EC6DA: start_thread (pthread_create.c:463)
==6173== by 0x562561E: clone (clone.S:95)
==6173== Address 0x6473fdc is 12 bytes inside a block of size 48 free'd
==6173== at 0x4C3323B: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6173== by 0x50B5757: (anonymous namespace)::process_all_events() (mds_tipc_fctrl_intf.cc:241)
==6173== by 0x52EC6DA: start_thread (pthread_create.c:463)
==6173== by 0x562561E: clone (clone.S:95)
==6173== Block was alloc'd at
==6173== at 0x4C3217F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6173== by 0x50B47E9: mds_tipc_fctrl_shutdown (mds_tipc_fctrl_intf.cc:318)
==6173== by 0x50B10E6: mdtm_tipc_destroy (mds_dt_tipc.c:534)
==6173== by 0x50AB74B: mds_lib_req (mds_main.c:703)
==6173== by 0x507DBEF: ncs_mds_shutdown.part.6 (ncs_main_pub.c:431)
==6173== by 0x507E2D4: ncs_core_agents_shutdown (ncs_main_pub.c:462)
==6173== by 0x507E34D: ncs_agents_shutdown (ncs_main_pub.c:123)
==6173== by 0x10FE28: mds_shutdown (mdstest.c:56)
==6173== by 0x12B879: tet_overload_tp_1 (mdstipc_api.c:14197)
==6173== by 0x1305E8: run_test_case (utest.c:178)
==6173== by 0x130A2D: test_run (utest.c:226)
==6173== by 0x5525C86: (below main) (libc-start.c:310)
==6173==
4) Invalid read:
==732== Command: mdstest 9 13
==732== Parent PID: 726
==732==
==732== Invalid read of size 1
==732== at 0x4C396B0: __memcpy_chk (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==732== by 0x5085072: memcpy (string_fortified.h:34)
==732== by 0x5085072: ncs_patricia_tree_getnext (patricia.c:491)
==732== by 0x5098413: mds_mcm_pwe_destroy (mds_c_api.c:772)
==732== by 0x50AC0F4: ncsmds_adm_api (mds_papi.c:249)
==732== by 0x50AED20: mda_lib_req (ncs_mda.c:207)
==732== by 0x507F0C9: ncs_spir_api (ncs_sprr.c:660)
==732== by 0x50AEC9B: mda_lib_req (ncs_mda.c:127)
==732== by 0x507DBE7: ncs_mds_shutdown.part.6 (ncs_main_pub.c:430)
==732== by 0x507E2D4: ncs_core_agents_shutdown (ncs_main_pub.c:462)
==732== by 0x507E34D: ncs_agents_shutdown (ncs_main_pub.c:123)
==732== by 0x10FE28: mds_shutdown (mdstest.c:56)
==732== by 0x11488D: tet_send_response_tp_14 (mdstipc_api.c:6341)
==732== Address 0x647bb07 is 39 bytes inside a block of size 440 free'd
==732== at 0x4C32D3B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==732== by 0x509B2C4: mds_svc_tbl_del (mds_c_db.c:902)
==732== by 0x50ACB9C: mds_svc_op_uninstall (mds_svc_op.c:371)
==732== by 0x509843C: mds_mcm_pwe_destroy (mds_c_api.c:770)
==732== by 0x50AC0F4: ncsmds_adm_api (mds_papi.c:249)
==732== by 0x50AED20: mda_lib_req (ncs_mda.c:207)
==732== by 0x507F0C9: ncs_spir_api (ncs_sprr.c:660)
==732== by 0x50AEC9B: mda_lib_req (ncs_mda.c:127)
==732== by 0x507DBE7: ncs_mds_shutdown.part.6 (ncs_main_pub.c:430)
==732== by 0x507E2D4: ncs_core_agents_shutdown (ncs_main_pub.c:462)
==732== by 0x507E34D: ncs_agents_shutdown (ncs_main_pub.c:123)
==732== by 0x10FE28: mds_shutdown (mdstest.c:56)
==732== Block was alloc'd at
==732== at 0x4C33B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==732== by 0x509B433: mds_svc_tbl_add (mds_c_db.c:821)
==732== by 0x50AC718: mds_svc_op_install (mds_svc_op.c:175)
==732== by 0x50AC047: ncsmds_api (mds_papi.c:143)
==732== by 0x12D1BE: mds_service_install (mdstipc_conf.c:436)
==732== by 0x114922: tet_send_response_tp_14 (mdstipc_api.c:6288)
==732== by 0x130538: run_test_case (utest.c:178)
==732== by 0x13097D: test_run (utest.c:226)
==732== by 0x10E7D8: main (mdstest.c:92)
==732==
5) Definitely lost:
==732== 400 bytes in 1 blocks are definitely lost in loss record 10 of 12
==732== at 0x4C33B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==732== by 0x50994A5: mds_mcm_user_event_callback (mds_c_api.c:1829)
==732== by 0x50AC3F4: mds_svc_op_user_callback (mds_svc_op.c:1698)
==732== by 0x50AE1DB: mds_svc_op_adest_nway_delete (mds_svc_op.c:887)
==732== by 0x50AE1DB: mds_svc_op_down (mds_svc_op.c:830)
==732== by 0x5098C96: mds_mcm_svc_down (mds_c_api.c:1305)
==732== by 0x50A92D4: mds_mdtm_process_recvdata (mds_dt_trans.c:1150)
==732== by 0x50AA396: mdtm_process_poll_recv_data_tcp (mds_dt_trans.c:903)
==732== by 0x50AA7AE: mdtm_process_recv_events_tcp (mds_dt_trans.c:995)
==732== by 0x52EC6DA: start_thread (pthread_create.c:463)
==732== by 0x562561E: clone (clone.S:95)
6) Definitely lost:
==2411== Command: mdstest 10 2
==2411== Parent PID: 2406
==2411==
==2411== 262,952 bytes in 1 blocks are definitely lost in loss record 9 of 9
==2411== at 0x4C33B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2411== by 0x116D12: tet_adest_all_chgrole_rcvr_thread (mdstipc_api.c:6578)
==2411== by 0x52EC6DA: start_thread (pthread_create.c:463)
==2411== by 0x562561E: clone (clone.S:95)
7) Uninitialized values:
==2342== Command: mdstest 9 12
==2342== Parent PID: 2337
==2342==
==2342== Conditional jump or move depends on uninitialised value(s)
==2342== at 0x55608AA: vfprintf (vfprintf.c:1642)
==2342== by 0x56365C7: __vfprintf_chk (vfprintf_chk.c:33)
==2342== by 0x11016A: vfprintf (stdio2.h:127)
==2342== by 0x11016A: safe_printf (mdstipc_api.c:63)
==2342== by 0x13035A: tet_mds_cb_enc_flat (mdstipc_conf.c:2021)
==2342== by 0x509E8E2: mcm_msg_encode_full_or_flat_and_send (mds_c_sndrcv.c:1654)
==2342== by 0x50A0146: mds_mcm_send_msg_enc (mds_c_sndrcv.c:1255)
==2342== by 0x50A26DC: mcm_pvt_normal_snd_process_common (mds_c_sndrcv.c:1194)
==2342== by 0x50A33D0: mcm_pvt_normal_svc_sndrsp (mds_c_sndrcv.c:2871)
==2342== by 0x50A33D0: mds_mcm_send (mds_c_sndrcv.c:792)
==2342== by 0x50A33D0: mds_send (mds_c_sndrcv.c:458)
==2342== by 0x50ABF6B: ncsmds_api (mds_papi.c:165)
==2342== by 0x12ED04: mds_send_get_response (mdstipc_conf.c:1098)
==2342== by 0x114A54: tet_send_response_tp_13 (mdstipc_api.c:6215)
==2342== by 0x130E28: run_test_case (utest.c:178)
==2342== Uninitialised value was created by a stack allocation
==2342== at 0x1147A2: tet_send_response_tp_13 (mdstipc_api.c:6189)
==2342==
==2342== Use of uninitialised value of size 8
==2342== at 0x555C83B: _itoa_word (_itoa.c:179)
==2342== by 0x555FEDD: vfprintf (vfprintf.c:1642)
==2342== by 0x56365C7: __vfprintf_chk (vfprintf_chk.c:33)
==2342== by 0x11016A: vfprintf (stdio2.h:127)
==2342== by 0x11016A: safe_printf (mdstipc_api.c:63)
==2342== by 0x13035A: tet_mds_cb_enc_flat (mdstipc_conf.c:2021)
==2342== by 0x509E8E2: mcm_msg_encode_full_or_flat_and_send (mds_c_sndrcv.c:1654)
==2342== by 0x50A0146: mds_mcm_send_msg_enc (mds_c_sndrcv.c:1255)
==2342== by 0x50A26DC: mcm_pvt_normal_snd_process_common (mds_c_sndrcv.c:1194)
==2342== by 0x50A33D0: mcm_pvt_normal_svc_sndrsp (mds_c_sndrcv.c:2871)
==2342== by 0x50A33D0: mds_mcm_send (mds_c_sndrcv.c:792)
==2342== by 0x50A33D0: mds_send (mds_c_sndrcv.c:458)
==2342== by 0x50ABF6B: ncsmds_api (mds_papi.c:165)
==2342== by 0x12ED04: mds_send_get_response (mdstipc_conf.c:1098)
==2342== by 0x114A54: tet_send_response_tp_13 (mdstipc_api.c:6215)
==2342== Uninitialised value was created by a stack allocation
==2342== at 0x1147A2: tet_send_response_tp_13 (mdstipc_api.c:6189)
==2342==
==2342== Conditional jump or move depends on uninitialised value(s)
==2342== at 0x555C845: _itoa_word (_itoa.c:179)
==2342== by 0x555FEDD: vfprintf (vfprintf.c:1642)
==2342== by 0x56365C7: __vfprintf_chk (vfprintf_chk.c:33)
==2342== by 0x11016A: vfprintf (stdio2.h:127)
==2342== by 0x11016A: safe_printf (mdstipc_api.c:63)
==2342== by 0x13035A: tet_mds_cb_enc_flat (mdstipc_conf.c:2021)
==2342== by 0x509E8E2: mcm_msg_encode_full_or_flat_and_send (mds_c_sndrcv.c:1654)
==2342== by 0x50A0146: mds_mcm_send_msg_enc (mds_c_sndrcv.c:1255)
==2342== by 0x50A26DC: mcm_pvt_normal_snd_process_common (mds_c_sndrcv.c:1194)
==2342== by 0x50A33D0: mcm_pvt_normal_svc_sndrsp (mds_c_sndrcv.c:2871)
==2342== by 0x50A33D0: mds_mcm_send (mds_c_sndrcv.c:792)
==2342== by 0x50A33D0: mds_send (mds_c_sndrcv.c:458)
==2342== by 0x50ABF6B: ncsmds_api (mds_papi.c:165)
==2342== by 0x12ED04: mds_send_get_response (mdstipc_conf.c:1098)
==2342== by 0x114A54: tet_send_response_tp_13 (mdstipc_api.c:6215)
==2342== Uninitialised value was created by a stack allocation
==2342== at 0x1147A2: tet_send_response_tp_13 (mdstipc_api.c:6189)
==2342==
==2342== Conditional jump or move depends on uninitialised value(s)
==2342== at 0x555FFE4: vfprintf (vfprintf.c:1642)
==2342== by 0x56365C7: __vfprintf_chk (vfprintf_chk.c:33)
==2342== by 0x11016A: vfprintf (stdio2.h:127)
==2342== by 0x11016A: safe_printf (mdstipc_api.c:63)
==2342== by 0x13035A: tet_mds_cb_enc_flat (mdstipc_conf.c:2021)
==2342== by 0x509E8E2: mcm_msg_encode_full_or_flat_and_send (mds_c_sndrcv.c:1654)
==2342== by 0x50A0146: mds_mcm_send_msg_enc (mds_c_sndrcv.c:1255)
==2342== by 0x50A26DC: mcm_pvt_normal_snd_process_common (mds_c_sndrcv.c:1194)
==2342== by 0x50A33D0: mcm_pvt_normal_svc_sndrsp (mds_c_sndrcv.c:2871)
==2342== by 0x50A33D0: mds_mcm_send (mds_c_sndrcv.c:792)
==2342== by 0x50A33D0: mds_send (mds_c_sndrcv.c:458)
==2342== by 0x50ABF6B: ncsmds_api (mds_papi.c:165)
==2342== by 0x12ED04: mds_send_get_response (mdstipc_conf.c:1098)
==2342== by 0x114A54: tet_send_response_tp_13 (mdstipc_api.c:6215)
==2342== by 0x130E28: run_test_case (utest.c:178)
==2342== Uninitialised value was created by a stack allocation
==2342== at 0x1147A2: tet_send_response_tp_13 (mdstipc_api.c:6189)
==2342==
==2342== Conditional jump or move depends on uninitialised value(s)
==2342== at 0x5560B1C: vfprintf (vfprintf.c:1642)
==2342== by 0x56365C7: __vfprintf_chk (vfprintf_chk.c:33)
==2342== by 0x11016A: vfprintf (stdio2.h:127)
==2342== by 0x11016A: safe_printf (mdstipc_api.c:63)
==2342== by 0x13035A: tet_mds_cb_enc_flat (mdstipc_conf.c:2021)
==2342== by 0x509E8E2: mcm_msg_encode_full_or_flat_and_send (mds_c_sndrcv.c:1654)
==2342== by 0x50A0146: mds_mcm_send_msg_enc (mds_c_sndrcv.c:1255)
==2342== by 0x50A26DC: mcm_pvt_normal_snd_process_common (mds_c_sndrcv.c:1194)
==2342== by 0x50A33D0: mcm_pvt_normal_svc_sndrsp (mds_c_sndrcv.c:2871)
==2342== by 0x50A33D0: mds_mcm_send (mds_c_sndrcv.c:792)
==2342== by 0x50A33D0: mds_send (mds_c_sndrcv.c:458)
==2342== by 0x50ABF6B: ncsmds_api (mds_papi.c:165)
==2342== by 0x12ED04: mds_send_get_response (mdstipc_conf.c:1098)
==2342== by 0x114A54: tet_send_response_tp_13 (mdstipc_api.c:6215)
==2342== by 0x130E28: run_test_case (utest.c:178)
==2342== Uninitialised value was created by a stack allocation
==2342== at 0x1147A2: tet_send_response_tp_13 (mdstipc_api.c:6189)
==2342==
==2342== Conditional jump or move depends on uninitialised value(s)
==2342== at 0x507810F: ncs_encode_n_octets_in_uba (hj_ubaid.c:729)
==2342== by 0x130398: tet_mds_cb_enc_flat (mdstipc_conf.c:2033)
==2342== by 0x509E8E2: mcm_msg_encode_full_or_flat_and_send (mds_c_sndrcv.c:1654)
==2342== by 0x50A0146: mds_mcm_send_msg_enc (mds_c_sndrcv.c:1255)
==2342== by 0x50A26DC: mcm_pvt_normal_snd_process_common (mds_c_sndrcv.c:1194)
==2342== by 0x50A33D0: mcm_pvt_normal_svc_sndrsp (mds_c_sndrcv.c:2871)
==2342== by 0x50A33D0: mds_mcm_send (mds_c_sndrcv.c:792)
==2342== by 0x50A33D0: mds_send (mds_c_sndrcv.c:458)
==2342== by 0x50ABF6B: ncsmds_api (mds_papi.c:165)
==2342== by 0x12ED04: mds_send_get_response (mdstipc_conf.c:1098)
==2342== by 0x114A54: tet_send_response_tp_13 (mdstipc_api.c:6215)
==2342== by 0x130E28: run_test_case (utest.c:178)
==2342== by 0x13126D: test_run (utest.c:226)
==2342== by 0x10E858: main (mdstest.c:92)
==2342== Uninitialised value was created by a stack allocation
==2342== at 0x1147A2: tet_send_response_tp_13 (mdstipc_api.c:6189)
==2342==
8) Uninitialized bytes:
==2342== Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
==2342== at 0x52F6A9E: send (send.c:28)
==2342== by 0x50A9526: mds_sock_send (mds_dt_trans.c:79)
==2342== by 0x50A98BE: mds_mdtm_send_tcp (mds_dt_trans.c:650)
==2342== by 0x509EA66: mcm_msg_encode_full_or_flat_and_send (mds_c_sndrcv.c:1774)
==2342== by 0x50A0146: mds_mcm_send_msg_enc (mds_c_sndrcv.c:1255)
==2342== by 0x50A26DC: mcm_pvt_normal_snd_process_common (mds_c_sndrcv.c:1194)
==2342== by 0x50A33D0: mcm_pvt_normal_svc_sndrsp (mds_c_sndrcv.c:2871)
==2342== by 0x50A33D0: mds_mcm_send (mds_c_sndrcv.c:792)
==2342== by 0x50A33D0: mds_send (mds_c_sndrcv.c:458)
==2342== by 0x50ABF6B: ncsmds_api (mds_papi.c:165)
==2342== by 0x12ED04: mds_send_get_response (mdstipc_conf.c:1098)
==2342== by 0x114A54: tet_send_response_tp_13 (mdstipc_api.c:6215)
==2342== by 0x130E28: run_test_case (utest.c:178)
==2342== by 0x13126D: test_run (utest.c:226)
==2342== Address 0x649a93d is 61 bytes inside a block of size 65 alloc'd
==2342== at 0x4C33B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2342== by 0x50A9808: mds_mdtm_send_tcp (mds_dt_trans.c:600)
==2342== by 0x509EA66: mcm_msg_encode_full_or_flat_and_send (mds_c_sndrcv.c:1774)
==2342== by 0x50A0146: mds_mcm_send_msg_enc (mds_c_sndrcv.c:1255)
==2342== by 0x50A26DC: mcm_pvt_normal_snd_process_common (mds_c_sndrcv.c:1194)
==2342== by 0x50A33D0: mcm_pvt_normal_svc_sndrsp (mds_c_sndrcv.c:2871)
==2342== by 0x50A33D0: mds_mcm_send (mds_c_sndrcv.c:792)
==2342== by 0x50A33D0: mds_send (mds_c_sndrcv.c:458)
==2342== by 0x50ABF6B: ncsmds_api (mds_papi.c:165)
==2342== by 0x12ED04: mds_send_get_response (mdstipc_conf.c:1098)
==2342== by 0x114A54: tet_send_response_tp_13 (mdstipc_api.c:6215)
==2342== by 0x130E28: run_test_case (utest.c:178)
==2342== by 0x13126D: test_run (utest.c:226)
==2342== by 0x10E858: main (mdstest.c:92)
==2342== Uninitialised value was created by a stack allocation
==2342== at 0x1147A2: tet_send_response_tp_13 (mdstipc_api.c:6189)
==2342==
Diff:
commit 48da9255afcb3899a44e3a1d5ee68c075a15c23f (HEAD -> develop, origin/develop, ticket-3328)
Author: hieu.h.hoang hieu.h.hoang@dektech.com.au
Date: Tue Dec 6 12:45:43 2022 +0700