Page MenuHomeFreeBSD

tests/tcp_hpts_test: Fix more resource leaks
ClosedPublic

Authored by markj on Mon, May 11, 2:09 PM.
Tags
None
Referenced Files
F157426520: D56943.diff
Thu, May 21, 7:58 AM
Unknown Object (File)
Wed, May 20, 1:57 AM
Unknown Object (File)
Tue, May 19, 1:53 AM
Unknown Object (File)
Mon, May 18, 7:49 PM
Unknown Object (File)
Mon, May 18, 3:23 PM
Unknown Object (File)
Mon, May 18, 1:01 AM
Unknown Object (File)
Sun, May 17, 8:17 PM
Unknown Object (File)
Sat, May 16, 10:39 PM

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.Mon, May 11, 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.Mon, May 11, 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.Mon, May 11, 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.Mon, May 11, 2:51 PM
This revision was automatically updated to reflect the committed changes.