harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Popov" <ivan.g.po...@gmail.com>
Subject [drlvm][jni] NewGlobalRef() returns NULL for pending exception object
Date Fri, 23 Mar 2007 16:01:39 GMT
Working on HARMONY-3304 [1] I noticed problem with JNI function
NewGlobalRef() in DRLVM. If it is called for a pending exception
object before ExceptionClear() is invoked, it returns NULL, which is
interpreted as out of memory according to JNI spec [2]. This causes
errors in debug support. In Sun/BEA VM non-NULL reference is returned
in this case.

Simple workaround is to call ExceptionClear() before NewGlobalRef().
However, I'm not sure if ExceptionClear() won't dispose exception
object itself. To my mind it's better to fix NewGlobalRef() and make
it compatible with RI.

Any other opinion?

[1] https://issues.apache.org/jira/browse/HARMONY-3304
[2] http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/functions.html#NewGlobalRef

Thanks.
Ivan

Mime
View raw message