You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ray Chen (JIRA)" <ji...@apache.org> on 2009/12/21 04:06:18 UTC

[jira] Created: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

[classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
---------------------------------------------------------------------------

                 Key: HARMONY-6408
                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Ray Chen


Following is the exception trace:
java.nio.BufferOverflowException

java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
at java.io.Writer.write(Writer.java:98)
at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
Caused by: java.nio.BufferOverflowException
at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)

In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
If I set the encoder to "ISO8859_1" the test passed.
So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by "Ray Chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793892#action_12793892 ] 

Ray Chen commented on HARMONY-6408:
-----------------------------------

Hi Regis,
I think 1 and 2 are related to this issue, so shall I modify the patch
and open another JIRA to track 3?




-- 
Regards,

Ray Chen


> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>         Attachments: Harmony-6408.diff
>
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Regis Xu resolved HARMONY-6408.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0M12

Ray, Thanks for your explanation.

The patch was applied at r893377, please verify.

> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>            Assignee: Regis Xu
>             Fix For: 5.0M12
>
>         Attachments: Harmony-6408.diff
>
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793914#action_12793914 ] 

Regis Xu commented on HARMONY-6408:
-----------------------------------

It would be taken into java6 in the next merge I think.

> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>            Assignee: Regis Xu
>             Fix For: 5.0M12
>
>         Attachments: Harmony-6408.diff
>
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by "Ray Chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793891#action_12793891 ] 

Ray Chen commented on HARMONY-6408:
-----------------------------------

Hi Regis,

Let me explain more,
At first, harmony uses GB2312 on my machine which caused the test error.

Then after change the encoding mapping, uses GBK, also found the error.

So I investigated it and found that GBK and GB2312 both have bugs.

Shall I update the patch and treat them as different defect?




-- 
Regards,

Ray Chen


> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>         Attachments: Harmony-6408.diff
>
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by "Ray Chen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ray Chen closed HARMONY-6408.
-----------------------------


Patch verified. Thanks Regis.

I wonder if this fix should be merged to java6 branch?

Actually, this defect was found when I ran the java6 unit tests.

> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>            Assignee: Regis Xu
>             Fix For: 5.0M12
>
>         Attachments: Harmony-6408.diff
>
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by Ray Chen <cl...@gmail.com>.
Hi Regis,
> Do you mean the value of property "file.encoding"? It's set at
> modules/luni/src/main/native/luni/shared/luniglob.c:159

Yes, Thank you!

>
> We first check whether the value is NULL, if so, call getOSCharset to get
> default value from OS ( you can reference HARMONY-6279 for more details). I
> guess IBM vm set the value to GB18030, but drlvm doesn't set it, and then we
> use getOSCharset, get a different charset. The charset should be same with
> your local setting. According to you previous comments on JIRA, seems GB2312
> is correct.
>

For this part, the situation is a little complicated:
First use following simple test case:
public class Harmony6408TestCase {
	public static void main(String[] args) {
		System.out.println("file.encoding in java : " +
System.getProperty("file.encoding"));
	}
}

I also added some printf debug statement in luniglob.c, certainly add
to the file.encoding part as following:

       /* Many classes depend on correct "file.encoding" value */
       if(propVal != NULL){
    	   printf("file.encoding: %s\n", propVal);
       }
       if (propVal == NULL) {
           /* FIXME provide appropriate non-dummy value */
           getOSCharset(charset, CHARSETBUFF);
		   printf("charset: %s\n",charset);
           propRes = (*vmInterface)->SetSystemProperty (vmInterface,
"file.encoding", charset);
           if (VMI_ERROR_NONE != propRes) {
               /* goto fail2; */
           }
       }

I ran the test case on trunk and got the output:
file.encoding in java : null
file.encoding: GMT+8:00

I ran the test case on java6 branch and got the output:
file.encoding in java : gb2312
charset: gb2312

I think for this part java6 branch's behavior is right. In trunk,
propVal seems still holding user.timezone property which means
"(*vmInterface)->GetSystemProperty (vmInterface, "file.encoding",
&propVal);" doesn't set propVal to NULL (I think it should if it can
not get the file.encoding property);

So that we got the result,
When the test ran on the trunk, the
System.getProperty("file.encoding"); got null and in
OutputStreamWriter it uses default encoder (ISO-8859_1) which makes
the test case pass.
When the test ran on java6 branch, the
System.getProperty("file.encoding"); got GB2312, which makes the test
case failed.

So here is the question, since trunk and java6 branch shared same
DRLVM, why got different result when invoke
"(*vmInterface)->GetSystemProperty (vmInterface, "file.encoding",
&propVal);"  ?


> And I think we should fix the test not to depends on local environment.
>
Yes, I do agree, however, this issue seems that there are really some
bugs in our classlib or DRLVM code, and for Chinese users, it should
use GBK or GB18030 for default encode instead of GB2312

> --
> Best Regards,
> Regis.
>



-- 
Regards,

Ray Chen

Re: [jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by Regis <xu...@gmail.com>.
On 2009-12-21 22:07, Ray Chen wrote:
> Hi Regis,
> RI shows GBK, but harmony shows GB2312
>
> I have found that "(*vmInterface)->GetSystemProperty (vmInterface,
> "file.encoding",&propVal);"
> It get GBK when uses IBMvm, but got NULL when uses DRLVM
>
> So when used DRLVM it comes to getOSCharset() and getOSCharset()
> invoke GetLocaleInfo() in turn.
>
> You can find the details in windows/helpers.c, the cp is 936 on my
> machine and got gb2312 in charsetmap.h.
>
> So the question is change the vm GetSystemProperty, or our encoding mapping?

According to [1] CP936 equals to GBK

[1] http://msdn.microsoft.com/en-us/goglobal/bb964654.aspx

While from the mapping table [2]

[2] http://msdn.microsoft.com/en-us/library/dd317756%28VS.85%29.aspx

it's mapped to GB2312, but in Windows Control Panel->Regional and Language 
options->Advanced, CP936 is mapped to GBK.

After google, lots of people said CP936 included more character than GB2312,
so I think GBK is more reasonable.

>
> On Mon, Dec 21, 2009 at 8:48 PM, Regis<xu...@gmail.com>  wrote:
>> On 2009-12-21 19:40, Ray Chen wrote:
>>>
>>> Hi Regis,
>>>
>>> I rebuild the luni native code in trunk, and found that its behavior
>>> same as java6 now, I don't know what happened.
>>> Sorry for confusing.
>>
>> That happens often ;)
>>
>>
>> [1] is a discussion before
>>
>> [1] http://markmail.org/thread/ef4lwojc23vb6vnv
>>
>>>
>>> Now the problem is simple, I think we got GB2312 as the default encode
>>> on my machine, I will do more investigation.
>>
>> What's default encode of your OS?
>>
>>>
>>> On Mon, Dec 21, 2009 at 5:19 PM, Regis<xu...@gmail.com>    wrote:
>>>>
>>>> On 2009-12-21 15:54, Ray Chen (JIRA) wrote:
>>>>>
>>>>>      [
>>>>>
>>>>> https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793106#action_12793106
>>>>> ]
>>>>>
>>>>> Ray Chen commented on HARMONY-6408:
>>>>> -----------------------------------
>>>>>
>>>>> Hi,
>>>>> I have investigated this issue, found that if uses IBM vm, the default
>>>>> encoding on my machine is GB18030 while using DRLVM it is GB2312.
>>>>> I searched GB18030, found it on http://en.wikipedia.org/wiki/GB_18030
>>>>> which says GB2312 should be replaced with GB18030.
>>>>>
>>>>> The question is why different vm got different default file encoding?
>>>>> It seems that System.ensureProperties() got the default file encoding,
>>>>> in this function calls a static native method named "getEncoding()".
>>>>> But I can not find this native funtion in my classlib working copy.
>>>>> Does anyone know about this? Is this a classlib bug or vm bug?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> Do you mean the value of property "file.encoding"? It's set at
>>>> modules/luni/src/main/native/luni/shared/luniglob.c:159
>>>>
>>>> We first check whether the value is NULL, if so, call getOSCharset to get
>>>> default value from OS ( you can reference HARMONY-6279 for more details).
>>>> I
>>>> guess IBM vm set the value to GB18030, but drlvm doesn't set it, and then
>>>> we
>>>> use getOSCharset, get a different charset. The charset should be same
>>>> with
>>>> your local setting. According to you previous comments on JIRA, seems
>>>> GB2312
>>>> is correct.
>>>>
>>>> And I think we should fix the test not to depends on local environment.
>>>>
>>>> --
>>>> Best Regards,
>>>> Regis.
>>>>
>>>
>>>
>>>
>>
>>
>> --
>> Best Regards,
>> Regis.
>>
>
>
>


-- 
Best Regards,
Regis.

Re: [jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by Ray Chen <cl...@gmail.com>.
Hi Regis,
RI shows GBK, but harmony shows GB2312

I have found that "(*vmInterface)->GetSystemProperty (vmInterface,
"file.encoding",&propVal);"
It get GBK when uses IBMvm, but got NULL when uses DRLVM

So when used DRLVM it comes to getOSCharset() and getOSCharset()
invoke GetLocaleInfo() in turn.

You can find the details in windows/helpers.c, the cp is 936 on my
machine and got gb2312 in charsetmap.h.

So the question is change the vm GetSystemProperty, or our encoding mapping?

On Mon, Dec 21, 2009 at 8:48 PM, Regis <xu...@gmail.com> wrote:
> On 2009-12-21 19:40, Ray Chen wrote:
>>
>> Hi Regis,
>>
>> I rebuild the luni native code in trunk, and found that its behavior
>> same as java6 now, I don't know what happened.
>> Sorry for confusing.
>
> That happens often ;)
>
>
> [1] is a discussion before
>
> [1] http://markmail.org/thread/ef4lwojc23vb6vnv
>
>>
>> Now the problem is simple, I think we got GB2312 as the default encode
>> on my machine, I will do more investigation.
>
> What's default encode of your OS?
>
>>
>> On Mon, Dec 21, 2009 at 5:19 PM, Regis<xu...@gmail.com>  wrote:
>>>
>>> On 2009-12-21 15:54, Ray Chen (JIRA) wrote:
>>>>
>>>>     [
>>>>
>>>> https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793106#action_12793106
>>>> ]
>>>>
>>>> Ray Chen commented on HARMONY-6408:
>>>> -----------------------------------
>>>>
>>>> Hi,
>>>> I have investigated this issue, found that if uses IBM vm, the default
>>>> encoding on my machine is GB18030 while using DRLVM it is GB2312.
>>>> I searched GB18030, found it on http://en.wikipedia.org/wiki/GB_18030
>>>> which says GB2312 should be replaced with GB18030.
>>>>
>>>> The question is why different vm got different default file encoding?
>>>> It seems that System.ensureProperties() got the default file encoding,
>>>> in this function calls a static native method named "getEncoding()".
>>>> But I can not find this native funtion in my classlib working copy.
>>>> Does anyone know about this? Is this a classlib bug or vm bug?
>>>>
>>>>
>>>>
>>>>
>>>
>>> Do you mean the value of property "file.encoding"? It's set at
>>> modules/luni/src/main/native/luni/shared/luniglob.c:159
>>>
>>> We first check whether the value is NULL, if so, call getOSCharset to get
>>> default value from OS ( you can reference HARMONY-6279 for more details).
>>> I
>>> guess IBM vm set the value to GB18030, but drlvm doesn't set it, and then
>>> we
>>> use getOSCharset, get a different charset. The charset should be same
>>> with
>>> your local setting. According to you previous comments on JIRA, seems
>>> GB2312
>>> is correct.
>>>
>>> And I think we should fix the test not to depends on local environment.
>>>
>>> --
>>> Best Regards,
>>> Regis.
>>>
>>
>>
>>
>
>
> --
> Best Regards,
> Regis.
>



-- 
Regards,

Ray Chen

Re: [jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by Regis <xu...@gmail.com>.
On 2009-12-21 19:40, Ray Chen wrote:
> Hi Regis,
>
> I rebuild the luni native code in trunk, and found that its behavior
> same as java6 now, I don't know what happened.
> Sorry for confusing.

That happens often ;)


[1] is a discussion before

[1] http://markmail.org/thread/ef4lwojc23vb6vnv

>
> Now the problem is simple, I think we got GB2312 as the default encode
> on my machine, I will do more investigation.

What's default encode of your OS?

>
> On Mon, Dec 21, 2009 at 5:19 PM, Regis<xu...@gmail.com>  wrote:
>> On 2009-12-21 15:54, Ray Chen (JIRA) wrote:
>>>
>>>      [
>>> https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793106#action_12793106
>>> ]
>>>
>>> Ray Chen commented on HARMONY-6408:
>>> -----------------------------------
>>>
>>> Hi,
>>> I have investigated this issue, found that if uses IBM vm, the default
>>> encoding on my machine is GB18030 while using DRLVM it is GB2312.
>>> I searched GB18030, found it on http://en.wikipedia.org/wiki/GB_18030
>>> which says GB2312 should be replaced with GB18030.
>>>
>>> The question is why different vm got different default file encoding?
>>> It seems that System.ensureProperties() got the default file encoding,
>>> in this function calls a static native method named "getEncoding()".
>>> But I can not find this native funtion in my classlib working copy.
>>> Does anyone know about this? Is this a classlib bug or vm bug?
>>>
>>>
>>>
>>>
>>
>> Do you mean the value of property "file.encoding"? It's set at
>> modules/luni/src/main/native/luni/shared/luniglob.c:159
>>
>> We first check whether the value is NULL, if so, call getOSCharset to get
>> default value from OS ( you can reference HARMONY-6279 for more details). I
>> guess IBM vm set the value to GB18030, but drlvm doesn't set it, and then we
>> use getOSCharset, get a different charset. The charset should be same with
>> your local setting. According to you previous comments on JIRA, seems GB2312
>> is correct.
>>
>> And I think we should fix the test not to depends on local environment.
>>
>> --
>> Best Regards,
>> Regis.
>>
>
>
>


-- 
Best Regards,
Regis.

