fix(rtmp): avoid segfault on connection-refused teardown

Track libavformat RTMP session initialization state so teardown only writes a trailer after the muxer header succeeds. This avoids calling av_write_trailer() on partially initialized sessions when avio_open2() fails with Connection refused.

Add a fault-suite regression for libavformat RTMP connection refusal and update the summary helper to compute all_pass from the actual manifest size instead of a hardcoded seven-row expectation.

Verified by rebuilding cvmmap_streamer and rtmp_output_tester, reproducing the refused-connection path without a crash, and running ./scripts/fault_suite.sh successfully (8/8).
This commit is contained in:
2026-04-14 10:21:04 +08:00
parent b277ed363f
commit 30cd956c5c
3 changed files with 26 additions and 4 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ def build_summary(args: CliArgs) -> dict[str, object]:
pass_count = sum(1 for row in rows if row["status"] == "PASS")
fail_count = sum(1 for row in rows if row["status"] == "FAIL")
skip_count = sum(1 for row in rows if row["status"] == "SKIP")
all_pass = len(rows) == 7 and pass_count == 7 and fail_count == 0 and skip_count == 0
all_pass = len(rows) > 0 and pass_count == len(rows) and fail_count == 0 and skip_count == 0
return {
"run_id": args.run_id,