-
Notifications
You must be signed in to change notification settings - Fork 372
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
Windows: simple program crashes #3
Comments
Seems like x86_64 vs. x86 issue. I use the same structures on both platforms, perhaps it was a bad decission. Can't really do much here, because I have no x86_64 windows installation, but will take a closer look on things that may cause a problem. |
So, I tried the example on my windows machine (x86), it works... Definitely something architecture specific. Can't see it. Will keep looking for an amd64 windows machine. |
I am getting the same result, and I am not running a 64bit OS. My machine is 64bit, but I am running 32bit Windows 7, and 32 bit Go. I just installed Go and termbox, and got this error when running any of the demos. I then created my own basic program, almost exactly like the one in the original bug report, and I got the same error. The error does not occur when I remove termbox.Flush(). panic: runtime error: invalid memory address or nil pointer dereference goroutine 1 [syscall]: goroutine 2 [syscall]: goroutine 3 [syscall]: |
Well, I was testing it on windows xp 32 bit. Now I actually have the Windows 7 64 bit. Will check that out soon. |
I just installed cygwin on my machine, and I no longer get that error. Don't know if that was coincidence or not. |
I take that back, kind of. My simple little program runs without error now, though nothing is visible from my call to SetCell. It does wait on events, fmt.Println prints to the screen, and it quits correctly on a key press. However, I still get the same error when I try to run any of your demo programs. |
You need to call termbox.Flush(), that submits everything to the console. And I think you'll have your segfault if you do that. |
It clearly works now on my w7-x64. Screenshot proof (godit.exe is a 64 bit process for sure): |
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x1 addr=0x0 pc=0x76fe12da]
goroutine 1 [syscall]:
syscall.Syscall6(0x76ff4930, 0x5, 0x7, 0xf84008f000, 0x5dc0, ...)
C:/.../go/src/pkg/runtime/zsyscall_windows_amd64.c:97 +0x55
github.com/nsf/termbox-go.write_console_output_attribute(0x7, 0xf84008f000, 0x5dc000005dc0, 0x0, 0x0, ...)
C:/go/src/pkg/github.com/nsf/termbox-go/termbox_windows.go:99 +0xd6
github.com/nsf/termbox-go.Flush()
C:/go/src/pkg/github.com/nsf/termbox-go/api_windows.go:67 +0xc1
main.main()
C:/.../playground.go:15 +0xc1
goroutine 2 [syscall]:
created by runtime.main
C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist119677522/go/src/pkg/runtime/proc.c:221
goroutine 3 [syscall]:
syscall.Syscall6(0x76ff4fd0, 0x4, 0x3, 0xf840015a20, 0x1, ...)
C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist119677522/go/src/pkg/runtime/zsyscall_windows_amd64.c:97 +0x55
github.com/nsf/termbox-go.read_console_input(0x3, 0xf840015a20, 0x0, 0x0, 0x0, .
..)
C:/go/src/pkg/github.com/nsf/termbox-go/termbox_windows.go:138 +0x90
github.com/nsf/termbox-go.input_event_producer()
C:/go/src/pkg/github.com/nsf/termbox-go/termbox_windows.go:560 +0x5e
created by github.com/nsf/termbox-go.Init
C:/go/src/pkg/github.com/nsf/termbox-go/api_windows.go:51 +0x361
The text was updated successfully, but these errors were encountered: