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

[Bug]: unit test may have mem leak caused by gtest framework #33139

Open
1 task done
zhengbuqian opened this issue May 17, 2024 · 2 comments
Open
1 task done

[Bug]: unit test may have mem leak caused by gtest framework #33139

zhengbuqian opened this issue May 17, 2024 · 2 comments
Assignees
Labels
kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@zhengbuqian
Copy link
Collaborator

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version: master

Current Behavior

in master branch, always enable asan by modify

from:

    if ( USE_ASAN AND false )
        message( STATUS "Building Milvus using AddressSanitizer")
        add_compile_options(-fno-stack-protector -fno-omit-frame-pointer -fno-var-tracking -fsanitize=address)
        add_link_options(-fno-stack-protector -fno-omit-frame-pointer -fno-var-tracking -fsanitize=address)
    endif()

to:

#    if ( USE_ASAN AND false )
        message( STATUS "Building Milvus using AddressSanitizer")
        add_compile_options(-fno-stack-protector -fno-omit-frame-pointer -fno-var-tracking -fsanitize=address)
        add_link_options(-fno-stack-protector -fno-omit-frame-pointer -fno-var-tracking -fsanitize=address)
#    endif()

then make test-cpp to build unit test with asan enabled.

Run ./internal/core/output/unittest/all_tests --gtest_list_tests. NO test will be ran, but after gtest listed all test cases, asan reported memory leak.
img_v3_02av_decff388-4dd6-4cf6-ad94-3a3d950d3fcg

it seems the mem leak is caused by gtest, not our code?

Expected Behavior

No response

Steps To Reproduce

No response

Milvus Log

No response

Anything else?

No response

@zhengbuqian zhengbuqian added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 17, 2024
@zhengbuqian
Copy link
Collaborator Author

or could it be a globally allocated memory?

@PwzXxm
Copy link
Contributor

PwzXxm commented May 20, 2024

Maybe caused by some static test suite initialization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

4 participants