-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
runtime: crash/hang on startup in buildmode=c-shared amd64 DLL when run on ARM64 windows 11. #60996
Comments
Thanks for reporting this issue. I'm afraid I can't reproduce it (I made sure CFG is enabled). Could it be that you are using an older gcc toolchain? I use mingw-w64 12.2.0: gcc.exe (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
Hi Quim, thanks, i appreciate your time and effort :) Just double-checking you're trying to repro on an ARM windows machine? I will try mingw-w64 12.2.0 also and report back. |
Huh, I tried to repro on an ARM64 windows machine, not ARM. Can't help here, as I don't have one. The |
Sorry, arm64 is what i meant. Apologies for confusion. |
Oh, ok. Still can't repro it. Could it be that you are using an older C toolchain? I used Visual C Build Tools 2022: cl.exe
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30151 for x64
Copyright (C) Microsoft Corporation. All rights reserved. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. Confirmed behavior with go1.21rc2 also.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Pre-reqs:
Steps to reproduce as follows:
mindll.go
compile it
c_call.c
Compile it (no CFGuard)
ccall_nocfg.bat
Run ccall_nocfg.bat for a while, runs fine, no issues.
Compile caller with CFGuard on
ccall_withcfg.bat
Run ccall_withcfg.bat, process crashes/hangs quite quickly, anywhere from 5th to 20th run. Then keeps crashing throughout, every 5-20 runs or so.
What did you expect to see?
The C process and Go DLL running reliably 100%
What did you see instead?
The process hanging/crashing after LoadLibrary and/or at first DLL function call (Fred) every 5-20 runs.
Workarounds (& why they are workarounds)
Notes
This behavior does not happen when a minimal C-DLL is substituted for the Go DLL above, regardless of whether or not the test C DLL has control flow guard enabled or disabled.
There is only one Go runtime in the process as the 'mothership' is either a python or C exe.
I am not freeing or attempting to unload the Go DLL at all.
The process briefly hangs then suddenly exits and no errors, stacktraces or anything are printed. Also nothing in the Windows event log, which seems to imply that Go is eating the exception and calling ExitProcess?
I see support for CFG itself IN go was deemed not-useful here cmd/compile: add control flow integrity options #35940 however interactions with CFG when GO is a DLL do possibly still need to be addressed.
(Speculation) perhaps this issue is similar to that of runtime: TLS slot index over 64 and crash #59213 however this issue is still present in Go 1.21rc2
The text was updated successfully, but these errors were encountered: