-
-
Notifications
You must be signed in to change notification settings - Fork 136
Description
We are encountering a critical race condition in the IKVM JNI layer (JNIEnv.NewObjectArray()) when running Java applications on IIS/.NET. This results in NegativeArraySizeException during concurrent application startup, especially after IIS resets.
Details:
Exception: NegativeArraySizeException in JNIEnv.NewObjectArray()
Environment: Windows Server 2022, .NET Runtime, IIS, Spring Framework
Reproducibility: Intermittent, only under concurrent load at startup (IIS reset)
Impact: Production downtime, data loss (empty site/page mappings), silent failures
Why Application-Level Workarounds Are Not Acceptable:
Retry logic can result in empty arrays, causing missing sites/pages and broken analytics
Fail-fast leads to downtime and restart loops
Synchronization cannot cover all JNI code paths and impacts performance
Request:
Please investigate thread-safety and initialization order in the JNI layer
Ensure JNIEnv.NewObjectArray() and related methods are fully protected from concurrent access before initialization
Add concurrent access tests to the IKVM test suite
We have a detailed bug report and root cause analysis available, including suggested fixes and test cases. Please advise how best to share this information and collaborate on a solution.