Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-23346

RocksDBStateBackend may core dump in flink_compactionfilterjni.cc

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.14.0, 1.13.1, 1.12.4
    • Fix Version/s: None
    • Labels:
      None

      Description

      The code in flink_compactionfilte.cpp 

          inline void CheckAndRethrowException(JNIEnv* env) const {
          if (env->ExceptionCheck()) {
            env->ExceptionDescribe();
            env->Throw(env->ExceptionOccurred());
          }
      

      may core dump in some sence, please see more information here[1][2][3]

      We can fix it by changing this to

          inline void CheckAndRethrowException(JNIEnv* env) const {
          if (env->ExceptionCheck()) {
            env->Throw(env->ExceptionOccurred());
          }
        }
      

      or

         inline void CheckAndRethrowException(JNIEnv* env) const {
          if (env->ExceptionCheck()) {
            jobject obj = env->ExceptionOccurred();
            env->ExceptionDescribe();
            env->Throw(obj);
          }
        }
      

      [1] https://stackoverflow.com/questions/30971068/does-jniexceptiondescribe-implicitily-clear-the-exception-trace-of-the-jni-env
      [2] https://bugs.openjdk.java.net/browse/JDK-4067541
      [3] https://bugs.openjdk.java.net/browse/JDK-8051947

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              klion26 Congxian Qiu
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: