-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: TestSplice/big can lead to "out of memory" panics #26867
Comments
cc @mikioh @bradfitz @ianlancetaylor as per the owners doc. Also cc @acln0, who I believe added the code and tests in question. |
Sorry for the trouble. Perhaps go/src/internal/poll/splice_linux.go Lines 17 to 19 in 24fb2e0
TestSplice/big is just to check that things work correctly if poll.Splice needs to call splice(2) more than once. With this change, perhaps the testing.Short() condition, that makes the size of the test smaller, can also be dropped. It's probably not very useful after all.
|
I would have sent a CL with the fix myself, but I'm currently on vacation, and I don't have my work machine with me. Sorry. |
No worries; thanks for the quick reply! I'll send a CL after lunch :) |
Change https://golang.org/cl/128535 mentions this issue: |
If I do
go test -v net
, I can see:I presume that
TestSplice/big
is the culprit, as it seems to be the test that allocates the most memory by far. I realise that it's the purpose of the test, but I still think this test shouldn't fail if one doesn't have enough memory available.I realise that in this scenario I only have about 4GB of available memory, but that still seems to me like it should be plenty to be able to run
go test std
. In fact, I encountered this crash while running that command with about 6GB of available memory (to reproduce with justgo test net
, I started using more memory to save time).I wonder what would be the best way to keep the test working as it is on systems with more memory, while keeping it from crashing the runtime on systems with less memory. Even if we had a way to check the available memory at the start of the test, that still isn't a guarantee that we won't crash the runtime.
There's always the option of saying "at least 8GB of available memory is required to run
go test std
". But hopefully that required minimum would be much lower - 8GB of physical memory is still common, even in fairly new laptops out there.The text was updated successfully, but these errors were encountered: