Repository navigation
fix(test): free the packet buffer in test_ffmpeg_mux_write_packet (#3400) - #3403
Merged
Merged
Conversation
) The test's stream never goes through ffmpeg_mux_destroy(), which frees stream->packet_buf, so each case leaked the 64 KiB buffer write_packet() keeps there. run() now frees it after its checks. Test only, no assertion changed. Under valgrind (--leak-check=full --errors-for-leak-kinds=definite) in a valgrind build of master: before, exit 99 with 66,064 bytes in 2 blocks definitely lost; after, exit 0, 0 bytes lost, 3/3 cases pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=877c9847704ef19cb69720bf09423afd2cce3434 secs=242 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run,macos-native:n/a,windows-native:n/a Ci-Attestation: {"at":1793525191,"gate":"rust/all/fmt","host":"linux-x86_64","key":"1673276b7f97a9f7a84efb3847a994e3fe847ca3ea070e7cf02b085b32066612","lane":"lint","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":39,"stamp":"745cabcb327d08db18b16d88778e181e","tree":"877c9847704ef19cb69720bf09423afd2cce3434","v":1,"via":"run"} Ci-Attestation: {"at":1793525191,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"1673276b7f97a9f7a84efb3847a994e3fe847ca3ea070e7cf02b085b32066612","lane":"lint","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":39,"stamp":"5920e26dcb6906ad6b517bdb6dba5bc4","tree":"877c9847704ef19cb69720bf09423afd2cce3434","v":1,"via":"run"} Ci-Attestation: {"at":1793525191,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"f6a51ff59ea655cee62299a17270a864c99d2a49b5ff83aa6f33cddff28e31e1","lane":"rust-test","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":83,"stamp":"6410112b3a5abce9ed3099e339f42f5f","tree":"877c9847704ef19cb69720bf09423afd2cce3434","v":1,"via":"run"} Ci-Attestation: {"at":1793525191,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"922d0d3a50308d6bf15bbae51960b31b237342437e9b096ee35f3b164605a246","lane":"cross","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":24,"stamp":"a7e0277862e60d3ca70fcaae7299ef04","tree":"877c9847704ef19cb69720bf09423afd2cce3434","v":1,"via":"run"} Ci-Attestation: {"at":1793525191,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"922d0d3a50308d6bf15bbae51960b31b237342437e9b096ee35f3b164605a246","lane":"cross","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":24,"stamp":"3a1b23d26421c8265e6e3a4f234dd3a1","tree":"877c9847704ef19cb69720bf09423afd2cce3434","v":1,"via":"run"} Ci-Attestation: {"at":1793525191,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"922d0d3a50308d6bf15bbae51960b31b237342437e9b096ee35f3b164605a246","lane":"cross","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":24,"stamp":"9834d7c580f843e03fb7b084d4d26db2","tree":"877c9847704ef19cb69720bf09423afd2cce3434","v":1,"via":"run"} Ci-Attestation: {"at":1793525191,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"922d0d3a50308d6bf15bbae51960b31b237342437e9b096ee35f3b164605a246","lane":"cross","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":24,"stamp":"dfd18553fdce630623b9f413bb7863bf","tree":"877c9847704ef19cb69720bf09423afd2cce3434","v":1,"via":"run"} Ci-Attestation: {"at":1793525191,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"07ee8b25327b97fdf8242b9a2b3cd3895c01593c51bb0a494a8a7119ed194241","lane":"tier2-linux","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":242,"stamp":"fd85e034c885a59e6f796523ceb4fdd6","tree":"877c9847704ef19cb69720bf09423afd2cce3434","v":1,"via":"run"}
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.
Fixes #3400. Refs #3361, #3290.
Why
test_ffmpeg_mux_write_packetleaksstream.packet_buf(66,064 bytes): its stream never goes throughffmpeg_mux_destroy(), which frees the buffer. The asan job reports the leak, and with #3290 that report fails the job.What changes
run()freesstream.packet_bufafter its checks. Test only; no change to OBS, no assertion changed.Tests
The test under valgrind (
--errors-for-leak-kinds=definite --leak-check=full, the sanitizer harness's flags) in a valgrind build of master:This is a one-line test fix, so RED is the local evidence above, not a separate commit.
Checklist
master🤖 Generated with Claude Code