Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 53863 invoked from network); 17 Feb 2006 08:58:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Feb 2006 08:58:56 -0000 Received: (qmail 20077 invoked by uid 500); 17 Feb 2006 08:58:51 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 20017 invoked by uid 500); 17 Feb 2006 08:58:50 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 20005 invoked by uid 99); 17 Feb 2006 08:58:50 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Feb 2006 00:58:48 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 1B2FADD for ; Fri, 17 Feb 2006 09:58:27 +0100 (CET) Message-ID: <1060066071.1140166707109.JavaMail.jira@ajax.apache.org> Date: Fri, 17 Feb 2006 09:58:27 +0100 (CET) From: "Vladimir Gorr (JIRA)" To: harmony-dev@incubator.apache.org Subject: [jira] Created: (HARMONY-100) text/BidiWrapper issue? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N text/BidiWrapper issue? ----------------------- Key: HARMONY-100 URL: http://issues.apache.org/jira/browse/HARMONY-100 Project: Harmony Type: Bug Reporter: Vladimir Gorr Let's consider the following test: import java.text.Bidi; public class Test { public static void main(String[] args) throws Exception { Bidi bd = new Bidi(new char[] { 's', 's', 's' }, 0, new byte[] { (byte) -7, (byte) -2, (byte) -3 }, 0, 3, Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT); System.out.println("Expected 7, real " + " " + bd.getLevelAt(0)); } } In my opinion the JNI implementation of Bidi (text/BidiWrapper.c file, ubidi_1setPara() function) contains a potential bug, namely: 1. If the embeddingLevels argument is not NULL then _embeddingLevels variable is initialized with the JNI GetByteArrayElements() function; 2. ICU function (ubidi_setPara) initializes ICU inner structure and puts the _embeddingLevels into it; 3. If _embeddingLevels pointer is not NULL then the JNI ReleaseByteArrayElements() function (with 0 as fourth parameter) is called. This function releases the memory (according to JNI specification) the _embeddingLevels pointer refers to; 4. After that ICU inner structure isn't initialized properly. Call of ICU ubidi_getLevels() function can return incorrect values (see java test above). It seems the JNI_COMMIT parameter instead of "0" should be passed to the ReleaseByteArrayElements() to avoid this problem. I'd like to underline the test mentioned above works w/o any issues for Harmony-14 contribution (although it shouldn't sometimes IMHO). Therefore if there are any doubts in my argumentation this issue can be closed as invalid. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira