-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: run time crash calling Windows functions #23533
Comments
Can you show us a complete standalone program that we can use to recreate the problem? This looks a lot like the C code is dereferencing an invalid pointer and crashing the program. It's hard to be sure, though. |
Code for reproduce (checked on Windows 10 amd64):
|
Your code appears to be converting Windows I'm going to close this since it looks like that is the problem here. Please comment if you disagree. |
go version go1.10beta2 windows/amd64 (also try 1.9.3 on windows/amd64).
go env
:What did you do?
I use cgo to work with Microsoft Direct2D API. All looks ok until I call
ID2D1HwndRenderTarget
's "method"GetSize
orGetPixelSize
:Call to any of these functions causes runtime crash (reproduced each time). Following errors I get with Go 1.10 beta2 (with 1.9.3 there is less information, but them is the of same kind - "stack split at bad time" & "Exception" with registers).
GetSize
:GetPixelSize
:I expect no panic.
Additional information:
I'm sure that
target
/This
is notnil
/NULL
.I use TDM-GCC-64 5.1.0-2.
I use my own
*Cgo
C functions (i.e.ID2D1HwndRenderTarget_GetSizeCgo
) because in most cases I unable to use 3d-party C functions directly (could not determine kind of name for C.ID2D1HwndRenderTarget_GetPixelSize
, I dont know why).The text was updated successfully, but these errors were encountered: