[hipDNN] Fix memory leak in Knob::UnPack during EngineDescriptor::finalize#4903
Open
BrianHarrisonAMD wants to merge 1 commit intodevelopfrom
Open
[hipDNN] Fix memory leak in Knob::UnPack during EngineDescriptor::finalize#4903BrianHarrisonAMD wants to merge 1 commit intodevelopfrom
BrianHarrisonAMD wants to merge 1 commit intodevelopfrom
Conversation
…lize Use stack-allocated KnobT with UnPackTo() instead of heap-allocated raw pointer from UnPack() to avoid leaking the intermediate native object during knob re-serialization. Closes #4901 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mousdahl-amd
approved these changes
Feb 25, 2026
Contributor
Author
|
auto-merge enabled |
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (76.83%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #4903 +/- ##
========================================
Coverage 65.96% 65.96%
========================================
Files 1720 1720
Lines 267465 267466 +1
Branches 37091 37091
========================================
+ Hits 176410 176416 +6
+ Misses 75488 75484 -4
+ Partials 15567 15566 -1
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hipdnn_backend_testsKnob::UnPack()with stack-allocatedKnobTusingUnPackTo(), eliminating the leak during knob re-serialization inEngineDescriptor::finalize()Details
UnPack()returns a raw owningKnobT*pointer. The old code passed this directly toKnob::Pack()as a temporary, so the pointer was never freed. The fix usesUnPackTo()to populate a stack-allocatedKnobT, which is automatically cleaned up at end of scope.Closes #4901
Test plan
-DBUILD_ADDRESS_SANITIZER=ON🤖 Generated with Claude Code