Skip to content
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

Fix JIT System.nanoTime() in checkpoint mode #15609

Merged
merged 7 commits into from Aug 10, 2022

Conversation

ymanton
Copy link
Member

@ymanton ymanton commented Jul 25, 2022

The attached patches

  1. Fix the x86 codegen's System.nanoTime() implementation to do the right thing in checkpoint mode
  2. Disable the Z codegen's implementation in checkpoint mode until it can be fixed to do the right thing
  3. Add a test case to check that JIT compiled code containing calls to System.nanoTime() behaves as expected in checkpoint mode

Fixes #15513

@ymanton ymanton requested a review from JasonFengJ9 July 25, 2022 15:06
@ymanton
Copy link
Member Author

ymanton commented Jul 25, 2022

@r30shah can you look at the Z changes in particular?

@ymanton ymanton requested a review from 0xdaryl July 25, 2022 15:56
@ymanton
Copy link
Member Author

ymanton commented Jul 25, 2022

@0xdaryl can you or someone else familiar with the x86 codegen look at that part?

@@ -9240,6 +9240,17 @@ inlineNanoTime(
// result = reg + result
generateRegMemInstruction(TR::InstOpCode::LEA8RegMem, node, result, generateX86MemoryReference(reg, result, 0, cg), cg);

#if defined(J9VM_OPT_CRIU_SUPPORT)
if (fej9->inSnapshotMode())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a correct check to determine if nano time adjustment is required.

TR_J9VMBase::inSnapshotMode()
{
#if defined(J9VM_OPT_CRIU_SUPPORT)
return getJ9JITConfig()->javaVM->internalVMFunctions->isCheckpointAllowed(vmThread());

isCheckpointAllowed() is TRUE before a checkpoint taken in which nanoTimeMonotonicClockDelta is zero and no adjustment required though it won't hurt to do so.
However isCheckpointAllowed() is FALSE after a checkpoint taken at CRIURestoreNonPortableMode which is a main mode in use, though a checkpoint is not allowed nanoTimeMonotonicClockDelta is not zero after a checkpoint, and adjustment is needed.
I think you could always apply result = result - nanoTimeMonotonicClockDelta, or retrieve nanoTimeMonotonicClockDelta value first, only do the subtraction if it is non-zero.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, you're right. I assumed it was true on both sides of the C/R.

I'm going to rework the JIT queries to add one that uses isCRIUSupportEnabled (and make it clearer as to what question each query is answering) instead of looking at the the value of nanoTimeMonotonicClockDelta because we'll likely have other cases where we need to generate C/R-aware code after restore.

I modified the tests to have separate test cases for pre and post C/R compilation and the post one catches this bug.

@@ -85,6 +85,7 @@
<variation>-Xjit:count=0 -XX:+CRIURestoreNonPortableMode</variation>
</variations>
<command>
TR_Options=$(Q)exclude={org/openj9/criu/TimeChangeTest.nanoTimeInt()J},dontInline={org/openj9/criu/TimeChangeTest.nanoTimeInt()J|org/openj9/criu/TimeChangeTest.nanoTimeJit()J}$(Q) \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest move the JIT option into the variation section above, there is a mode -Xint apparently conflict with this TR_Options.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TR_Options should not conflict with -Xint because the JIT will not be initialized and the env var will be ignored by the rest of the components (unless someone decides to use it for other purposes).

Initially I tried setting these in the variations section, but the braces need to be quoted or escaped when being passed through the shell and every combination I tried failed.

I think it's probably better to use the current approach anyhow because someone adding a variation in the future will need to be aware of whether or not the JIT and/or AOT compilers are enabled by their options and duplicate the string, otherwise the tests will be ineffective.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@llxia any insights to add the command line option #15609 (comment) into variation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think it is easier to put in command in this case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears there was a problem to do so - the braces need to be quoted or escaped when being passed through the shell and every combination I tried failed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had some offline discussion with Lan, the problem is between cmdlinetester and criuScript.sh, an additional option along w/ a separate playlist test target might be required to accommodate such JIT options hence out of scope of this PR.
There is no conflict settings introduced by TR_Options in this testcase, current approach is fine.

This query tells us whether snapshot mode is enabled, which is true for
life of the process, regardless of whether any snapshots/checkpoints
or restores have happened.

Signed-off-by: Younes Manton <ymanton@ca.ibm.com>
The x86 codegen inlines a direct call to clock_gettime() in place of
calls to System.nanoTime(). In checkpoint mode the JVM adjusts the
value returned by System.nanoTime() by subtracting any elapsed time
between checkpoint and restore. The JIT implementation therefore needs
to do the same.

Signed-off-by: Younes Manton <ymanton@ca.ibm.com>
The getSupportsCurrentTimeMaxPrecision() query is currently used by
Z to indicate to the Simplifier that it supports transforming
System.nanoTime() calls into calls to currentTimeMaxPrecision().

The getSupportsMaxPrecisionMilliTime() query is used similarly for
transforming System.currentTimeMillis(), but only if
getSupportsCurrentTimeMaxPrecision() returns true as well.

This means that we can't selectively disable the nanoTime()
transformation without disabling the currentTimeMillis() one, but we can
do the reverse.

This patch changes Simplifier to check
getSupportsCurrentTimeMaxPrecision() for nanoTime() and
getSupportsMaxPrecisionMilliTime() for currentTimeMillis() to allow
each transformation to be enabled independently of the other.

Signed-off-by: Younes Manton <ymanton@ca.ibm.com>
In checkpoint mode the generated code needs to subtract the value of
nanoTimeMonotonicClockDelta from the result. For now, disable this
optimization.

Signed-off-by: Younes Manton <ymanton@ca.ibm.com>
System.nanoTime() needs special handling in checkpoint mode. Since the
JIT has an optimized version on some platforms it needs testing to
verify that it is behaving as expected. This test case checks the JIT
against the non-JIT implementation in the simple scenario where the
reference clock moves forward between checkpoint and restore. It does
not handle the reverse case, since there's no easy way to set that up.

Signed-off-by: Younes Manton <ymanton@ca.ibm.com>
Compiled methods containing System.nanoTime() calls need to be
checkpoint/restore aware regardless of whether or not future checkpoints
are still possible at compile time (unlike other cases that only need to
be compiled aware if future checkpoints are possible and can be compiled
conventionally otherwise).

Split the test case into two separate tests, one that provokes
compilation before the checkpoint and one after.

Signed-off-by: Younes Manton <ymanton@ca.ibm.com>
Apply count=1 to nanoTimeJit() to try to force its compilation as
early as possible so that the compiled version will be invoked
during the test, otherwise the test will be ineffective.

This solution does not guarantee compilation, but it's the biggest
hammer we have aside from `disableAsyncCompilation`, which is global
and would affect all compiled code, test run time, and all test
variations (since this option is being applied to all variations).

Note that count=1 is better than count=0 here since 0 will most likely
result in calls to System.nanoTime() being unresolved at compile time,
which prevents the optimization that we are trying to verify.

Signed-off-by: Younes Manton <ymanton@ca.ibm.com>
@ymanton
Copy link
Member Author

ymanton commented Jul 27, 2022

I've

  • added a new JIT FE query that uses isCRIUSupportEnabled.
  • split the test case in two to verify that compilation before and after the C/R transition work as expected.

Copy link
Contributor

@r30shah r30shah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Z Changes LGTM.

Copy link
Member

@JasonFengJ9 JasonFengJ9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The VM related change looks good.

@ymanton
Copy link
Member Author

ymanton commented Aug 8, 2022

Jenkins test sanity.functional xlinuxcriu jdk11

@ymanton
Copy link
Member Author

ymanton commented Aug 9, 2022

One failure, but it doesn't look related to timing or checkpoint/restore functionality. #15617 was recently merged and looks related. @mpirvu does this crash look familiar?

[2022-08-08T22:58:01.867Z] ===============================================
[2022-08-08T22:58:01.867Z] Running test pthreadDestructor_0 ...
[2022-08-08T22:58:01.867Z] ===============================================
...
[2022-08-08T22:58:01.868Z] Assertion failed at /home/jenkins/workspace/Build_JDK11_x86-64_linux_criu_Personal/openj9/runtime/compiler/env/J9SharedCache.cpp:699: false
[2022-08-08T22:58:01.868Z] VMState: 0x00050080
[2022-08-08T22:58:01.868Z] 	Shared cache pointer 0x7f3c426155d0 out of bounds
[2022-08-08T22:58:01.868Z] compiling sun/util/locale/LanguageTag.parseVariants(Lsun/util/locale/StringTokenIterator;Lsun/util/locale/ParseStatus;)Z at level: warm
[2022-08-08T22:58:01.868Z] #0: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x8af2b5) [0x7f3e066d32b5]
[2022-08-08T22:58:01.868Z] #1: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x8ba660) [0x7f3e066de660]
[2022-08-08T22:58:01.868Z] #2: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x583bbe) [0x7f3e063a7bbe]
[2022-08-08T22:58:01.868Z] #3: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x58533d) [0x7f3e063a933d]
[2022-08-08T22:58:01.868Z] #4: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x206944) [0x7f3e0602a944]
[2022-08-08T22:58:01.868Z] #5: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x443177) [0x7f3e06267177]
[2022-08-08T22:58:01.868Z] #6: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x443c33) [0x7f3e06267c33]
[2022-08-08T22:58:01.868Z] #7: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x443c5f) [0x7f3e06267c5f]
[2022-08-08T22:58:01.868Z] #8: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x44bd9f) [0x7f3e0626fd9f]
[2022-08-08T22:58:01.868Z] #9: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x2824ed) [0x7f3e060a64ed]
[2022-08-08T22:58:01.868Z] #10: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x55c529) [0x7f3e06380529]
[2022-08-08T22:58:01.868Z] #11: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x54285c) [0x7f3e0636685c]
[2022-08-08T22:58:01.868Z] #12: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x14aaef) [0x7f3e05f6eaef]
[2022-08-08T22:58:01.868Z] #13: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x14bb54) [0x7f3e05f6fb54]
[2022-08-08T22:58:01.868Z] #14: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9prt29.so(+0x2b573) [0x7f3e0c90b573]
[2022-08-08T22:58:01.868Z] #15: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x149279) [0x7f3e05f6d279]
[2022-08-08T22:58:01.868Z] #16: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x1498c0) [0x7f3e05f6d8c0]
[2022-08-08T22:58:01.868Z] #17: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x1483f3) [0x7f3e05f6c3f3]
[2022-08-08T22:58:01.868Z] #18: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x1488d2) [0x7f3e05f6c8d2]
[2022-08-08T22:58:01.868Z] #19: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x148982) [0x7f3e05f6c982]
[2022-08-08T22:58:01.868Z] #20: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9prt29.so(+0x2b573) [0x7f3e0c90b573]
[2022-08-08T22:58:01.868Z] #21: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x148db2) [0x7f3e05f6cdb2]
[2022-08-08T22:58:01.868Z] #22: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9thr29.so(+0xe4f2) [0x7f3e0c6d34f2]
[2022-08-08T22:58:01.868Z] #23: /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba) [0x7f3e0e6cf6ba]
[2022-08-08T22:58:01.868Z] #24: /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f3e0dff051d]
[2022-08-08T22:58:01.868Z] 
[2022-08-08T22:58:01.868Z] #0: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x8af2b5) [0x7f3e066d32b5]
[2022-08-08T22:58:01.868Z] #1: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x8ba660) [0x7f3e066de660]
[2022-08-08T22:58:01.869Z] #2: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x1369f9) [0x7f3e05f5a9f9]
[2022-08-08T22:58:01.869Z] #3: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9prt29.so(+0x2aa3a) [0x7f3e0c90aa3a]
[2022-08-08T22:58:01.869Z] #4: /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390) [0x7f3e0e6d9390]
[2022-08-08T22:58:01.869Z] #5: /lib/x86_64-linux-gnu/libpthread.so.0(raise+0x29) [0x7f3e0e6d9269]
[2022-08-08T22:58:01.869Z] #6: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x5852b7) [0x7f3e063a92b7]
[2022-08-08T22:58:01.869Z] #7: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x585342) [0x7f3e063a9342]
[2022-08-08T22:58:01.869Z] #8: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x206944) [0x7f3e0602a944]
[2022-08-08T22:58:01.869Z] #9: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x443177) [0x7f3e06267177]
[2022-08-08T22:58:01.869Z] #10: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x443c33) [0x7f3e06267c33]
[2022-08-08T22:58:01.869Z] #11: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x443c5f) [0x7f3e06267c5f]
[2022-08-08T22:58:01.869Z] #12: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x44bd9f) [0x7f3e0626fd9f]
[2022-08-08T22:58:01.869Z] #13: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x2824ed) [0x7f3e060a64ed]
[2022-08-08T22:58:01.869Z] #14: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x55c529) [0x7f3e06380529]
[2022-08-08T22:58:01.869Z] #15: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x54285c) [0x7f3e0636685c]
[2022-08-08T22:58:01.869Z] #16: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x14aaef) [0x7f3e05f6eaef]
[2022-08-08T22:58:01.869Z] #17: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x14bb54) [0x7f3e05f6fb54]
[2022-08-08T22:58:01.869Z] #18: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9prt29.so(+0x2b573) [0x7f3e0c90b573]
[2022-08-08T22:58:01.869Z] #19: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x149279) [0x7f3e05f6d279]
[2022-08-08T22:58:01.869Z] #20: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x1498c0) [0x7f3e05f6d8c0]
[2022-08-08T22:58:01.869Z] #21: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x1483f3) [0x7f3e05f6c3f3]
[2022-08-08T22:58:01.869Z] #22: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x1488d2) [0x7f3e05f6c8d2]
[2022-08-08T22:58:01.869Z] #23: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x148982) [0x7f3e05f6c982]
[2022-08-08T22:58:01.869Z] #24: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9prt29.so(+0x2b573) [0x7f3e0c90b573]
[2022-08-08T22:58:01.869Z] #25: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9jit29.so(+0x148db2) [0x7f3e05f6cdb2]
[2022-08-08T22:58:01.869Z] #26: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/lib/default/libj9thr29.so(+0xe4f2) [0x7f3e0c6d34f2]
[2022-08-08T22:58:01.869Z] #27: /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba) [0x7f3e0e6cf6ba]
[2022-08-08T22:58:01.869Z] #28: /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f3e0dff051d]
[2022-08-08T22:58:01.869Z] Unhandled exception
[2022-08-08T22:58:01.869Z] Type=Unhandled trap vmState=0x00050080
[2022-08-08T22:58:01.869Z] J9Generic_Signal_Number=00000108 Signal_Number=00000005 Error_Value=00000000 Signal_Code=fffffffa
[2022-08-08T22:58:01.869Z] Handler1=00007F3E0CBAFF50 Handler2=00007F3E0C90A810
[2022-08-08T22:58:01.869Z] RDI=00000000000045B8 RSI=00000000000045BB RAX=0000000000000000 RBX=00007F3E080EBCD0
[2022-08-08T22:58:01.869Z] RCX=00007F3E0E6D9269 RDX=0000000000000005 R8=000000000000FFFF R9=0000000000000001
[2022-08-08T22:58:01.869Z] R10=00007F3E0DF75370 R11=0000000000000206 R12=00007F3C7BFFA830 R13=00007F3C426155D0
[2022-08-08T22:58:01.869Z] R14=00007F3E080EBCD0 R15=0000000000000000
[2022-08-08T22:58:01.869Z] RIP=00007F3E0E6D9269 GS=0000 FS=0000 RSP=00007F3C6BF6D3F8
[2022-08-08T22:58:01.869Z] EFlags=0000000000000206 CS=0033 RBP=0000000012BFFF10 ERR=0000000000000007
[2022-08-08T22:58:01.869Z] TRAPNO=000000000000000E OLDMASK=0000000000000000 CR2=00007FEC08B6D080
[2022-08-08T22:58:01.869Z] xmm0 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2022-08-08T22:58:01.869Z] xmm1 3933373237343939 (f: 926169408.000000, d: 3.700792e-33)
[2022-08-08T22:58:01.869Z] xmm2 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2022-08-08T22:58:01.869Z] xmm3 ffff000000000000 (f: 0.000000, d: -nan)
[2022-08-08T22:58:01.869Z] xmm4 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2022-08-08T22:58:01.869Z] xmm5 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2022-08-08T22:58:01.869Z] xmm6 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2022-08-08T22:58:01.869Z] xmm7 00007f3c6bf76f50 (f: 1811378048.000000, d: 6.911854e-310)
[2022-08-08T22:58:01.869Z] xmm8 6f6c2f6c6974752f (f: 1769239808.000000, d: 5.341566e+228)
[2022-08-08T22:58:01.870Z] xmm9 3f40520c1c0c1c38 (f: 470555712.000000, d: 4.980621e-04)
[2022-08-08T22:58:01.870Z] xmm10 3b460f0c1b460e07 (f: 457575936.000000, d: 3.649319e-23)
[2022-08-08T22:58:01.870Z] xmm11 000000003c075284 (f: 1007112832.000000, d: 4.975799e-315)
[2022-08-08T22:58:01.870Z] xmm12 0000000040400000 (f: 1077936128.000000, d: 5.325712e-315)
[2022-08-08T22:58:01.870Z] xmm13 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2022-08-08T22:58:01.870Z] xmm14 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2022-08-08T22:58:01.870Z] xmm15 0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2022-08-08T22:58:01.870Z] Module=/lib/x86_64-linux-gnu/libpthread.so.0
[2022-08-08T22:58:01.870Z] Module_base_address=00007F3E0E6C8000 Symbol=raise
[2022-08-08T22:58:01.870Z] Symbol_address=00007F3E0E6D9240
[2022-08-08T22:58:01.870Z] 
[2022-08-08T22:58:01.870Z] Method_being_compiled=sun/util/locale/LanguageTag.parseVariants(Lsun/util/locale/StringTokenIterator;Lsun/util/locale/ParseStatus;)Z
[2022-08-08T22:58:01.870Z] Target=2_90_20220808_75 (Linux 4.4.0-170-generic)
[2022-08-08T22:58:01.870Z] CPU=amd64 (4 logical CPUs) (0x5e2f07000 RAM)
[2022-08-08T22:58:01.870Z] ----------- Stack Backtrace -----------
[2022-08-08T22:58:01.870Z] raise+0x29 (0x00007F3E0E6D9269 [libpthread.so.0+0x11269])
[2022-08-08T22:58:01.870Z] _ZN2TR4trapEv+0x47 (0x00007F3E063A92B7 [libj9jit29.so+0x5852b7])
[2022-08-08T22:58:01.870Z]  (0x00007F3E063A9342 [libj9jit29.so+0x585342])
[2022-08-08T22:58:01.870Z] _ZN16TR_J9SharedCache30offsetInSharedCacheFromPointerEPv.localalias.284+0xa4 (0x00007F3E0602A944 [libj9jit29.so+0x206944])
[2022-08-08T22:58:01.870Z] _ZN20TR_IPBCDataCallGraph20createPersistentCopyEP16TR_J9SharedCacheP24TR_IPBCDataStorageHeaderPN2TR14PersistentInfoE+0x1e7 (0x00007F3E06267177 [libj9jit29.so+0x443177])
[2022-08-08T22:58:01.870Z] _ZN12TR_IProfiler17createBalancedBSTEPmiimPN2TR11CompilationE+0xc3 (0x00007F3E06267C33 [libj9jit29.so+0x443c33])
[2022-08-08T22:58:01.870Z] _ZN12TR_IProfiler17createBalancedBSTEPmiimPN2TR11CompilationE+0xef (0x00007F3E06267C5F [libj9jit29.so+0x443c5f])
[2022-08-08T22:58:01.870Z] _ZN12TR_IProfiler19persistIprofileInfoEPN2TR20ResolvedMethodSymbolEP17TR_ResolvedMethodPNS0_11CompilationE+0x5ef (0x00007F3E0626FD9F [libj9jit29.so+0x44bd9f])
[2022-08-08T22:58:01.870Z] _ZN24TR_J9ByteCodeIlGenerator5genILEv+0x1ad (0x00007F3E060A64ED [libj9jit29.so+0x2824ed])
[2022-08-08T22:58:01.870Z] _ZN3OMR20ResolvedMethodSymbol5genILEP11TR_FrontEndPN2TR11CompilationEPNS3_20SymbolReferenceTableERNS3_12IlGenRequestE+0x2a9 (0x00007F3E06380529 [libj9jit29.so+0x55c529])
[2022-08-08T22:58:01.870Z] _ZN3OMR11Compilation7compileEv+0x1dc (0x00007F3E0636685C [libj9jit29.so+0x54285c])
[2022-08-08T22:58:01.870Z] _ZN2TR28CompilationInfoPerThreadBase7compileEP10J9VMThreadPNS_11CompilationEP17TR_ResolvedMethodR11TR_J9VMBaseP19TR_OptimizationPlanRKNS_16SegmentAllocatorE+0x4bf (0x00007F3E05F6EAEF [libj9jit29.so+0x14aaef])
[2022-08-08T22:58:01.870Z] _ZN2TR28CompilationInfoPerThreadBase14wrappedCompileEP13J9PortLibraryPv+0x314 (0x00007F3E05F6FB54 [libj9jit29.so+0x14bb54])
[2022-08-08T22:58:01.870Z] omrsig_protect+0x1e3 (0x00007F3E0C90B573 [libj9prt29.so+0x2b573])
[2022-08-08T22:58:01.870Z] _ZN2TR28CompilationInfoPerThreadBase7compileEP10J9VMThreadP21TR_MethodToBeCompiledRN2J917J9SegmentProviderE+0x309 (0x00007F3E05F6D279 [libj9jit29.so+0x149279])
[2022-08-08T22:58:01.870Z] _ZN2TR24CompilationInfoPerThread12processEntryER21TR_MethodToBeCompiledRN2J917J9SegmentProviderE+0x1c0 (0x00007F3E05F6D8C0 [libj9jit29.so+0x1498c0])
[2022-08-08T22:58:01.870Z] _ZN2TR24CompilationInfoPerThread14processEntriesEv+0x3b3 (0x00007F3E05F6C3F3 [libj9jit29.so+0x1483f3])
[2022-08-08T22:58:01.870Z] _ZN2TR24CompilationInfoPerThread3runEv+0x42 (0x00007F3E05F6C8D2 [libj9jit29.so+0x1488d2])
[2022-08-08T22:58:01.870Z] _Z30protectedCompilationThreadProcP13J9PortLibraryPN2TR24CompilationInfoPerThreadE+0x82 (0x00007F3E05F6C982 [libj9jit29.so+0x148982])
[2022-08-08T22:58:01.870Z] omrsig_protect+0x1e3 (0x00007F3E0C90B573 [libj9prt29.so+0x2b573])
[2022-08-08T22:58:01.870Z] _Z21compilationThreadProcPv+0x1d2 (0x00007F3E05F6CDB2 [libj9jit29.so+0x148db2])
[2022-08-08T22:58:01.870Z] thread_wrapper+0x162 (0x00007F3E0C6D34F2 [libj9thr29.so+0xe4f2])
[2022-08-08T22:58:01.870Z] start_thread+0xca (0x00007F3E0E6CF6BA [libpthread.so.0+0x76ba])
[2022-08-08T22:58:01.870Z] clone+0x6d (0x00007F3E0DFF051D [libc.so.6+0x10751d])
[2022-08-08T22:58:01.870Z] ---------------------------------------
[2022-08-08T22:58:01.870Z] JVMDUMP039I Processing dump event "gpf", detail "" at 2022/08/08 18:58:01 - please wait.
...

