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

os/exec: fd leak on Plan 9 #7118

Closed
0intro opened this issue Jan 13, 2014 · 11 comments
Closed

os/exec: fd leak on Plan 9 #7118

0intro opened this issue Jan 13, 2014 · 11 comments

Comments

@0intro
Copy link
Member

0intro commented Jan 13, 2014

What steps will reproduce the problem?

Run tests for os/exec.

What is the expected output? What do you see instead?

The TestExtraFiles test is failing because of leaked file descriptors.

cpu% cd src/pkg/os/exec; go test
--- FAIL: TestExtraFiles (0.20 seconds)
    exec_test.go:234: TestExtraFiles: Something already leaked - closed fd 11
    exec_test.go:407: Run: exit status: 'exec.test 1454466: 1'; stdout "leaked parent file. fd = 12; want 11\n", stderr ""
FAIL
exit status: 'exec.test 1454437: 1'
FAIL    os/exec 1.364s

We can observe the following open file descriptors:

  0 r  c    0 (000000000000000a   0 00)     0        0 /dev/null\n
  1 rw |    0 (0000000001df6742   0 00) 65536       54 #|/data1\n
  2 rw |    0 (0000000001df6782   0 00) 65536        0 #|/data1
  3 rw M 1956 (0000000000d66dd2   0 00)  8192       12 /tmp/333163398
  4 r  c    0 (0000000000000001   0 00)     0      528 /dev/bintime
  5 r  M 1956 (0000000000d66dd1 854 00)  8192        0 /tmp/go-build843954301/os/exec/_test/exec.test
  6 r  M 1956 (0000000000d66dd1 854 00)  8192        0 /tmp/go-build843954301/os/exec/_test/exec.test
  7 r  M 1956 (0000000000d66dd1 854 00)  8192        0 /tmp/go-build843954301/os/exec/_test/exec.test
  8 r  M 1956 (0000000000d66dd1 854 00)  8192        0 /tmp/go-build843954301/os/exec/_test/exec.test
  9 r  M 1956 (0000000000d66dd1 854 00)  8192        0 /tmp/go-build843954301/os/exec/_test/exec.test
 10 r  M 1956 (0000000000d66dd1 854 00)  8192        0 /tmp/go-build843954301/os/exec/_test/exec.test
 11 r  c    0 (000000000000000f   0 00)     0       32 /dev/random
 12 r  M 1956 (0000000000d66dd1 854 00)  8192        0 /tmp/go-build843954301/os/exec/_test/exec.test
 13 r  c    0 (000000000000000a   0 00)     0        0 /dev/null
 14 rw |    0 (0000000001df6801   0 00) 65536        0 #|/data
 15 rw |    0 (0000000001df6802   0 00) 65536     1275 #|/data1
@ality
Copy link
Member

ality commented Jan 31, 2014

Comment 2:

CL is here https://golang.org/cl/57890043/
Please try to break it.

Owner changed to @ality.

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Mar 3, 2014

Comment 3:

Labels changed: added release-go1.3.

@gopherbot
Copy link

Comment 4:

CL https://golang.org/cl/57890043 references this issue.

@bradfitz
Copy link
Contributor

Comment 5:

Labels changed: added os-plan9.

@0intro
Copy link
Member Author

0intro commented Apr 14, 2014

Comment 6:

Labels changed: added release-go1.3maybe, removed release-go1.3.

@bradfitz
Copy link
Contributor

Comment 7:

Labels changed: removed release-go1.3maybe.

@rsc
Copy link
Contributor

rsc commented May 21, 2014

Comment 8:

Labels changed: added release-none.

@griesemer
Copy link
Contributor

Comment 9:

Labels changed: added repo-main.

@rsc rsc removed the os-plan9 label Apr 10, 2015
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@0intro 0intro self-assigned this Jul 30, 2015
@0intro 0intro closed this as completed Jul 30, 2015
@gopherbot
Copy link

CL https://golang.org/cl/22610 mentions this issue.

@0intro
Copy link
Member Author

0intro commented Apr 29, 2016

Reopening this issue, since TestExtraFiles is still failing when removing the Plan 9 case in TestHelperProcess.

--- FAIL: TestExtraFiles (0.09s)
    exec_test.go:316: TestExtraFiles: Something already leaked - closed fd 11
    exec_test.go:495: Run: exit status: exec.test 800213: 1; stdout "leaked parent file. fd = 12; want 11
/usr/go/src/os/exec
  0 r  c    0 (000000000000000a    0 00)     0        0 /dev/null
  1 rw |    0 (0000000000feb302    0 00) 65536       37 #|/data1
  2 rw |    0 (0000000000feb342    0 00) 65536        0 #|/data1
  3 rw M   97 (0000000000e11911    1 00)  8192       12 /tmp/013433297
  4 r  M   97 (0000000000e118d9 1063 00)  8192        0 /tmp/go-build521049277/os/exec/_test/exec.test
  5 r  M   97 (0000000000e118d9 1063 00)  8192        0 /tmp/go-build521049277/os/exec/_test/exec.test
  6 r  M   97 (0000000000e118d9 1063 00)  8192        0 /tmp/go-build521049277/os/exec/_test/exec.test
  7 r  M   97 (0000000000e118d9 1063 00)  8192        0 /tmp/go-build521049277/os/exec/_test/exec.test
  8 r  M   97 (0000000000e118d9 1063 00)  8192        0 /tmp/go-build521049277/os/exec/_test/exec.test
  9 r  M   97 (0000000000e118d9 1063 00)  8192        0 /tmp/go-build521049277/os/exec/_test/exec.test
 10 r  M   97 (0000000000e118d9 1063 00)  8192        0 /tmp/go-build521049277/os/exec/_test/exec.test
 11 r  c    0 (000000000000000f    0 00)     0       32 /dev/random
 12 r  M   97 (0000000000e118d9 1063 00)  8192        0 /tmp/go-build521049277/os/exec/_test/exec.test
 13 r  c    0 (000000000000000a    0 00)     0        0 /dev/null
 14 rw |    0 (0000000000feb3c1    0 00) 65536        0 #|/data
 15 rw |    0 (0000000000feb3c2    0 00) 65536     1275 #|/data1
", stderr ""
FAIL
FAIL    os/exec 1.051s

@0intro 0intro reopened this Apr 29, 2016
@gopherbot
Copy link

CL https://golang.org/cl/22640 mentions this issue.

gopherbot pushed a commit that referenced this issue May 5, 2016
This test should now succeed after CL 22610 which fixes issue #7118

Change-Id: Ie785a84d77b27c832a1ddd81699bf25dab24b97d
Reviewed-on: https://go-review.googlesource.com/22640
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David du Colombier <0intro@gmail.com>
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@0intro 0intro closed this as completed Oct 20, 2016
@golang golang locked and limited conversation to collaborators Oct 20, 2017
@rsc rsc unassigned 0intro Jun 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants