Coder Social home page Coder Social logo

Windows: simple program crashes about termbox-go HOT 8 CLOSED

nsf avatar nsf commented on May 21, 2024
Windows: simple program crashes

from termbox-go.

Comments (8)

nsf avatar nsf commented on May 21, 2024

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.

from termbox-go.

nsf avatar nsf commented on May 21, 2024

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.

from termbox-go.

dmdavis10 avatar dmdavis10 commented on May 21, 2024

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
[signal 0xc0000005 code=0x1 addr=0x0 pc=0x7616d68d]

goroutine 1 [syscall]:
syscall.Syscall6(0x7616d705, 0x5, 0x13, 0x11c21000, 0x1, ...)
C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist579160455/go/src/pkg/runtime/zsyscall_windows_386.c:97 +0x49
github.com/nsf/termbox-go.write_console_output_attribute(0x13, 0x11c21000, 0x1, 0x57e40, 0x10001, ...)
C:/Go/src/pkg/github.com/nsf/termbox-go/termbox_windows.go:99 +0x9f
github.com/nsf/termbox-go.Flush(0x1, 0x1)
C:/Go/src/pkg/github.com/nsf/termbox-go/api_windows.go:67 +0xaa
main.main()
C:/Go/src/term/term.go:16 +0xe1

goroutine 2 [syscall]:
created by runtime.main
C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist579160455/go/src/pkg/runtime/proc.c:221

goroutine 3 [syscall]:
syscall.Syscall6(0x7616d082, 0x4, 0xf, 0x11685a60, 0x1, ...)
C:/Users/ADMINI~1/AppData/Local/Temp/2/bindist579160455/go/src/pkg/runtime/zsyscall_windows_386.c:97 +0x49
github.com/nsf/termbox-go.read_console_input(0xf, 0x11685a60, 0x0, 0x0)
C:/Go/src/pkg/github.com/nsf/termbox-go/termbox_windows.go:138 +0x78
github.com/nsf/termbox-go.input_event_producer()
C:/Go/src/pkg/github.com/nsf/termbox-go/termbox_windows.go:574 +0x52
created by github.com/nsf/termbox-go.Init
C:/Go/src/pkg/github.com/nsf/termbox-go/api_windows.go:51 +0x2f0
exit status 2

from termbox-go.

nsf avatar nsf commented on May 21, 2024

Well, I was testing it on windows xp 32 bit. Now I actually have the Windows 7 64 bit. Will check that out soon.

from termbox-go.

dmdavis10 avatar dmdavis10 commented on May 21, 2024

I just installed cygwin on my machine, and I no longer get that error. Don't know if that was coincidence or not.

from termbox-go.

dmdavis10 avatar dmdavis10 commented on May 21, 2024

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.

from termbox-go.

nsf avatar nsf commented on May 21, 2024

You need to call termbox.Flush(), that submits everything to the console. And I think you'll have your segfault if you do that.

from termbox-go.

nsf avatar nsf commented on May 21, 2024

It clearly works now on my w7-x64. Screenshot proof (godit.exe is a 64 bit process for sure):
http://ompldr.org/vZnAydg/godit-w64.png

from termbox-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.