Re: [jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by Ray Chen <cl...@gmail.com>.
Hi Regis,

I rebuild the luni native code in trunk, and found that its behavior
same as java6 now, I don't know what happened.
Sorry for confusing.

Now the problem is simple, I think we got GB2312 as the default encode
on my machine, I will do more investigation.

On Mon, Dec 21, 2009 at 5:19 PM, Regis <xu...@gmail.com> wrote:
> On 2009-12-21 15:54, Ray Chen (JIRA) wrote:
>>
>>     [
>> https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793106#action_12793106
>> ]
>>
>> Ray Chen commented on HARMONY-6408:
>> -----------------------------------
>>
>> Hi,
>> I have investigated this issue, found that if uses IBM vm, the default
>> encoding on my machine is GB18030 while using DRLVM it is GB2312.
>> I searched GB18030, found it on http://en.wikipedia.org/wiki/GB_18030
>> which says GB2312 should be replaced with GB18030.
>>
>> The question is why different vm got different default file encoding?
>> It seems that System.ensureProperties() got the default file encoding,
>> in this function calls a static native method named "getEncoding()".
>> But I can not find this native funtion in my classlib working copy.
>> Does anyone know about this? Is this a classlib bug or vm bug?
>>
>>
>>
>>
>
> Do you mean the value of property "file.encoding"? It's set at
> modules/luni/src/main/native/luni/shared/luniglob.c:159
>
> We first check whether the value is NULL, if so, call getOSCharset to get
> default value from OS ( you can reference HARMONY-6279 for more details). I
> guess IBM vm set the value to GB18030, but drlvm doesn't set it, and then we
> use getOSCharset, get a different charset. The charset should be same with
> your local setting. According to you previous comments on JIRA, seems GB2312
> is correct.
>
> And I think we should fix the test not to depends on local environment.
>
> --
> Best Regards,
> Regis.
>



-- 
Regards,

Ray Chen

Re: [jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by Regis <xu...@gmail.com>.
On 2009-12-21 15:54, Ray Chen (JIRA) wrote:
>
>      [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793106#action_12793106 ]
>
> Ray Chen commented on HARMONY-6408:
> -----------------------------------
>
> Hi,
> I have investigated this issue, found that if uses IBM vm, the default
> encoding on my machine is GB18030 while using DRLVM it is GB2312.
> I searched GB18030, found it on http://en.wikipedia.org/wiki/GB_18030
> which says GB2312 should be replaced with GB18030.
>
> The question is why different vm got different default file encoding?
> It seems that System.ensureProperties() got the default file encoding,
> in this function calls a static native method named "getEncoding()".
> But I can not find this native funtion in my classlib working copy.
> Does anyone know about this? Is this a classlib bug or vm bug?
>
>
>
>

Do you mean the value of property "file.encoding"? It's set at 
modules/luni/src/main/native/luni/shared/luniglob.c:159

We first check whether the value is NULL, if so, call getOSCharset to get 
default value from OS ( you can reference HARMONY-6279 for more details). I 
guess IBM vm set the value to GB18030, but drlvm doesn't set it, and then we use 
getOSCharset, get a different charset. The charset should be same with your 
local setting. According to you previous comments on JIRA, seems GB2312 is correct.

And I think we should fix the test not to depends on local environment.

-- 
Best Regards,
Regis.

[jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by "Ray Chen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793106#action_12793106 ] 

Ray Chen commented on HARMONY-6408:
-----------------------------------

Hi,
I have investigated this issue, found that if uses IBM vm, the default
encoding on my machine is GB18030 while using DRLVM it is GB2312.
I searched GB18030, found it on http://en.wikipedia.org/wiki/GB_18030
which says GB2312 should be replaced with GB18030.

The question is why different vm got different default file encoding?
It seems that System.ensureProperties() got the default file encoding,
in this function calls a static native method named "getEncoding()".
But I can not find this native funtion in my classlib working copy.
Does anyone know about this? Is this a classlib bug or vm bug?




-- 
Regards,

Ray Chen


> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Regis Xu reassigned HARMONY-6408:
---------------------------------

    Assignee: Regis Xu

> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>            Assignee: Regis Xu
>         Attachments: Harmony-6408.diff
>
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Wu reassigned HARMONY-6408:
--------------------------------

    Assignee: Tony Wu  (was: Regis Xu)

> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>            Assignee: Tony Wu
>             Fix For: 5.0M12
>
>         Attachments: Harmony-6408.diff
>
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Wu reassigned HARMONY-6408:
--------------------------------

    Assignee: Regis Xu  (was: Tony Wu)

> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>            Assignee: Regis Xu
>             Fix For: 5.0M12
>
>         Attachments: Harmony-6408.diff
>
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by "Ray Chen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ray Chen updated HARMONY-6408:
------------------------------

    Attachment: Harmony-6408.diff

In the patch, I do three things:

1. Mapping 936 to GBK instead of GB2312 according to Windows Control Panel->Regional and Language options, which is as same as RI do.

2. Fix one bug in GBK encoding

3. Fix one bug in GB2312 encoding, both of them should minus bbRemaining by one after putting one byte into the buffer.

I have ran the nio, nio_char and luni test, no regression.

> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>         Attachments: Harmony-6408.diff
>
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793912#action_12793912 ] 

Hudson commented on HARMONY-6408:
---------------------------------

Integrated in Harmony-1.5-head-linux-x86_64 #586 (See [http://hudson.zones.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/586/])
    Apply patch for : [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException


> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>            Assignee: Regis Xu
>             Fix For: 5.0M12
>
>         Attachments: Harmony-6408.diff
>
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793883#action_12793883 ] 

Regis Xu commented on HARMONY-6408:
-----------------------------------

regarding 2&3, did they cause this test failure?

> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>         Attachments: Harmony-6408.diff
>
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException

Posted by "Ray Chen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ray Chen updated HARMONY-6408:
------------------------------

    Patch Info: [Patch Available]

> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>         Attachments: Harmony-6408.diff
>
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine, it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.