[drlvm][jni] Summary of Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-15 Thread Geir Magnusson Jr
So to summarize so we can close this. I assume that we all agree that the JNI spec is lacking, and that we should follow the RI as it's reasonable behavior. Gregory has added a patch to HARMONY-1156 and I'm going to accept and apply that. If there is any opposition, please speak now. geir Ivan

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-15 Thread Ivan Volosyuk
+1 for the following check: a) offset is negative or b) len is negative or c) off + len > buff.length -- Ivan On 8/14/06, Geir Magnusson Jr <[EMAIL PROTECTED]> wrote: Ivan Volosyuk wrote: > It looks like that it is possible to get zero bytes even at the very > end of array. IMHO the order of

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-15 Thread Gregory Shimansky
2006/8/15, Jimmy, Jing Lv <[EMAIL PROTECTED]>: IMHO our Compatibility guidelines, if the spec is not clear, we should follow RI. So no matter what happens to the spec(unless it describe the detail condition of exception-thrown), it is still OK to follow RI here, am I right? Ok you didn't

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Paulex Yang
Gregory Shimansky wrote: On Monday 14 August 2006 23:37 Geir Magnusson Jr wrote: I've written a test [1] myself and cannot say I completely understand the result. With length = 0 RI 1.5 allows calling to GetArrayRegion with start equal to array length but throws AIOOBE if start is greater tha

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Geir Magnusson Jr
Gregory Shimansky wrote: > On Monday 14 August 2006 23:37 Geir Magnusson Jr wrote: >>> I've written a test [1] myself and cannot say I completely understand the >>> result. With length = 0 RI 1.5 allows calling to GetArrayRegion >>> with start equal to array length but throws AIOOBE if start is g

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Paulex Yang
Please correct me if I'm wrong, I thought what you mentioned as "compatibility guideline" is this[1], as the url shows, it's so far only classlib compatibility guideline, though I guess most of them makes sense for VM, but we may need some discussion to decide, let the VM developers speak for t

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Jimmy, Jing Lv
Gregory Shimansky wrote: On Monday 14 August 2006 23:37 Geir Magnusson Jr wrote: I've written a test [1] myself and cannot say I completely understand the result. With length = 0 RI 1.5 allows calling to GetArrayRegion with start equal to array length but throws AIOOBE if start is greater than a

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Gregory Shimansky
On Monday 14 August 2006 23:37 Geir Magnusson Jr wrote: > > I've written a test [1] myself and cannot say I completely understand the > > result. With length = 0 RI 1.5 allows calling to GetArrayRegion > > with start equal to array length but throws AIOOBE if start is greater > > than array length.

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Geir Magnusson Jr
Gregory Shimansky wrote: > On Monday 14 August 2006 20:13 Geir Magnusson Jr wrote: >> Ivan Volosyuk wrote: >>> It looks like that it is possible to get zero bytes even at the very >>> end of array. IMHO the order of boundary checks makes sense here. >> This is an interesting problem. The JNI spec

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Gregory Shimansky
On Monday 14 August 2006 20:13 Geir Magnusson Jr wrote: > Ivan Volosyuk wrote: > > It looks like that it is possible to get zero bytes even at the very > > end of array. IMHO the order of boundary checks makes sense here. > > This is an interesting problem. The JNI spec is clear that we should > th

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Geir Magnusson Jr
Ivan Volosyuk wrote: > It looks like that it is possible to get zero bytes even at the very > end of array. IMHO the order of boundary checks makes sense here. This is an interesting problem. The JNI spec is clear that we should throw an exception when one of the indexes isn't valid, and start =

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-12 Thread Ivan Volosyuk
It looks like that it is possible to get zero bytes even at the very end of array. IMHO the order of boundary checks makes sense here. -- Ivan On 8/11/06, Gregory Shimansky <[EMAIL PROTECTED]> wrote: 2006/8/11, Jimmy, Jing Lv <[EMAIL PROTECTED]>: > > Hi, > > As discussed in the former threa

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-11 Thread Gregory Shimansky
2006/8/11, Jimmy, Jing Lv <[EMAIL PROTECTED]>: Hi, As discussed in the former thread, I find that a JNI of DRLVM (GetByteArrayRegion) differs from RI in passing parameter (byte[count],count,0). RI (and J9 VM) returns immediately but DRLVM throws an ArrayIndexOutOfBoundsException. IMHO

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-11 Thread Geir Magnusson Jr
I think we should just fix it in DRLVM, although performance-wise, wouldn't also fixing in Java make sense too? As Tim said, raise a JIRA. geir Jimmy, Jing Lv wrote: > Hi, > > As discussed in the former thread, I find that a JNI of DRLVM > (GetByteArrayRegion) differs from RI in passing pa

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-11 Thread Tim Ellison
Jimmy, Jing Lv wrote: > Hi, > > As discussed in the former thread, I find that a JNI of DRLVM > (GetByteArrayRegion) differs from RI in passing parameter > (byte[count],count,0). RI (and J9 VM) returns immediately but DRLVM > throws an ArrayIndexOutOfBoundsException. > IMHO, it is better t

[DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-10 Thread Jimmy, Jing Lv
Hi, As discussed in the former thread, I find that a JNI of DRLVM (GetByteArrayRegion) differs from RI in passing parameter (byte[count],count,0). RI (and J9 VM) returns immediately but DRLVM throws an ArrayIndexOutOfBoundsException. IMHO, it is better to improve here, make it follow R