-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/cgo: SIGSEGV using C++ files in package on Windows #10023
Comments
Internal linking doesn't support running the global constructors, so again
this is a dup for #4069.
|
Removes all dynamic_cast, in order to make it work without RTTI. This is due to golang/go#10023 (duplicate of golang/go#4069) and solves go-qml#19.
Make it work without global variable initialization. This is due to golang/go#10023 (duplicate of golang/go#4069) and solves go-qml#142.
Thank you for your reply. I'm leaving this comment to help who has this problem I had, since searching was very hard for me and many had no clue for the go-qml issues. If you get Exception 0xc0000005 under Windows while using global variable initialization depending feature, like static variables, global constructors, cerr or cout, or feature relying on RTTI such as dynamic_cast or typeof, this could be the reason. |
Removes all dynamic_cast, in order to make it work without RTTI. This is due to golang/go#10023 (duplicate of golang/go#4069) and solves go-qml#19.
Make it work without global variable initialization. This is due to golang/go#10023 (duplicate of golang/go#4069) and solves go-qml#142.
Hi,
this seems to me the same as #5629. Under Linux, if I compile the following files it runs fine.
test.go:
test.h:
test.cpp:
Under Windows, using mingw-w64, it crashes:
In the mentioned issue #5629 @ianlancetaylor suggest: "My guess is that the global constructors are not being run, but I have no idea why that would be happening."
I'm a C++ newbie, but this sounds to me a good guess. I found this issue while debugging go-qml, where I got some crashes under Windows:
dynamic_cast
(see go-qml issue #19) -- maybe RTTI is not initialized?static
local variable (see go-qml issue #142) -- maybe "globals" are not initialized?I'm using versions:
The text was updated successfully, but these errors were encountered: