Navigation Menu

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

internal/poll: TestSplicePipePool failures on linux-386 with one leaked descriptor #48968

Closed
bcmills opened this issue Oct 14, 2021 · 7 comments
Labels
arch-386 Issues solely affecting the 32-bit x86 architecture FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Oct 14, 2021

greplogs --dashboard -md -l -e 'FAIL: TestSplicePipePool' --since=2021-09-18

2021-10-14T13:09:28-24e798e/linux-386-jessie
2021-10-14T07:19:29-2feb2cc/linux-386-buster
2021-10-12T21:30:45-3283d1a/linux-386-sid
2021-09-28T15:20:55-02d56a1/linux-386-buster

These failures all feature a single leaked descriptor — and it always the first one in the list.

--- FAIL: TestSplicePipePool (161.76s)
    splice_linux_test.go:86: all descriptors: [8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134]
    splice_linux_test.go:87: leaked descriptors: [8]
FAIL
FAIL	internal/poll	162.064s

@panjf2000, @ianlancetaylor: any ideas?

@bcmills bcmills added arch-386 Issues solely affecting the 32-bit x86 architecture NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Oct 14, 2021
@bcmills bcmills modified the milestones: Backlog, Go1.18 Oct 14, 2021
@panjf2000
Copy link
Member

panjf2000 commented Oct 15, 2021

As far as I can recall, this happened after this commit and only the first fd was in that list of leaked descriptors, see #48066 (comment)

@panjf2000
Copy link
Member

panjf2000 commented Oct 15, 2021

It seems the root cause is more like finalizer not executing than fd being reused.

@ianlancetaylor
Copy link
Contributor

Finalizers aren't reliable on values smaller than runtime.tinySize == 16 if those values do not contain any pointers. The type on which the finalizer is being set is splicePipe which is three values of type int. So on a 32-bit platform this type can be allocated using the tiny allocator, and a finalizer may not run if the other four bytes of that tiny allocation remain allocated. This is not an issue on 64-bit systems as there the size of splicePIpe is 24 which is too large for the tiny allocator.

So I think the test is pointing out an actual bug: in some unusual circumstances the pipe descriptor may not be released.

@gopherbot
Copy link

Change https://golang.org/cl/358114 mentions this issue: internal/poll: avoid tiny allocator for splicePipe

@gopherbot
Copy link

Change https://golang.org/cl/358734 mentions this issue: internal/poll: improve the padding calculation inside struct splicePipe

gopherbot pushed a commit that referenced this issue Oct 27, 2021
Updates #48968 and CL 358114

Change-Id: Ic68b4c5420c1c32f78b56874b53d717fa9af1f74
Reviewed-on: https://go-review.googlesource.com/c/go/+/358734
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
@gopherbot
Copy link

Change https://golang.org/cl/378034 mentions this issue: runtime: eliminate arbitrary timeout in TestStackGrowth

@golang golang locked and limited conversation to collaborators Jan 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-386 Issues solely affecting the 32-bit x86 architecture FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants