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

Fix memory leak in the new hashtable unittest #1421

Merged

Conversation

enjoy-binbin
Copy link
Member

There is a leak in here, hashtableTwoPhasePopDelete won't call the entry destructor and like hashtablePop we need to call it by myself.

There is a leak in here, hashtableTwoPhasePopDelete won't
call the entry destructor and like hashtablePop we need to
call it by myself.

Signed-off-by: Binbin <[email protected]>
@enjoy-binbin
Copy link
Member Author

https://github.com/valkey-io/valkey/actions/runs/12267010712/job/34226298525#step:10:431 leak:

==73624==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 3033 byte(s) in 200 object(s) allocated from:
    #0 0x7ff5688b4887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x55f3c8fb055a in create_keyval unit/test_hashtable.c:36
    #2 0x55f3c8fb055a in test_two_phase_insert_and_pop unit/test_hashtable.c:273
    #3 0x55f3c8feda08 in runTestSuite unit/test_main.c:26
    #4 0x55f3c8f981a1 in main unit/test_main.c:61
    #5 0x7ff568[429](https://github.com/valkey-io/valkey/actions/runs/12267010712/job/34226296249#step:10:430)d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.90%. Comparing base (3eb8314) to head (0cc6d8c).
Report is 1 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1421      +/-   ##
============================================
+ Coverage     70.88%   70.90%   +0.01%     
============================================
  Files           119      119              
  Lines         64652    64652              
============================================
+ Hits          45831    45843      +12     
+ Misses        18821    18809      -12     

see 11 files with indirect coverage changes

Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@zuiderkwast zuiderkwast merged commit 1acf7f7 into valkey-io:unstable Dec 11, 2024
48 checks passed
@enjoy-binbin enjoy-binbin deleted the fix_memory_leak_warning branch December 11, 2024 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants