bryancall commented on code in PR #13029:
URL: https://github.com/apache/trafficserver/pull/13029#discussion_r2999130560
##########
ci/asan_leak_suppression/unit_tests.txt:
##########
@@ -1,10 +1,4 @@
-# leaks in test_X509HostnameValidator
-leak:libcrypto.so.1.1
-# for OpenSSL 1.0.2:
-leak:CRYPTO_malloc
-leak:CRYPTO_realloc
-leak:ConsCell
-# PR#10295
-leak:pcre_jit_stack_alloc
-# PR#10541
+# marshal_hdr in test_http_hdr_print_and_copy_aux is intentionally
+# not destroyed because it holds a reference to a stack-allocated
+# TestRefCountObj whose free() override calls exit(1).
leak:test_http_hdr_print_and_copy_aux
Review Comment:
Interesting idea, but the `marshal_hdr` lifecycle is intentional —
`create()` is needed to set up the internal structures before the
marshal/unmarshal roundtrip test. The suppression documents that `marshal_hdr`
is deliberately not destroyed because its `free()` override calls `exit(1)`.
This is a pre-existing test design constraint, not something introduced by this
PR.
##########
src/proxy/hdrs/unit_tests/test_Hdrs.cc:
##########
@@ -438,6 +442,9 @@ test_http_hdr_print_and_copy_aux(int testnum, const char
*request, const char *r
if ((prt_ret != 1) || (cpy_ret != 1)) {
std::printf("FAILED: (test #%d) couldn't print req hdr or copy ---
prt_ret=%d, cpy_ret=%d\n", testnum, prt_ret, cpy_ret);
+ hdr.destroy();
+ new_hdr.destroy();
+
Review Comment:
Valid style suggestion. The manual `destroy()` calls match the existing
pattern in the test file. An RAII guard would be cleaner but is a broader
refactor of the test — keeping it consistent with the surrounding code for now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]