@mpirvu
Copy link
Contributor

mpirvu commented Aug 9, 2022

I'll have a look as the failure looks related to my changes.

@mpirvu
Copy link
Contributor

mpirvu commented Aug 9, 2022

I talked to Irwin and he doesn't see how the pointer we get from rememberClass() can be outside the SCC bounds.
I speculated that this may somehow happen in CRIU mode if we are unlucky to checkpoint at the wrong moment, but that doesn't seem to be possible.

@ymanton
Copy link
Member Author

ymanton commented Aug 9, 2022

It doesn't look like this test does any checkpointing at all.

@mpirvu
Copy link
Contributor

mpirvu commented Aug 10, 2022

Tried to reproduce this problem here: https://openj9-jenkins.osuosl.org/job/Grinder/1240/ but tests passed

@mpirvu
Copy link
Contributor

mpirvu commented Aug 10, 2022

50 runs of the problematic test passed (https://openj9-jenkins.osuosl.org/job/Grinder/1243/).
Irwin also pointed out that the address flagged by the assert is actually within SCC bounds, so at this point we cannot explain the assert.
This PR can be delivered.

@tajila
Copy link
Contributor

tajila commented Aug 10, 2022

19:10:31  Testing: Create CRIU checkpoint image and restore three times - testSystemNanoTimeJitPreCheckpointCompile
19:10:31  Test start time: 2022/08/08 19:10:31 Eastern Standard Time
19:10:31  Running command: bash /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/aqa-tests/TKG/../../jvmtest/functional/cmdLineTests/criu/criuScript.sh /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/aqa-tests/TKG/../../jvmtest/functional/cmdLineTests/criu /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/bin/java " -Xjit -XX:+CRIURestoreNonPortableMode " "org.openj9.criu.TimeChangeTest testSystemNanoTimeJitPreCheckpointCompile" 3 3 false
19:10:31  Time spent starting: 8 milliseconds
19:10:39  Time spent executing: 6957 milliseconds
19:10:39  Test result: PASSED
19:10:39  
19:10:39  Testing: Create CRIU checkpoint image and restore three times - testSystemNanoTimeJitPostCheckpointCompile
19:10:39  Test start time: 2022/08/08 19:10:38 Eastern Standard Time
19:10:39  Running command: bash /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/aqa-tests/TKG/../../jvmtest/functional/cmdLineTests/criu/criuScript.sh /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/aqa-tests/TKG/../../jvmtest/functional/cmdLineTests/criu /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_x86-64_linux_criu_Personal_testList_1/openjdkbinary/j2sdk-image/bin/java " -Xjit -XX:+CRIURestoreNonPortableMode " "org.openj9.criu.TimeChangeTest testSystemNanoTimeJitPostCheckpointCompile" 3 3 false
19:10:39  Time spent starting: 7 milliseconds
19:10:45  Time spent executing: 6958 milliseconds
19:10:45  Test result: PASSED
19:10:45  

All new criu tests are working as expected.

Will merge now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CRIU java_lang_System_nanoTime doesn't invoke j9time_nano_time and miss NANO_TIME_ADJUSTMENT w/ -Xjit:count=0
7 participants