[ 
https://issues.apache.org/jira/browse/FLINK-23346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17781310#comment-17781310
 ] 

Zakelly Lan commented on FLINK-23346:
-------------------------------------

The core dump is caused by the JNI implementation clear the exception in 
ExceptionDescribe while we still try to get the exception later. So whatever 
the exception is, the frocksdb should avoid this.

This problem is still valid now.

> RocksDBStateBackend may core dump in flink_compactionfilterjni.cc
> -----------------------------------------------------------------
>
>                 Key: FLINK-23346
>                 URL: https://issues.apache.org/jira/browse/FLINK-23346
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / State Backends
>    Affects Versions: 1.14.0, 1.13.1, 1.12.4
>            Reporter: Congxian Qiu
>            Priority: Major
>
> The code in [flink_compactionfilte.cpp 
> |https://github.com/ververica/frocksdb/blob/49bc897d5d768026f1eb816d960c1f2383396ef4/java/rocksjni/flink_compactionfilterjni.cc#L21]
> {code:cpp}
>     inline void CheckAndRethrowException(JNIEnv* env) const {
>     if (env->ExceptionCheck()) {
>       env->ExceptionDescribe();
>       env->Throw(env->ExceptionOccurred());
>     }
> {code}
> may core dump in some sence, please see more information here[1][2][3]
> We can fix it by changing this to
> {code:cpp}
>     inline void CheckAndRethrowException(JNIEnv* env) const {
>     if (env->ExceptionCheck()) {
>       env->Throw(env->ExceptionOccurred());
>     }
>   }
> {code}
> or
> {code:cpp}
>    inline void CheckAndRethrowException(JNIEnv* env) const {
>     if (env->ExceptionCheck()) {
>       jobject obj = env->ExceptionOccurred();
>       env->ExceptionDescribe();
>       env->Throw(obj);
>     }
>   }
> {code}
> [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]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to