Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Torture test failures #12834

Closed
dfandrich opened this issue Feb 1, 2024 · 5 comments
Closed

Torture test failures #12834

dfandrich opened this issue Feb 1, 2024 · 5 comments
Labels

Comments

@dfandrich
Copy link
Contributor

I did this

I ran a full set of torture tests (instead of a shallow one) and found that the following test showed failures:

20 241 356 412 413 507 534 1060 1061 1083 1084 1085 1553 1557 1592 1632 1908

More than half of these failed when the strdup() at asyn-thread.c:627 errored out, so there may not be that many root causes to these failures.

I expected the following

No torture test failures.

curl/libcurl version

curl 8.6.0

operating system

Linux x86_64

@dfandrich
Copy link
Contributor Author

W.r.t. the asyn-thread failures (e.g. 241), this failure is reported as a close-without-open of a FD, but it might be a false positive. The failure occurs in a HAVE_PIPE build which means that instead of a socketpair, a pipe is opened at asyn-thread.c:254; however, it's closed in this error path using sclose at asyn-thread.c:584. sclose is replaced by the memdebug subsystem and seen by it but pipe is not, so it appears to the leak checker like a close without an open.

Building with HAVE_PIPE means it creates a socketpair instead of a pipe, except that socketpair is also not tracked by the memory tracker so once again it sees a close without an open.

I don't know how this ever passed the leak checker. Every test using the resolver ought to error out here.

On a related not, I don't think the sclose() at asyn-thread.c:584 is right; I think it should be wakeup_close. Although, that won't fix the torture test because it seems to be a limitation fo the leak checker.

@bagder bagder added the tests label Feb 1, 2024
@bagder
Copy link
Member

bagder commented Feb 1, 2024

I don't know how this ever passed the leak checker

Because we used to disable the memory tracking with the threaded resolver due to problems with the logging from multiple threads. I'm not entirely sure those problems are gone now.

@bagder
Copy link
Member

bagder commented Feb 1, 2024

When I re-run this torture test failure on test 20 with valgrind enabled, valgrind says nothing. This might hint that the problem is rather with the logging itself.

@bagder
Copy link
Member

bagder commented Feb 1, 2024

Combine this with CURLOPT_QUICK_EXIT set. It allows leaks on exit, which is probably the biggest explanation here. We need to avoid setting this option when doing torture tests.

bagder added a commit that referenced this issue Feb 1, 2024
Since it allows (small) memory leaks that interfere with torture tests
and regular memory-leak checks.

Reported-by: Dan Fandrich
Fixes #12834
bagder added a commit that referenced this issue Feb 1, 2024
@bagder bagder closed this as completed in 2f3e7a2 Feb 1, 2024
bagder added a commit that referenced this issue Feb 1, 2024
@dfandrich
Copy link
Contributor Author

Torture tests are all succeeding for me! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants