Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mizar unit tests show memory leaks for network policy CLI commands. #495

Closed
vinaykul opened this issue Jun 1, 2021 · 1 comment
Closed
Assignees
Labels
area/networkPolicy bug Something isn't working

Comments

@vinaykul
Copy link
Member

vinaykul commented Jun 1, 2021

Repro steps:

  1. make clean && make all
  2. make run_unittests

Expected: All tests pass, no errors.

Actual: Network policy tests fail and show memory leaks..

--------------------------------------------------------------------------------
Test: delete-net-policy-protocol-port-out succeed with well formed policy json input
--------------------------------------------------------------------------------
[  FAILED  ] test_trn_cli_delete_agent_network_policy_protocol_port_subcmd
[==========] 41 test(s) run.
[  PASSED  ] 31 test(s).
[  FAILED  ] 10 test(s), listed below:
[  FAILED  ] test_trn_cli_load_transit_subcmd
[  FAILED  ] test_trn_cli_load_agent_subcmd
[  FAILED  ] test_trn_cli_update_transit_network_policy_subcmd
[  FAILED  ] test_trn_cli_update_agent_network_policy_subcmd
[  FAILED  ] test_trn_cli_delete_transit_network_policy_subcmd
[  FAILED  ] test_trn_cli_delete_agent_network_policy_subcmd
[  FAILED  ] test_trn_cli_update_transit_network_policy_protocol_port_subcmd
[  FAILED  ] test_trn_cli_update_agent_network_policy_protocol_port_subcmd
[  FAILED  ] test_trn_cli_delete_transit_network_policy_protocol_port_subcmd
[  FAILED  ] test_trn_cli_delete_agent_network_policy_protocol_port_subcmd

 10 FAILED TEST(S)

=================================================================
==1912126==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 128 byte(s) in 2 object(s) allocated from:
    #0 0x559076b9f9d5 in __interceptor_malloc (/home/ubuntu/vmizar/build/tests/test_cli+0x289d5)
    #1 0x559076c06722 in cJSON_New_Item src/extern/cJSON.c:214
    #2 0x559076c06722 in cJSON_ParseWithOpts src/extern/cJSON.c:1029
    #3 0x559076c06722 in cJSON_Parse src/extern/cJSON.c:1092
    #4 0x559076be78b7 in trn_cli_parse_json src/cli/trn_cli_common.c:29
    #5 0x559076bf45c7 in trn_cli_delete_transit_pod_and_namespace_label_policy_subcmd src/cli/trn_cli_network_policy.c:981
    #6 0x559076bd2661 in test_trn_cli_delete_transit_pod_and_namespace_label_policy_subcmd src/cli/test/test_cli.c:3032
    #7 0x7f8e80d18c17  (/usr/lib/x86_64-linux-gnu/libcmocka.so.0+0x4c17)

Direct leak of 128 byte(s) in 2 object(s) allocated from:
    #0 0x559076b9f9d5 in __interceptor_malloc (/home/ubuntu/vmizar/build/tests/test_cli+0x289d5)
    #1 0x559076c06722 in cJSON_New_Item src/extern/cJSON.c:214
    #2 0x559076c06722 in cJSON_ParseWithOpts src/extern/cJSON.c:1029
    #3 0x559076c06722 in cJSON_Parse src/extern/cJSON.c:1092
    #4 0x559076be78b7 in trn_cli_parse_json src/cli/trn_cli_common.c:29
    #5 0x559076bf4257 in trn_cli_delete_transit_namespace_label_policy_subcmd src/cli/trn_cli_network_policy.c:927
    #6 0x559076bd28ec in test_trn_cli_delete_transit_namespace_label_policy_subcmd src/cli/test/test_cli.c:2937
    #7 0x7f8e80d18c17  (/usr/lib/x86_64-linux-gnu/libcmocka.so.0+0x4c17)

...
@vinaykul vinaykul added bug Something isn't working area/networkPolicy labels Jun 1, 2021
@vinaykul
Copy link
Member Author

vinaykul commented Jun 1, 2021

This issue is dup of #465.

@vinaykul vinaykul closed this as completed Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networkPolicy bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants