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

cmd/go: fork/exec /home/rsc/g/go/bin/tool/cgo: text file busy #3001

Closed
rsc opened this issue Feb 12, 2012 · 22 comments
Closed

cmd/go: fork/exec /home/rsc/g/go/bin/tool/cgo: text file busy #3001

rsc opened this issue Feb 12, 2012 · 22 comments
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Feb 12, 2012

On Linux I sometimes get the error 

fork/exec /home/rsc/g/go/bin/tool/cgo: text file busy

when cmd/go tries to build runtime/cgo during all.bash.
I don't know what would cause this.  I didn't know you could
get that error from exec.
@ianlancetaylor
Copy link
Member

Comment 1:

That error from exec means that you are trying to exec a file that some process has open
for write access.

@rsc
Copy link
Contributor Author

rsc commented Feb 14, 2012

Comment 2:

Appears to be fixed by recent build changes, which are more careful about using the
right cgo during cross-compiles.

Status changed to Fixed.

@alberts
Copy link
Contributor

alberts commented Feb 20, 2012

Comment 3:

This just happened again on our linux/amd64 machine with a build of e285ee3ad289.

@robpike
Copy link
Contributor

robpike commented Feb 26, 2012

Comment 4:

Status changed to Accepted.

@robpike
Copy link
Contributor

robpike commented Feb 27, 2012

Comment 5:

Issue #3114 has been merged into this issue.

@alberts
Copy link
Contributor

alberts commented Feb 27, 2012

Comment 6:

Sadly, stracing the build slows it down to the extent that you don't see this problem
anymore.

@minux
Copy link
Member

minux commented Feb 27, 2012

Comment 7:

I think the real reason is: we didn't take cmd/cgo into dependence graph for packages
using cgo.

@rsc
Copy link
Contributor Author

rsc commented Feb 27, 2012

Comment 8:

Yes we do.

@rsc
Copy link
Contributor Author

rsc commented Feb 28, 2012

Comment 9:

I think we may end up with the building of cmd/cgo in the build graph multiple times.
I started on this last night.

Owner changed to @rsc.

Status changed to Started.

@rsc
Copy link
Contributor Author

rsc commented Mar 1, 2012

Comment 10:

This issue was closed by revision b03a5f6.

Status changed to Fixed.

@gopherbot
Copy link
Contributor

Comment 11 by giacomo.tartari:

Hi,
this still happens to me on a rocks cluster (CentOS):
fork/exec /home/giacomo/go/pkg/tool/linux_amd64/cgo: text file busy
Also this during the tests:
ok      old/template    0.020s
ok      os  0.040s
--- FAIL: TestExtraFiles (0.10 seconds)
    exec_test.go:158: Something already leaked - closed fd 3
    exec_test.go:199: CombinedOutput: exit status 1; output "leaked parent file. fd = 12; want 9\n"
FAIL
FAIL    os/exec 0.166s
ok      os/signal   0.005s
ok      os/user 0.006s
Is it the same problem?
$ uname -rsv
Linux 2.6.18-194.17.4.el5 #1 SMP Mon Oct 25 15:50:53 EDT 2010
$ go version
go version weekly.2012-03-04 +f4470a54e6db

@rsc
Copy link
Contributor Author

rsc commented Mar 8, 2012

Comment 12:

Status changed to Accepted.

@gopherbot
Copy link
Contributor

Comment 13 by giacomo.tartari:

some more info on the machine, just in case:
$ cat /proc/version
Linux version 2.6.18-194.17.4.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2
20080704 (Red Hat 4.1.2-48)) #1 SMP Mon Oct 25 15:50:53 EDT 2010
$ cat /etc/issue
CentOS release 5.5 (Final)
Kernel \r on an \m

@rsc
Copy link
Contributor Author

rsc commented Mar 8, 2012

Comment 14:

If you can reproduce this reliably, could you change
the go commands in make.bash and run.bash to say
go install -x and go test -x (add the -x part) and then
run
all.bash 2>&1 | tee all.log
If you can capture a failure, please attach all.log to this
bug report.  I would like to understand why this is happening,
and the -x will include all the commands being run.
Thanks.

@gopherbot
Copy link
Contributor

Comment 15 by giacomo.tartari:

If I missed any -x flags let me know.

Attachments:

  1. all.log (207925 bytes)

@rsc
Copy link
Contributor Author

rsc commented Mar 8, 2012

Comment 16:

Thanks.  The logging looks great but that looks like a log of a successful run.
Can you try to get a log of a failure (with the fork/exec message)?

@gopherbot
Copy link
Contributor

Comment 17 by giacomo.tartari:

That seems to happen randomly. I did a few more builds hg updating back and forth
between tip and weekly and could not reproduce it.
But the os/exec test always failed on this machine.
ok      os  0.019s
--- FAIL: TestExtraFiles (0.10 seconds)
    exec_test.go:158: Something already leaked - closed fd 3
    exec_test.go:158: Something already leaked - closed fd 8
    exec_test.go:158: Something already leaked - closed fd 14
    exec_test.go:158: Something already leaked - closed fd 16
    exec_test.go:199: CombinedOutput: exit status 1; output "leaked parent file. fd = 13; want 10\n"
FAIL
FAIL    os/exec 0.168s
ok      os/signal   0.005s

@rsc
Copy link
Contributor Author

rsc commented Mar 12, 2012

Comment 18:

TestExtraFiles is a different issue.  (Maybe you have a virus checker or some other
thing forcing itself into your program's address space and leaking files?)

@minux
Copy link
Member

minux commented Mar 12, 2012

Comment 19:

I can confirm TestExtraFiles always fail on CentOS 5/RHEL 5, see, for example, a log
here:
http://pastebin.com/xF7cN5Xw

@rsc
Copy link
Contributor Author

rsc commented Mar 12, 2012

Comment 20:

This issue is about cgo.
Please move discussion of TestExtraFiles elsewhere (it's just CentOS
ignoring O_CLOEXEC).

@rsc
Copy link
Contributor Author

rsc commented Mar 16, 2012

Comment 21:

I think I found the problem.  5845044.

Status changed to Started.

@minux
Copy link
Member

minux commented Mar 16, 2012

Comment 22:

This issue was closed by revision a4b2c5e.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
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