runtime: Go crashes in windows when creating JVM using "JNI_CreateJavaVM" #58542
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Windows
Milestone
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
OutputWhat did you do?
The following code crashes when "var testingWER bool" at "runtime/signal_windows.go:168" is false.
Changing "var testingWER bool" to true, makes the application work fine.
What did you expect to see?
That it doesn't crash
What did you see instead?
JNI_CreateJavaVM crashes with ACCESS_VIOLATION.
Resolution Suggestions
The problem is that an ACCESS_VIOLATION generated by JNI (and caught by it) is not getting caught, due to the fact that Go doesn't continue the exception search (i.e. _EXCEPTION_CONTINUE_SEARCH).
Patching Go to "testingWER=true" forces Go to continue the search, allowing JNI to handle the error.
As a short term solution, I suggest making "testingWER" public, so developers can workaround unexpected issues without patching Go.
As a long term solution, signal_windows.go return _EXCEPTION_CONTINUE_SEARCH in case the Go module is a library or an archive. I suggest doing one of the following
The text was updated successfully, but these errors were encountered: