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

Calls to JNI methods with pending exceptions in calljavafunction #15

Open
GoogleCodeExporter opened this issue Mar 12, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Run unit tests with -Xcheck:jni.

What is the expected output? What do you see instead?
Expected: no warnings.
Observed: A bunch of "WARNING in native method: JNI call made with exception 
pending" log entries.

What version of the product are you using? On what operating system?
JNLua 1.0.4, Java 1.7.0_55, Windows 8.1.

Please provide any additional information below.
See [1] for a list of methods that may be called with pending exceptions. In 
particular, SetLongField (indirectly) called from [2] and NewObject called from 
[3] are not in that list. However, they are called in case of exceptions before 
the exception is cleared with ExceptionClear [4]. Some reordering of these 
calls (ExceptionClear as the first statement in the if branch, setluathread 
after it and in the (new) else branch) avoids these warnings.

Note: since they are only warnings I am not quite sure if/how they influence 
program logic.

[1] http://developer.android.com/training/articles/perf-jni.html#exceptions
[2] 
https://code.google.com/p/jnlua/source/browse/trunk/jnlua/src/main/c/jnlua.c#217
8
[3] 
https://code.google.com/p/jnlua/source/browse/trunk/jnlua/src/main/c/jnlua.c#218
7
[4] 
https://code.google.com/p/jnlua/source/browse/trunk/jnlua/src/main/c/jnlua.c#219
3

Original issue reported on code.google.com by fnuecke on 20 Aug 2014 at 12:18

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

1 participant