Open tajila opened 3 years ago
@hangshao0 can you add a test that would have exposed this issue?
The crash actually happened in ComparingCursor
when it is using J9UTF8_TOTAL_SIZE()
to get the utf8 size, before calling into SCC API j9shr_Query_IsAddressInCache()
.
ComparingCursor::isRangeValidForUTF8Ptr(J9UTF8 *utf8)
{
......
return FALSE != j9shr_Query_IsAddressInCache(_javaVM, utf8, J9UTF8_TOTAL_SIZE(utf8));
It needs to be a test case that passes a "bad" utf8 to ComparingCursor::isRangeValidForUTF8Ptr()
. It will be easy if we have native test suite for ComparingCursor. If not, it may not be easy to let JVM generate a bad utf8 to ComparingCursor.
Can be done by adding a new test to /openj9/test/functional/NativeTest/playlist.xml
with new test cases in /openj9/runtime/tests/shared
?
The native tests in /openj9/runtime/tests/shared
are covering the native code in the j9shr29 dll. The crash here was not in j9shr29 dll. It was ComparingCursor
in j9vm29 (before calling into the actual SCC API). If we want to add a new test, it should be in native test suite for things in j9vm29 dll.
Okay, we have native tests for j9vm29 in the /openj9/runtime/tests
folder. We usually add a jni entry point in openj9/runtime/tests/jni
so you can load System.LoadLibrary("j9ben")
in java code and call a native in j9vm29 that way. See openj9/test/functional/Java8andUp/src/j9vm/test/monitor/Helpers.java
for an example.
We had an issue last year where the SCC range checks caused a gpf. None of our tests where able to catch this issue:
https://github.com/eclipse/openj9/issues/11504
We need to introduce a test that ensures core SCC functionality such as this is working.