Page MenuHomeFreeBSD

tests/tcp_hpts_test: Fix more resource leaks
ClosedPublic

Authored by markj on May 11 2026, 2:09 PM.
Tags
None
Referenced Files
F160534976: D56943.id177584.diff
Thu, Jun 25, 10:40 AM
F160516196: D56943.diff
Thu, Jun 25, 7:04 AM
Unknown Object (File)
Sat, Jun 20, 2:31 PM
Unknown Object (File)
Sat, Jun 20, 7:53 AM
Unknown Object (File)
Wed, Jun 17, 9:53 AM
Unknown Object (File)
Fri, Jun 12, 1:34 PM
Unknown Object (File)
Sun, Jun 7, 6:39 AM
Unknown Object (File)
Fri, Jun 5, 6:55 AM

Details

Summary

Address leaks that I missed in commit f7bf9fd6199c
("tests/tcp_hpts_test: Fix resource leaks").

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.May 11 2026, 2:09 PM

It looks like your main goal is to just clean up the lock? A more complete solution would need to run the cleanup stuff around test_hpts_free_tcpcb, right? I'm fine you prefer that be done in a follow up PR though.

BTW, does the fact that you are finding this problem mean this test case is failing for you somehow?

This revision is now accepted and ready to land.May 11 2026, 2:18 PM

It looks like your main goal is to just clean up the lock? A more complete solution would need to run the cleanup stuff around test_hpts_free_tcpcb, right? I'm fine you prefer that be done in a follow up PR though.

Yeah, the immediately problem is that I occasionally get a kernel panic since witness detects that a thread returned to usermode while still holding a lock. Kernel panics during a test run are rather disruptive, so fixing that is my main goal.

BTW, does the fact that you are finding this problem mean this test case is failing for you somehow?

Very occasionally, it seems so. I haven't really dug into the failures: I run the test suite in parallel and that tends to cause some flakiness in timing-dependent tests. As a workaround I will re-run failed tests serially after the main test run, but I'm also trying to fix flaky tests when I have time.

Do more cleanup after a failure.

This revision now requires review to proceed.May 11 2026, 2:42 PM

Do more cleanup after a failure.

Eh, well, now I realize that the other KTEST macros don't handle this cleanup of the tcpcb etc., so it's kind of strange to do that in the _GOTO case.

Go back to just unlocking in the error path.

This revision is now accepted and ready to land.May 11 2026, 2:51 PM
This revision was automatically updated to reflect the committed changes.