Using CGO causes nosplit stack overflow error

Hi guys,
Maybe someone faced such error previously? I am working on the project, that uses CGO. After adding CGO_ENABLED 1 app started crashing on start.
My platform is Win 8.1/x64 and I’m trying to build x86 app, i am using Intellij IDEA (CE) as an IDE. I think the problem can be in MinGW, so i tried several different versions, but got no luck. See details below.

Any help will be highly appreciated.

GOROOT=C:/Go
GOPATH=D:/projects/gocode;C:/Go/lib;C:/Go/bin;C:/Go
C:/Go\bin\go.exe build -ldflags “-H=windowsgui -w -s” -o D:\projects\agent\agent\Agent.exe -gcflags “-N -l” “”
/D/projects/def-agent
runtime.cgocall: nosplit stack overflow
588 assumed on entry to runtime.cgocall (nosplit)
540 after runtime.cgocall (nosplit) uses 48
536 on entry to runtime.exitsyscall (nosplit)
360 after runtime.exitsyscall (nosplit) uses 176
356 on entry to runtime.exitsyscallfast (nosplit)
196 after runtime.exitsyscallfast (nosplit) uses 160
192 on entry to runtime.writebarrierptr (nosplit)
152 after runtime.writebarrierptr (nosplit) uses 40
148 on entry to runtime.cgoCheckWriteBarrier (nosplit)
92 after runtime.cgoCheckWriteBarrier (nosplit) uses 56
88 on entry to runtime.cgoIsGoPointer (nosplit)
64 after runtime.cgoIsGoPointer (nosplit) uses 24
60 on entry to runtime.inHeapOrStack (nosplit)
4 after runtime.inHeapOrStack (nosplit) uses 56
0 on entry to runtime.panicindex
-4 on entry to runtime.morestack (nosplit)
runtime.cgocallbackg: nosplit stack overflow

syscall.loadsystemlibrary: nosplit stack overflow

And so on and so force.

You cannot cross compile from 64bit windows to 32bit windows with cgo enabled.

If you install the 32bit windows version of Go, it should work.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.