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

JIT assertion failure during Jenkins builds on AIX doesn't produce crash data #16651

Open
jdmpapin opened this issue Feb 2, 2023 · 0 comments

Comments

@jdmpapin
Copy link
Contributor

jdmpapin commented Feb 2, 2023

In #16426 I have been testing some changes to build.groovy that detect when the VM has crashed during the build and collect the relevant binaries into the diagnostics tarball. To test it, I introduced a commit that intentionally fails an assertion in the JIT compiler as soon as it tries to generate IL for any method. Here's my most recent revision of that commit:

commit 57de7bcf28b817ca2c4444f338e3f8292938c947
Author: Devin Papineau <devin@ajdmp.ca>
Date:   Mon Dec 12 15:15:40 2022 -0500

    X intentionally crash the JVM in every compilation
    
    In particular, it should crash during builds in Jenkins.

diff --git runtime/compiler/ilgen/Walker.cpp runtime/compiler/ilgen/Walker.cpp
index d56238f8b..485ef9764 100644
--- runtime/compiler/ilgen/Walker.cpp
+++ runtime/compiler/ilgen/Walker.cpp
@@ -50,6 +50,8 @@
 #include "infra/Bit.hpp"               //for trailingZeroes
 #include "env/JSR292Methods.h"
 
+#include "AtomicSupport.hpp"
+
 #if defined(J9VM_OPT_JITSERVER)
 #include "env/j9methodServer.hpp"
 #endif
@@ -186,6 +188,18 @@ static TR::ILOpCodes getCallOpForType(TR::DataType type)
 
 TR::Block * TR_J9ByteCodeIlGenerator::walker(TR::Block * prevBlock)
    {
+   static const bool crash = feGetEnv("TR_dontCrash") == NULL;
+   if (crash)
+      {
+      // Set the flag to 1. If the previous value was 0, we won the race and
+      // this is the compilation that should crash.
+      static volatile uintptr_t flag = 0;
+      if (VM_AtomicSupport::lockExchange(&flag, 1) == 0)
+         {
+         TR_ASSERT_FATAL(false, "oh no, the JVM crashed!");
+         }
+      }
+
    int32_t i, lastIndex = _bcIndex, firstIndex = _bcIndex;
 
    if (comp()->getOption(TR_TraceILGen))

But when testing on AIX, the resulting crashes during the build did not produce any crash data, i.e. core, javacore, snap trace, jitdump. See these comments:

I'm not sure how specific this issue is to Jenkins or to the JIT compiler. For example, this might also happen outside of Jenkins, and it might also happen for crashes elsewhere in the VM - I haven't checked. If the issue turns out to be a bit more general, we can edit the title of this issue accordingly.

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

No branches or pull requests

3 participants