Closed bsrdjan closed 2 years ago
cc @alexbrainman probably knows if this is a supported configuration on windows.
cc @alexbrainman probably knows if this is a supported configuration on windows.
I don't know, if this is a supported configuration or not.
I don't use Cgo in my Windows programs.
Alex
cc @ianlancetaylor re cgo.
I also don't know, sorry.
But from the problem description I think it's fairly unlikely to be a toolchain or compiler flag problem. Those kind of problems manifest as build failures or immediate crashes. You are describing an occasional crash likely due to memory corruption. That is more likely to be due to some sort of error passing memory between Go and C. The fact that it works reliably on GNU/Linux and macOS does not preclude a problem on Windows, as Windows is of course quite different in many ways.
Sorry I can't help.
@bsrdja Could you provide minimal example to reproduce?
The example itself is simple: https://github.com/SAP/gorfc/blob/master/example/hello_gorfc.go
The challenge could be the setup, requiring SAP ABAP backend system and SAP NWRFC SDK binary libraries, installed on GO client system.
You probably don't have access to any of them and we need to find out how to test?
Timed out in state WaitingForInfo. Closing.
(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)
The CGO module gorfc provides GO bindings to pre-compiled SAP NWRFC SDK binaries. The module works fine on Linux and macOS and never worked quite stable on Windows. Currently, it occasionally terminates on Windows, with heap corruption error 3221226356 (hex C0000374).
I am not sure if the toolchain and compiler flags are maybe part of the problem, here further details.
Toolchain
SAP NWRFC SDK binaries require Microsoft C Runtime DLLs version 12.0 and our Windows toolchain is based on MinGW64, with following settings:
The TDM GCC is not used because this issue still occurs: error adding symbols: File in wrong format
Is this the optimal toolchain for building CGO modules on Windows, or another approach could be considered?
Compiler flags
Compiler flags recommended for SAP NWRFC SDK bindings on Windows platform, are given for Windows native compiler and linker:
GCC counterparts are currently missing for some of them, commented in gorfc source)
Any help/ideas on toolchain, flags, possible root causes and troubleshooting approach, would be of a great help.
Here the details about GO environment on Windows.