Skip to content

os/exec: TestNohup fails inside tmux #5135

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

Closed
petar opened this issue Mar 27, 2013 · 20 comments
Closed

os/exec: TestNohup fails inside tmux #5135

petar opened this issue Mar 27, 2013 · 20 comments
Milestone

Comments

@petar
Copy link
Contributor

petar commented Mar 27, 2013

darwin
amd64
08d20469cc20 tip


When running ./all.bash inside a tmux session, one of the tests fails.

When running it from the "normal" console (in Terminal), it passes fine.
@davecheney
Copy link
Contributor

Comment 1:

Please provide some additional details, eg, which test fails, and its output when
failing.

Status changed to WaitingForReply.

@petar
Copy link
Contributor Author

petar commented Mar 27, 2013

Comment 2:

Oh, apologies, forgot. Here is the tail of the ./all.bash print out:
ok      net/http/httptest       0.035s
ok      net/http/httputil       0.036s
?       net/http/pprof  [no test files]
ok      net/mail        0.020s
ok      net/rpc 0.062s
ok      net/rpc/jsonrpc 0.039s
ok      net/smtp        0.030s
ok      net/textproto   0.029s
ok      net/url 0.033s
ok      os      0.058s
ok      os/exec 0.609s
--- FAIL: TestNohup-10 (0.13 seconds)
        signal_test.go:205: ran test with -send_uncaught_sighup=1
under nohup and it failed: expected success.
                Error: exit status 127
                Output:
                nohup: can't detach from console: Inappropriate ioctl for device
FAIL
FAIL    os/signal       0.323s
ok      os/user 0.024s
ok      path    0.018s
ok      path/filepath   0.508s
ok      reflect 0.045s
ok      regexp  0.106s
ok      regexp/syntax   0.648s
ok      runtime 3.126s
?       runtime/cgo     [no test files]
ok      runtime/debug   0.026s
ok      runtime/pprof   0.340s
ok      sort    0.066s
ok      strconv 0.345s
ok      strings 0.126s
ok      sync    0.070s
ok      sync/atomic     0.029s
ok      syscall 0.044s
?       testing [no test files]
?       testing/iotest  [no test files]
ok      testing/quick   0.035s
ok      text/scanner    0.021s
ok      text/tabwriter  0.021s
ok      text/template   0.045s
ok      text/template/parse     0.024s
ok      time    2.354s
ok      unicode 0.021s
ok      unicode/utf16   0.021s
ok      unicode/utf8    0.019s
?       unsafe  [no test files]

@davecheney
Copy link
Contributor

Comment 3:

Thanks for the additional detail. I think there is a known issue with SIGHUP, or at
least who owns it. This issue may be a duplicate of an existing one, i'll let someone
else decide.

Status changed to Accepted.

@balasanjay
Copy link
Contributor

Comment 4:

I also saw this failure, but I accidentally found a solution when fixing another tmux
issue.
Try using https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
That fixed it for me (I think its some OSX weirdness, but didn't investigate in detail).

@davecheney
Copy link
Contributor

Comment 5:

I've had confirmations of this bug, again tmux and osx. The workaround is clear, don't
build go inside tmux.

Labels changed: added priority-later, removed priority-triage.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 7:

Labels changed: added go1.2maybe.

@robpike
Copy link
Contributor

robpike commented Aug 20, 2013

Comment 8:

Deferring to 1.3. A peculiarity of the execution environment.

Labels changed: added go1.3maybe, removed go1.2maybe.

@robpike
Copy link
Contributor

robpike commented Aug 20, 2013

Comment 9:

Labels changed: removed go1.3maybe.

@minux
Copy link
Member

minux commented Sep 11, 2013

Comment 10:

when trying to restoring the netbsd-386 builder, i also encountered this issue,
so it's not a OS X specific issue.
http://build.golang.org/log/d64e9b65e5e39f47982df8dfc28f2f25fa270813
i think we should fix it before we release Go 1.2 so that it could be tested on
all supported platforms. Opinions?

@minux
Copy link
Member

minux commented Oct 5, 2013

Comment 11:

update: running all.bash inside screen(1) is ok.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 12:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 13:

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

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 14:

Labels changed: added repo-main.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@jacobsa
Copy link
Contributor

jacobsa commented Aug 24, 2015

FWIW, this still happens to me when attempting to build Go 1.5 in tmux 2.0 on OS X 10.10.5. Does anybody understand exactly what's going on?

@ianlancetaylor
Copy link
Contributor

I wouldn't say I know exactly what's going on, but the broad details seem clear enough: you can't run /usr/bin/nohup on a tmux. If you do, it will fail with the inappropriate ioctl error message. You should be able to create this yourself in a tmux: "/usr/bin/nohup ls".

What we should do in Go is recognize that error message and, if we see it, skip the test rather than failing it. I don't use Darwin so I can't recreate the problem myself (tmux on GNU/Linux works fine), but it ought to be an easy fix for anyone who can.

@davecheney
Copy link
Contributor

Googling results are inconclusive

http://thread.gmane.org/gmane.comp.terminal-emulators.tmux.user/4450

It seems that nobody really cares about this use case on darwin, well, from
the tmux side at least.

Tmux makes itself known with env vars, perhaps I can skip the test if we
see those env vars.

On Tue, Aug 25, 2015 at 3:24 AM, Ian Lance Taylor [email protected]
wrote:

I wouldn't say I know exactly what's going on, but the broad details seem
clear enough: you can't run /usr/bin/nohup on a tmux. If you do, it will
fail with the inappropriate ioctl error message. You should be able to
create this yourself in a tmux: "/usr/bin/nohup ls".

What we should do in Go is recognize that error message and, if we see it,
skip the test rather than failing it. I don't use Darwin so I can't
recreate the problem myself (tmux on GNU/Linux works fine), but it ought to
be an easy fix for anyone who can.


Reply to this email directly or view it on GitHub
#5135 (comment).

@jacobsa
Copy link
Contributor

jacobsa commented Aug 24, 2015

@davecheney: Are you looking at this further? If not, I'll send a CL.

@davecheney
Copy link
Contributor

I am not actively looking at this at the moment.

On Tue, 25 Aug 2015 08:25 Aaron Jacobs [email protected] wrote:

@davecheney https://github.com/davecheney: Are you looking at this
further? If not, I'll send a CL.


Reply to this email directly or view it on GitHub
#5135 (comment).

@jacobsa
Copy link
Contributor

jacobsa commented Aug 24, 2015

Okay, I'll prepare a CL.

For the record, the issue is misnamed: the failing test is in os/signal.

@gopherbot
Copy link
Contributor

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

@mikioh mikioh modified the milestones: Go1.6, Unplanned Aug 25, 2015
@golang golang locked and limited conversation to collaborators Aug 24, 2016
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

10 participants