Building Go Project, "Panic: The handle is invalid."

1,263 views
Skip to first unread message

crdp...@gmail.com

unread,
Apr 6, 2015, 8:27:58 PM4/6/15
to golan...@googlegroups.com
I went and ran my code, and this error only happens when terminal.MakeRaw() is ran. I've also noticed that this error only happens on windows, and not on linux. 

I've never encountered a runtime error before, so I'm not familiar with diagnosing problems like this one.

>go run main.go

panic: The handle is invalid.


goroutine
1 [running]:
main
.main()
        C
:/Users/[usr]/Documents/Programming/go/[Path to Project]
n
.go:37 +0x46c


goroutine
2 [runnable]:
runtime
.forcegchelper()
        c
:/go/src/runtime/proc.go:90
runtime
.goexit()
        c
:/go/src/runtime/asm_amd64.s:2232 +0x1


goroutine
3 [runnable]:
runtime
.bgsweep()
        c
:/go/src/runtime/mgc0.go:82
runtime
.goexit()
        c
:/go/src/runtime/asm_amd64.s:2232 +0x1


goroutine
4 [runnable]:
runtime
.runfinq()
        c
:/go/src/runtime/malloc.go:712
runtime
.goexit()
        c
:/go/src/runtime/asm_amd64.s:2232 +0x1
exit status 2

I can share the code upon request if it is deemed necessary.

Thanks in advance.

James

unread,
Apr 6, 2015, 8:45:20 PM4/6/15
to crdp...@gmail.com, golang-nuts
The file descriptor you are passing in is probably wrong. You either want 1 or 2 I think, for stdout and stderr respectively.


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

James

unread,
Apr 6, 2015, 8:46:10 PM4/6/15
to crdp...@gmail.com, golang-nuts
Oh, I don't think this package works on windows FYI

crdp...@gmail.com

unread,
Apr 6, 2015, 8:54:18 PM4/6/15
to golan...@googlegroups.com, crdp...@gmail.com
Really? Are you sure it doesn't work on windows, or can you give me a link? If this turns out to be as simple as "you can't do it on windows", then that could makes things easier for me.

James

unread,
Apr 6, 2015, 9:31:14 PM4/6/15
to crdp...@gmail.com, golang-nuts
This package uses terminal.MakeRaw() for *nix but this for windows https://github.com/howeyc/gopass/blob/master/win.go
Reply all
Reply to author
Forward
0 new messages