-
Bug
-
Resolution: Fixed
-
P2
-
1.4.2
-
09
-
generic, x86
-
generic, windows_xp
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2067032 | 5.0 | Fred Oliver | P2 | Closed | Fixed | tiger |
JDK-2067031 | 1.4.2 | Fred Oliver | P2 | Closed | Fixed | b20 |
JDK-2067030 | 1.4.1_07 | Fred Oliver | P2 | Closed | Fixed | 07 |
Calls to the JNI function Get<type>ArrayElements() normally return a
pointer to a copy of the specified array. Callers can use this pointer
to access elements of the array. If the array is empty, there are no
elements to access, and the returned pointer should not be used.
The fix for bug 4804447 handled this special (empty array) case, by
returning a pointer to an invalid page. Previously, a pointer to an
arbitrary block of memory (with zero data elements) was returned.
Unfortunately, there are one or more customer applications which
(indirectly) rely on the initial zero bytes being present. One customer
passes the zero length array to a Microsoft API (DirectDraw) which
accesses the first character in the zero length array. This is clearly
a bug in the Microsoft code. The VM needs to be compatible with this
buggy behavior to avoid breaking the customer's app.
A test case is attached. Just compile and run.
- backported by
-
JDK-2067030 Backward compatibility - jni apps need to dereference bogus returned reference
- Closed
-
JDK-2067031 Backward compatibility - jni apps need to dereference bogus returned reference
- Closed
-
JDK-2067032 Backward compatibility - jni apps need to dereference bogus returned reference
- Closed
- duplicates
-
JDK-4844193 REGRESSION: New JDK changes DLL so that Eclipse dies on startup.
- Closed
- relates to
-
JDK-4804447 JNI Get<Type>ArrayElements fails with zero length arrays.
- Closed
-
JDK-4834329 REGRESSION: Eclipse 2.1 crashes on j2sdk1.4.2-build18
- Closed