You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Congxian Qiu (Jira)" <ji...@apache.org> on 2021/10/24 12:44:00 UTC

[jira] [Commented] (FLINK-23346) RocksDBStateBackend may core dump in flink_compactionfilterjni.cc

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

Congxian Qiu commented on FLINK-23346:
--------------------------------------

[~yunta] sorry for the late reply. we don't notice the use exception from last time. But I think we should fix the problem here in any reason, because this could cause the core dump whatever the user exception is. and there will be many local files leak on the tm side when the core dump happens.

> 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.3.4#803005)