Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 53470 invoked from network); 12 Oct 2006 12:20:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Oct 2006 12:20:54 -0000 Received: (qmail 57504 invoked by uid 500); 12 Oct 2006 12:20:42 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 57460 invoked by uid 500); 12 Oct 2006 12:20:41 -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 57181 invoked by uid 99); 12 Oct 2006 12:20:40 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 05:20:40 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of oleg.v.khaschansky@gmail.com designates 64.233.182.189 as permitted sender) Received: from [64.233.182.189] (HELO nf-out-0910.google.com) (64.233.182.189) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 05:20:37 -0700 Received: by nf-out-0910.google.com with SMTP id c29so1032290nfb for ; Thu, 12 Oct 2006 05:20:16 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=pdorxB+8xkVUsD/DpxJQpRydABBCy0LCbx73TJTHqx4NJugU4y+Mv5uyQl3MYaDucaWQVMuB226te+/V4FNlxN4Myet6AY9vgn0g3QFzw05YMnCsTAOsgn9OqCKZaGAfHaQLWqSSD+l3UWg8H6nzhdwP9rCmucUT9Y8I7FcFGf0= Received: by 10.78.136.9 with SMTP id j9mr2162202hud; Thu, 12 Oct 2006 05:20:15 -0700 (PDT) Received: by 10.78.185.10 with HTTP; Thu, 12 Oct 2006 05:20:15 -0700 (PDT) Message-ID: <26c14c2a0610120520j1e8a2117w7ea03ffeadc5975b@mail.gmail.com> Date: Thu, 12 Oct 2006 16:20:15 +0400 From: "Oleg Khaschansky" To: harmony-dev@incubator.apache.org Subject: Re: ICU4C gurus? (was: [jira] Commented: (HARMONY-100) text/BidiWrapper issue?) In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N What exactly your code is? It, probably, may rearrange the levels if you didn't explicitely set them for all the characters including trailing whitespace. If this is the case it may add some additional levels and relocate the array. Could you check if the size of the array changed? On 10/12/06, Alexey Petrenko wrote: > Is any ICU4C gurus here? > > I'm setting an embedding levels pointer with ubidi_setPara method. And > it seems that ubidi_getLevels returns not the same pointer. > > Is this correct feeling or am I doing something wrong? > > SY, Alexey > > > 2006/10/11, Alexey Petrenko (JIRA) : > > [ http://issues.apache.org/jira/browse/HARMONY-100?page=comments#action_12441378 ] > > > > Alexey Petrenko commented on HARMONY-100: > > ----------------------------------------- > > > > I agree with Tim's suggestion and will create a patch. > > > > > text/BidiWrapper issue? > > > ----------------------- > > > > > > Key: HARMONY-100 > > > URL: http://issues.apache.org/jira/browse/HARMONY-100 > > > Project: Harmony > > > Issue Type: Bug > > > Components: Classlib > > > 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 > > > > > > > > > -- > Alexey A. Petrenko > Intel Middleware Products Division > > --------------------------------------------------------------------- > Terms of use : http://incubator.apache.org/harmony/mailing.html > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org > For additional commands, e-mail: harmony-dev-help@incubator.apache.org > > --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org For additional commands, e-mail: harmony-dev-help@incubator.apache.org