You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/08/30 06:19:00 UTC

[jira] [Commented] (IMPALA-7421) Static methods called with wrong JNI function

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

ASF subversion and git services commented on IMPALA-7421:
---------------------------------------------------------

Commit 547423007b82c8181be277842f092bfd86f5b720 in impala's branch refs/heads/master from [~tlipcon]
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=5474230 ]

IMPALA-7421. Static methods use wrong JNI call function

Various places throughout the code were using the JNI CallObjectMethod
function when in fact they should have been using
CallStaticObjectMethod. It appears that this doesn't cause crashes in
release builds, but if running with -Xcheck:jni, it causes an assertion
failure:

   guarantee(method->size_of_parameters() == size_of_parameters())
      failed: wrong no. of arguments pushed

This patch cleans up JniUtil a bit to add a "fluent" style utility for
calling JNI functions. This calling style should make the above mistake
more obvious because it forces the caller to write 'on_class(...)' for
static methods and 'on_instance(...)' for instance methods.

Change-Id: If7cde6ca91613b63afe5307f4d819fb24cb17fd6
Reviewed-on: http://gerrit.cloudera.org:8080/11181
Reviewed-by: Bharath Vissapragada <bh...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> Static methods called with wrong JNI function
> ---------------------------------------------
>
>                 Key: IMPALA-7421
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7421
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 3.0
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Major
>             Fix For: Impala 3.1.0
>
>
> There are various static Java methods which are loaded with JniUtil::LoadStaticJniMethod. Many of them are then called using 'CallObjectMethod' instead of the appropriate 'CallStaticObjectMethod'. This seems to cause crashes when running with -Xcheck:jni



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org