Repository navigation
fix(test): close the RTMP connection in test_rtmp_send_batch (#3401) - #3404
Merged
Merged
Conversation
send_one() freed its RTMP with RTMP_Free() only, which leaves the channel packets RTMP_SendPacket() keeps in m_vecChannelsOut; RTMP_Close() frees them, as rtmp-stream does when it disconnects. send_one() now calls RTMP_Close() first; the socket is already -1, so it sends nothing. 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 512 bytes in 4 blocks definitely lost (176 per case with the indirect block); after, exit 0, 0 bytes lost, 4/4 cases pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=84f23240b76e648daf751deffe44f7b8fa0f66d5 secs=239 lanes=lint:run,rust-test:reused@f6a51ff59ea6,cross:reused@922d0d3a5030,tier2-linux:run,macos-native:n/a,windows-native:n/a Ci-Attestation: {"at":1793525431,"gate":"rust/all/fmt","host":"linux-x86_64","key":"ea9e88fdc44efe3c4a1acebd858c1fde3d1a46a2c0ae40f965384e9fd6eb781b","lane":"lint","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":39,"stamp":"a4d4cabbcff11107330300efa58e236a","tree":"84f23240b76e648daf751deffe44f7b8fa0f66d5","v":1,"via":"run"} Ci-Attestation: {"at":1793525431,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"ea9e88fdc44efe3c4a1acebd858c1fde3d1a46a2c0ae40f965384e9fd6eb781b","lane":"lint","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":39,"stamp":"8bc5fc7fb7344c14af07c343fd639156","tree":"84f23240b76e648daf751deffe44f7b8fa0f66d5","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":null,"stamp":"79762eb4e6a1e77aa39cf055385957a2","tree":"84f23240b76e648daf751deffe44f7b8fa0f66d5","v":1,"via":"reused"} Ci-Attestation: {"at":1793525191,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"922d0d3a50308d6bf15bbae51960b31b237342437e9b096ee35f3b164605a246","lane":"cross","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":null,"stamp":"5cda0a85fb72f83908ff5cf28308e3ba","tree":"84f23240b76e648daf751deffe44f7b8fa0f66d5","v":1,"via":"reused"} Ci-Attestation: {"at":1793525191,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"922d0d3a50308d6bf15bbae51960b31b237342437e9b096ee35f3b164605a246","lane":"cross","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":null,"stamp":"d3f11248ab3cb444b5a499b91411fda1","tree":"84f23240b76e648daf751deffe44f7b8fa0f66d5","v":1,"via":"reused"} Ci-Attestation: {"at":1793525191,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"922d0d3a50308d6bf15bbae51960b31b237342437e9b096ee35f3b164605a246","lane":"cross","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":null,"stamp":"5a25c3ef637cb76557399b4c175f2328","tree":"84f23240b76e648daf751deffe44f7b8fa0f66d5","v":1,"via":"reused"} Ci-Attestation: {"at":1793525191,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"922d0d3a50308d6bf15bbae51960b31b237342437e9b096ee35f3b164605a246","lane":"cross","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":null,"stamp":"494c7b239f4fe4865bfcc3070f563dba","tree":"84f23240b76e648daf751deffe44f7b8fa0f66d5","v":1,"via":"reused"} Ci-Attestation: {"at":1793525431,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"6a0084cc175065578c0a4f55a3654be5f527daa422c9d49c3e98a58e1b5818bd","lane":"tier2-linux","parents":["44c1d782f649db2fb01b632efed1cfd1e8617a04"],"secs":238,"stamp":"2db0c2b2de5f9c8a9da12450e1b26f45","tree":"84f23240b76e648daf751deffe44f7b8fa0f66d5","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 #3401. Refs #3375, #3290.
Why
test_rtmp_send_batchleaks the channel packets thatRTMP_SendPacket()keeps (4 × 176 bytes): the test callsRTMP_Free()withoutRTMP_Close(), which frees them. The asan job reports the leak, and with #3290 that report fails the job.What changes
send_one()callsRTMP_Close()beforeRTMP_Free(); the socket is already -1, so it sends nothing. 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