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
net/http: ptrace protections result in hung sendfile test #9711
Comments
cc @bradfitz |
It would help to know more about your system. What OS? What hardware? |
It is a linode host. Hope this helps:
Glad to provide more information that helps. Just tell me the linux command to run. |
Does it consistently fail? Is the machine really low specced? If the machine is just very slow, then tests can timeout sometimes. |
It consistently failed on my machine. I just killed all the background processes that may consume resource and ran it again. The testcase was still timeout. All other cases were finished within 2s. |
I also got this test failing on a Docker container (Ubuntu 12.04) while the test pass outside the container. It fails on tags go1.4 and go1.4.2. http.Get timeouts here: https://github.com/golang/go/blob/release-branch.go1.4/src/net/http/fs_test.go#L822 |
I just had a look and the test fails because strace returns an error: It happens because of a ptrace protection: https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace_Protection Since strace is run asynchronously, the test does not see the error and
I think the second fix is the best one. I can send a CL if needed. |
@alexcesaro, feel free to send a change for Go 1.9 if you're still interested. (two years later...) |
I've tested this on docker to reproduce, and prepared a fix based on the comments by alexcesaro using child.Run(). Skips on permission failure, otherwise runs the test. === RUN TestLinuxSendfile === RUN TestLinuxSendfile |
CL https://golang.org/cl/38633 mentions this issue. |
Change https://golang.org/cl/72170 mentions this issue: |
… permissions If go doesn't have permission to run strace, this test hangs while waiting for strace to run. Instead try invoking strace with Run() first - on fail skip and report error, otherwise run the test normally using strace. Also fix link to open mips64 issue in same test. Fixes #9711 Change-Id: Ibbc5fbb143ea6d0f8b6cfdca4b385ef4c8960b3d Reviewed-on: https://go-review.googlesource.com/38633 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-on: https://go-review.googlesource.com/72170 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
On this revision:
Run
all.bash
, one of the testcases failed:The text was updated successfully, but these errors were encountered: