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
windows: No panic for cgo crashes #30737
Comments
cgo too hard to use. |
There is a hard assumption that C code is well-behaved. Writing through a null pointer in C is undefined behaviour. The Go runtime makes no attempts to map undefined behaviour in C to Go panics, it'd be a futile attempt. |
What does a C program with the same code do? Does it crash? |
@ianlancetaylor @polarina But raising a SIGSEGV also doesn't make the Go runtime panic.
From document of package os/signal:
If SIGSEGV can't trigger a panic, what can be? |
I really don't know what The os/signal package doc start by saying that they are mostly for Unix. You are quoting from the Unix docs for os/signal, not the (very short) Windows docs. |
As the C standard library contains <signal.h> and Mingw-w64 also supports it, should the panic logic on Windows behaves the same as on Unix? |
What does Mingw-w64 do with Alex |
It is implemented in msvcrt.dll, I guess. |
If you can change the runtime package to make signals on Windows work as they do on Unix, that would be fine with me. |
I'm not really sure if it's necessary or just fine. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
windows/amd64What did you do?
Run:
What did you expect to see?
Panic.
What did you see instead?
Nothing.
The text was updated successfully, but these errors were encountered: