invalid pointer when running particle.exe on Windows 8 64 bits

293 views
Skip to first unread message

Andre Moraes

unread,
Feb 21, 2014, 10:31:19 AM2/21/14
to go-...@googlegroups.com
I just downloaded and built the qml package using the instructions from github.com. When I try to run the particle example, the program aborts with a invalid pointer. I saved the output in the following gist:

https://gist.github.com/andrebq/9136143

I am using the x86 version of mingw (installed from Qt) and GOARCH=386. Any clues about what is happening?

The env used to compile/run the program is:

set WINPATH=%PATH%
set GOPATH=C:\gopath
set QT511=C:\Qt5.1.1\5.1.1
set QTHOME=C:\Qt5.1.1
set GVIMHOME=C:\Program Files (x86)\Vim\vim74
set CPATH=%QT511%\mingw48_32\include;%QT511%\mingw48_32\include\QtCore\5.1.1\QtCore
set LIBRARY_PATH=%LIBRARY_PATH%;%QT511%\mingw48_32\lib
set GOROOT=C:\Go\
set ANDRETOOLS=C:\AndreTools
set GIT_HOME=C:\Program Files (x86)\Git
set PKG_CONFIG_PATH=%QT511%\mingw48_32\lib\pkgconfig
set PATH=%GVIMHOME%;%GIT_HOME%\cmd;%QT511%\mingw48_32\bin;%GOROOT%\bin;%GOPATH%\bin;%ANDRETOOLS%;%QTHOME%\Tools\mingw48_32\bin;

pushd %GOPATH%\src

Công Nguyễn

unread,
Mar 17, 2014, 7:02:18 AM3/17/14
to go-...@googlegroups.com
I had similar problem with QT5 32bit and Go 386. The problem always abort with invalid pointer.
I'm running Win8 64bit, the Linux install works fine, but I want to build for Windows. Tried both 64bit and 32bit setup (Qt and Go) but no luck

Công Nguyễn

unread,
Mar 17, 2014, 7:13:56 AM3/17/14
to go-...@googlegroups.com
It's also worth to note that, under the gcc comes with mingw, I had this error when running go get
 c:\qt\qt5.2.1\5.2.1\mingw48_32\include\qtgui\qopenglversionfunctions.h:785:43: error: expected unqualified-id before ')' token
     void (QOPENGLF_APIENTRYP MemoryBarrier)(GLbitfield barriers);

the gcc comes with Qt doesn't have the problem, but it has invalid pointer error. 


Gustavo Niemeyer

unread,
Mar 17, 2014, 10:56:03 AM3/17/14
to Công Nguyễn, Go QML, Mark Saward
I'm really sorry that I cannot be more useful with these Windows issues.

Mark Saward mentioned he was trying to get it working properly on
Windows too. Mark, did you manage to get it working, or did you find
the same issues being mentioned?
> --
> You received this message because you are subscribed to the Google Groups
> "go-qml" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to go-qml+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--

gustavo @ http://niemeyer.net

Công Nguyễn

unread,
Mar 18, 2014, 12:43:01 AM3/18/14
to go-...@googlegroups.com, Công Nguyễn, Mark Saward
panic: invalid memory address or nil pointer dereference
fatal error: panic during malloc
[signal 0xc0000005 code=0x0 addr=0x50 pc=0x41eaaa]
runtime stack:
runtime.panic(0x523540, 0x6f0d2f)
    C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease250988475/go/src/pkg/runtime/panic.c:233 +0x2c
runtime: unexpected return pc for runtime.sigpanic called from 0x7ff82da55ed9
goroutine 4 [syscall]:
runtime.cgocall(0x4a0d92, 0x88cf90)
    C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease250988475/go/src/pkg/runtime/cgocall.c:149 +0x120 fp=0x88cf78
gopkg.in/v0/qml._Cfunc_idleTimerInit(0x6fd23c)
    C:/Users/x/AppData/Local/Temp/go-build619575075/gopkg.in/v0/qml/_obj/_cgo_defun.c:229 +0x34 fp=0x88cf90
gopkg.in/v0/qml.guiLoop()
    C:/Users/x/workspace/go/src/gopkg.in/v0/qml/bridge.go:38 +0x48 fp=0x88cfa0
runtime.goexit()
    C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease250988475/go/src/pkg/runtime/proc.c:1394 fp=0x88cfa8
created by gopkg.in/v0/qml.Init
    C:/Users/x/workspace/go/src/gopkg.in/v0/qml/qml.go:44 +0xa3
goroutine 1 [semacquire]:
sync.runtime_Semacquire(0x6fd27c)
    C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease250988475/go/src/pkg/runtime/sema.goc:199 +0x33
sync.(*Mutex).Lock(0x6fd278)
    C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease250988475/go/src/pkg/sync/mutex.go:66 +0xd9
gopkg.in/v0/qml.Init(0x0)
    C:/Users/x/workspace/go/src/gopkg.in/v0/qml/qml.go:45 +0xb6
main.main()
    G:/workspace/go/src/gopkg.in/v0/qml/examples/particle/main.go:10 +0x2c
goroutine 3 [syscall]:
runtime.goexit()
    C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease250988475/go/src/pkg/runtime/proc.c:1394
Error: process exited with code 2.
c:/go/bin/go.exe get -v . [G:/workspace/go/src/gopkg.in/v0/qml/examples/particle]
go install: no install location for directory G:\workspace\go\src\gopkg.in\v0\qml\examples\particle outside GOPATH
Error: process exited with code 1.
c:/go/bin/go.exe get -v . [G:/workspace/go/src/gopkg.in/v0/qml/examples/particle]
go install: no install location for directory G:\workspace\go\src\gopkg.in\v0\qml\examples\particle outside GOPATH
Error: process exited with code 1.
c:/go/bin/go.exe build  [G:/workspace/go/src/gopkg.in/v0/qml]
Error: process crashed or was terminated while running.
c:/go/bin/go.exe build  [G:/workspace/go/src/gopkg.in/v0/qml/examples/particle]
Success: process exited with code 0.
G:/workspace/go/src/gopkg.in/v0/qml/examples/particle/particle.exe  [G:/workspace/go/src/gopkg.in/v0/qml/examples/particle]
panic: invalid memory address or nil pointer dereference
fatal error: panic during malloc
[signal 0xc0000005 code=0x0 addr=0x50 pc=0x41eaaa]
runtime stack:
runtime.panic(0x523540, 0x6f0d2f)
    C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease250988475/go/src/pkg/runtime/panic.c:233 +0x2c
runtime: unexpected return pc for runtime.sigpanic called from 0x7ff82da55ed9
goroutine 4 [syscall]:
runtime.cgocall(0x4a0d92, 0x44fcf90)
    C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease250988475/go/src/pkg/runtime/cgocall.c:149 +0x120 fp=0x44fcf78
gopkg.in/v0/qml._Cfunc_idleTimerInit(0x6fd23c)
    C:/Users/x/AppData/Local/Temp/go-build619575075/gopkg.in/v0/qml/_obj/_cgo_defun.c:229 +0x34 fp=0x44fcf90
gopkg.in/v0/qml.guiLoop()
    C:/Users/x/workspace/go/src/gopkg.in/v0/qml/bridge.go:38 +0x48 fp=0x44fcfa0
runtime.goexit()
    C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease250988475/go/src/pkg/runtime/proc.c:1394 fp=0x44fcfa8
created by gopkg.in/v0/qml.Init
    C:/Users/x/workspace/go/src/gopkg.in/v0/qml/qml.go:44 +0xa3
goroutine 1 [semacquire]:
sync.runtime_Semacquire(0x6fd27c)
    C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease250988475/go/src/pkg/runtime/sema.goc:199 +0x33
sync.(*Mutex).Lock(0x6fd278)
    C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease250988475/go/src/pkg/sync/mutex.go:66 +0xd9
gopkg.in/v0/qml.Init(0x0)
    C:/Users/x/workspace/go/src/gopkg.in/v0/qml/qml.go:45 +0xb6
main.main()
    G:/workspace/go/src/gopkg.in/v0/qml/examples/particle/main.go:10 +0x2c
goroutine 3 [syscall]:
runtime.goexit()
    C:/Users/ADMINI~1/AppData/Local/Temp/2/makerelease250988475/go/src/pkg/runtime/proc.c:1394

I reinstalled go 1.2.1, mingw64 with qt/64bit  and had this error.
It seems to stop in 4...@qml.go:guiLoopReady.Lock(). Further debug I found the line actually segmentation fault is 178 in asm_amd64.s: CALL    DI
I know very little asm, so I can't do any thing here.

Mark Saward

unread,
Mar 18, 2014, 4:28:09 AM3/18/14
to go-...@googlegroups.com
Feeling really sick atm, so just a quick reply.  This error looks familiar, but my memory is just not good at the moment.  I think that I did some fishing around and it turns out to be an error with QT, and you can modify a file to fix it.

I did ultimately get my program running on windows, but I haven't got custom GL working (and haven't tried since I noted it fails).  Although, keyboard input doesn't seem to work properly when I'm trying to detect for keyboard events.

Mikhail

unread,
Apr 26, 2014, 2:44:45 PM4/26/14
to go-...@googlegroups.com
Today I spent all day trying to build examples under Win32 and went through the same problems with no positive result. The problem with
fatal error: panic during malloc
[signal 0xc0000005 code=0x0 addr=0x50 pc=0x41eaaa]
looks like resolved only in go 1.3beta1 but error with
"error: expected unqualified-id before ')' token" I haven't solved too.

So would be good thing if developers of go qml provide detailed step by step instruction how to build and run examples on
Windows 32 (under last official releases of go and qt
preferably).

Gustavo Niemeyer

unread,
Apr 26, 2014, 5:37:26 PM4/26/14
to Mikhail, Go QML
On Sat, Apr 26, 2014 at 3:44 PM, Mikhail <amv...@gmail.com> wrote:
> So would be good thing if developers of go qml provide detailed step by step
> instruction how to build and run examples on
> Windows 32 (under last official releases of go and qt preferably).

I would love to, but I cannot do that myself in a proper way, as I
don't develop on Windows for decades and have no test environment.
That said, it would be fantastic if we could maintain the port in good
state. We need volunteers willing to contribute to the project for
that.


gustavo @ http://niemeyer.net

Mark Saward

unread,
Apr 27, 2014, 4:43:25 AM4/27/14
to go-...@googlegroups.com, Mikhail
In reference to earlier comments, this issue might help getting things built: https://github.com/go-qml/qml/issues/56

I have a working windows build, but I think I'm using 32 bit mingw.

Mikhail

unread,
Apr 27, 2014, 1:02:58 PM4/27/14
to go-...@googlegroups.com, Mikhail
I'd removed the line which generated the error and finally I built qml.v0.a library.

So to build go qml examples on Win32  I followed next steps:
1. Install latest build of go (1.3beta1) to avoid malloc error;
2. Install mingw downloaded from http://sourceforge.net/projects/mingw/files/latest/download (not which ones from QT installation);
3. And applied this "fix" https://github.com/go-qml/qml/issues/56;

After these not trivial steps I have been able to run several examples (except that not require GL).
Big thanks for your help!
 

воскресенье, 27 апреля 2014 г., 12:43:25 UTC+4 пользователь Mark Saward написал:

Mikhail

unread,
Apr 27, 2014, 1:07:39 PM4/27/14
to go-...@googlegroups.com, Mikhail
Sorry, I mean that I can build only these examples which do not require GL.

воскресенье, 27 апреля 2014 г., 21:02:58 UTC+4 пользователь Mikhail написал:

Gustavo Niemeyer

unread,
Apr 28, 2014, 11:49:47 AM4/28/14
to Mikhail, Go QML
Thanks for these details, and glad you've made it work.

The GL problem in Windows is known, and it will be fixed by the
refactoring of the gl package that is in progress. I've filed an issue
for those that want to track progress on it:

https://github.com/go-qml/qml/issues/62

Maxim Kouprianov

unread,
Apr 30, 2014, 8:16:45 AM4/30/14
to go-...@googlegroups.com
I've done some experiments with various versions of mingw / qt / go and here are my findings (under Windows 8.1 x64).

1) The only working version of mingw is that 4.8.1 from mingw-get (the one referenced in readme from GH repo);
2) go 1.2.1 and 1.3beta1 are working equally well, except that 1.2.1 has stacktrace after crash;
3) The issue with Qt's header on Qt5.2.1 can be solved by commenting that line out or by compiling and using the Qt5.3beta;
4) With tools described above I've managed to compile and run several examples, including particles.exe. Of course `gl` module won't compile, because it does not collaborate well with windows' opengl32.lib. I think the fix should look like this https://github.com/go-gl/gl with GLEW.
======
5) Finally, there is a problem running the customtype example: when obj.Interface() gets called, everything crashes. The problem was marked as fixed, but it not seems so. Call of C.objectGoAddr leads to crash both with go 1.2.1 and go 1.3beta1.

пятница, 21 февраля 2014 г., 19:31:19 UTC+4 пользователь Andre Moraes написал:

Gustavo Niemeyer

unread,
Apr 30, 2014, 7:10:38 PM4/30/14
to Maxim Kouprianov, Go QML
Hi Maxim,

Can you confirm that point 5 is the same traceback as the one reported
in that bug?

Maxim Kouprianov

unread,
May 1, 2014, 2:58:28 AM5/1/14
to go-...@googlegroups.com
Yes, https://gist.github.com/xlab/fc895d74a9918c4d3c3a

четверг, 1 мая 2014 г., 3:10:38 UTC+4 пользователь Gustavo Niemeyer написал:

Gustavo Niemeyer

unread,
May 1, 2014, 11:59:40 AM5/1/14
to Maxim Kouprianov, Go QML
Thanks for all the information.

Given that all these methods are failing, the problem is clearly at
value creation time. So far I could not guess what might be wrong.
Might need an environment to reproduce it.
Reply all
Reply to author
Forward
0 new messages