Septs
(Septs)
January 23, 2017, 1:37pm
1
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version
)?
go version go1.8beta2 linux/amd64
What operating system and processor architecture are you using (go env
)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/septs/.goenv"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build373922980=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you do?
PoC
see https://play.golang.org/p/23AuanjGHM
What did you expect to see?
fix it
What did you see instead?
func (p *pipe) SetDeadline(t time.Time) error {
return &OpError{Op: "set", Net: "pipe", Source: nil, Addr: nil, Err: errors.New("deadline not supported")}
}
func (p *pipe) SetReadDeadline(t time.Time) error {
return &OpError{Op: "set", Net: "pipe", Source: nil, Addr: nil, Err: errors.New("deadline not supported")}
}
func (p *pipe) SetWriteDeadline(t time.Time) error {
return &OpError{Op: "set", Net: "pipe", Source: nil, Addr: nil, Err: errors.New("deadline not supported")}
}
see https://github.com/golang/go/issues/18750
calmh
(Jakob Borg)
January 23, 2017, 2:12pm
2
Your program panics because you end up with all goroutines blocked on channel operations.
radovskyb
(Benjamin Radovsky)
January 23, 2017, 2:24pm
3
Hey @Septs ,
You haven’t really specified what you are trying to do, so I’m just going to make a guess here.
It seems to me that you aren’t really sure what you are meant to use Hijack
for, so just incase that is what you are finding hard to fix, this might be what you’re trying to do:
https://play.golang.org/p/XP591TJQSE .
Just for the record, you can write regular questions here, It’s not like the issue tracker on Github
Edit: By the way, the reason the example above prevents a deadlock, is because once your connection above has started, your program is stuck trying to read from the pipe which can only happen once the write part of the pipe is closed (if I recall correctly) but above I’m closing the Hijacked
connection which uses the pipe.
For a different example, this will also read from the pipe: https://play.golang.org/p/1Ob-jIuGCW .
1 Like
Septs
(Septs)
January 24, 2017, 7:16pm
4
@radovskyb cgo does not work that way
radovskyb
(Benjamin Radovsky)
January 26, 2017, 5:48am
5
Sorry, you’re going to have to be more specific than that lol…
Are you trying to implement deadline’s for the pipes, since you posted the pipe code?
system
(system)
Closed
April 26, 2017, 5:48am
6
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.