From omajid at redhat.com Thu Sep 16 12:58:42 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 16 Sep 2010 15:58:42 -0400 Subject: Request for review: Crash on XIM server restart Message-ID: <4C9276F2.1050007@redhat.com> Hi, While looking at the bug filed at https://bugzilla.redhat.com/show_bug.cgi?id=572147, I noticed that Java applications crash if IBus (an X input server) is restarted. The webrev is at http://cr.openjdk.java.net/~omajid/webrevs/crash-on-xim-server-restart/webrev.00/ The code in awt_InputMethod.c guards against the XIM server going away, but does not guard against it appearing again. When the XIM server is restarted, the X server can send async requests to call OpenXIMCallback in Java automatically: (gdb) bt #0 OpenXIMCallback (display=, client_data=, call_data=) at ../../../src/solaris/native/sun/awt/awt_InputMethod.c:1464 #1 0x00000036b406dc4f in _XimFilterPropertyNotify (display=0x7f503c0df300, window=, event=, client_data=) at imInsClbk.c:126 #2 0x00007f4ff24f0f3f in Java_sun_awt_X11_XlibWrapper_XFilterEvent ( env=, clazz=, ptr=, window=) at ../../../src/solaris/native/sun/xawt/XlibWrapper.c:486 #3 0x00007f5039010f50 in ?? () #4 0x00007f5039005953 in ?? () #5 0x0000000000000000 in ?? () This causes the X11im pointer to get initialized and the checks in getX11InputMethodData are escaped. The patch simply makes sure that the checks are not escaped by calling getX11InputMethodData in DestroyXIMCallback. Any thoughts or comments? Cheers, Omair From naoto.sato at oracle.com Thu Sep 16 14:18:06 2010 From: naoto.sato at oracle.com (Naoto Sato) Date: Thu, 16 Sep 2010 14:18:06 -0700 Subject: Request for review: Crash on XIM server restart In-Reply-To: <4C9276F2.1050007@redhat.com> References: <4C9276F2.1050007@redhat.com> Message-ID: <4C92898E.4010004@oracle.com> Hi Omair, Thank you for catching the error. I think your fix is fine but would like some comments noting that the extra call to getX11InputMethodData() in DestroyXIMCallback is merely to free up the pX11IMData, otherwise, the call is kind of cryptic. Thanks, Naoto (9/16/10 12:58 PM), Omair Majid wrote: > Hi, > > While looking at the bug filed at > https://bugzilla.redhat.com/show_bug.cgi?id=572147, I noticed that Java > applications crash if IBus (an X input server) is restarted. > > The webrev is at > http://cr.openjdk.java.net/~omajid/webrevs/crash-on-xim-server-restart/webrev.00/ > > > The code in awt_InputMethod.c guards against the XIM server going away, > but does not guard against it appearing again. When the XIM server is > restarted, the X server can send async requests to call OpenXIMCallback > in Java automatically: > (gdb) bt > #0 OpenXIMCallback (display=, > client_data=, call_data=) > at ../../../src/solaris/native/sun/awt/awt_InputMethod.c:1464 > #1 0x00000036b406dc4f in _XimFilterPropertyNotify (display=0x7f503c0df300, > window=, event=, > client_data=) at imInsClbk.c:126 > #2 0x00007f4ff24f0f3f in Java_sun_awt_X11_XlibWrapper_XFilterEvent ( > env=, clazz=, > ptr=, window=) > at ../../../src/solaris/native/sun/xawt/XlibWrapper.c:486 > #3 0x00007f5039010f50 in ?? () > #4 0x00007f5039005953 in ?? () > #5 0x0000000000000000 in ?? () > > This causes the X11im pointer to get initialized and the checks in > getX11InputMethodData are escaped. The patch simply makes sure that the > checks are not escaped by calling getX11InputMethodData in > DestroyXIMCallback. > > Any thoughts or comments? > > Cheers, > Omair From omajid at redhat.com Mon Sep 20 07:33:38 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 20 Sep 2010 14:33:38 +0000 (UTC) Subject: < i18n dev> Request for review: Crash on XIM server restart References: <4C9276F2.1050007@redhat.com> <4C92898E.4010004@oracle.com> Message-ID: Hi, Naoto Sato writes: > > Thank you for catching the error. I think your fix is fine but would > like some comments noting that the extra call to getX11InputMethodData() > in DestroyXIMCallback is merely to free up the pX11IMData, otherwise, > the call is kind of cryptic. > Thanks for reviewing the patch! Updated webrev is available at: http://cr.openjdk.java.net/~omajid/webrevs/crash-on-xim-server-restart/webrev.01/ Thanks, Omair From jawahar.samuel at gmail.com Mon Sep 20 23:22:47 2010 From: jawahar.samuel at gmail.com (samuel jawahar) Date: Tue, 21 Sep 2010 11:52:47 +0530 Subject: i18n-dev Digest, Vol 33, Issue 2 In-Reply-To: References: Message-ID: Hello All, I have a requirement that translate the number (123) to scientific standard text (one hundred and twenty three) But right now there is no such API available in JDK. Is it valid requirement? Please let me know Regards Samuel Jawahar On Tue, Sep 21, 2010 at 12:30 AM, wrote: > Send i18n-dev mailing list submissions to > i18n-dev at openjdk.java.net > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.openjdk.java.net/mailman/listinfo/i18n-dev > or, via email, send a message with subject or body 'help' to > i18n-dev-request at openjdk.java.net > > You can reach the person managing the list at > i18n-dev-owner at openjdk.java.net > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of i18n-dev digest..." > > > Today's Topics: > > 1. Re: < i18n dev> Request for review: Crash on XIM > server restart (Omair Majid) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 20 Sep 2010 14:33:38 +0000 (UTC) > From: Omair Majid > Subject: Re: < i18n dev> Request for review: Crash > on > XIM server restart > To: i18n-dev at openjdk.java.net > Message-ID: > Content-Type: text/plain; charset=us-ascii > > Hi, > > Naoto Sato writes: > > > > Thank you for catching the error. I think your fix is fine but would > > like some comments noting that the extra call to getX11InputMethodData() > > in DestroyXIMCallback is merely to free up the pX11IMData, otherwise, > > the call is kind of cryptic. > > > > Thanks for reviewing the patch! Updated webrev is available at: > > http://cr.openjdk.java.net/~omajid/webrevs/crash-on-xim-server-restart/webrev.01/ > > Thanks, > Omair > > > > End of i18n-dev Digest, Vol 33, Issue 2 > *************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/i18n-dev/attachments/20100921/2f1e6a19/attachment.html From naoto.sato at oracle.com Tue Sep 21 10:40:21 2010 From: naoto.sato at oracle.com (Naoto Sato) Date: Tue, 21 Sep 2010 10:40:21 -0700 Subject: < i18n dev> Request for review: Crash on XIM server restart In-Reply-To: References: <4C9276F2.1050007@redhat.com> <4C92898E.4010004@oracle.com> Message-ID: <4C98EE05.1030601@oracle.com> Looks good to me. Naoto (9/20/10 7:33 AM), Omair Majid wrote: > Hi, > > Naoto Sato writes: >> >> Thank you for catching the error. I think your fix is fine but would >> like some comments noting that the extra call to getX11InputMethodData() >> in DestroyXIMCallback is merely to free up the pX11IMData, otherwise, >> the call is kind of cryptic. >> > > Thanks for reviewing the patch! Updated webrev is available at: > http://cr.openjdk.java.net/~omajid/webrevs/crash-on-xim-server-restart/webrev.01/ > > Thanks, > Omair > From omajid at redhat.com Wed Sep 22 07:09:55 2010 From: omajid at redhat.com (Omair Majid) Date: Wed, 22 Sep 2010 10:09:55 -0400 Subject: < i18n dev> Request for review: Crash on XIM server restart In-Reply-To: <4C98EE05.1030601@oracle.com> References: <4C9276F2.1050007@redhat.com> <4C92898E.4010004@oracle.com> <4C98EE05.1030601@oracle.com> Message-ID: <4C9A0E33.8080708@redhat.com> Hi, On 09/21/2010 01:40 PM, Naoto Sato wrote: > Looks good to me. > > Naoto Thanks for the review. Should I use the swing forest to push this change (which I believe is what the i18n group uses) or the awt forest? Also, is it possible to get a bug id for this? Thanks, Omair > > (9/20/10 7:33 AM), Omair Majid wrote: >> Hi, >> >> Naoto Sato writes: >>> >>> Thank you for catching the error. I think your fix is fine but would >>> like some comments noting that the extra call to getX11InputMethodData() >>> in DestroyXIMCallback is merely to free up the pX11IMData, otherwise, >>> the call is kind of cryptic. >>> >> >> Thanks for reviewing the patch! Updated webrev is available at: >> http://cr.openjdk.java.net/~omajid/webrevs/crash-on-xim-server-restart/webrev.01/ >> >> >> Thanks, >> Omair >> > From naoto.sato at oracle.com Wed Sep 22 14:53:21 2010 From: naoto.sato at oracle.com (Naoto Sato) Date: Wed, 22 Sep 2010 14:53:21 -0700 Subject: < i18n dev> Request for review: Crash on XIM server restart In-Reply-To: <4C9A0E33.8080708@redhat.com> References: <4C9276F2.1050007@redhat.com> <4C92898E.4010004@oracle.com> <4C98EE05.1030601@oracle.com> <4C9A0E33.8080708@redhat.com> Message-ID: <4C9A7AD1.3030303@oracle.com> (9/22/10 7:09 AM), Omair Majid wrote: > Hi, > > On 09/21/2010 01:40 PM, Naoto Sato wrote: >> Looks good to me. >> >> Naoto > > Thanks for the review. Should I use the swing forest to push this change > (which I believe is what the i18n group uses) or the awt forest? Swing forest is just fine. > > Also, is it possible to get a bug id for this? I am not familiar with this process, but according to this page (http://openjdk.java.net/contribute/), you can create a new bug report in the OpenJDK Bugzilla. Naoto > > Thanks, > Omair > >> >> (9/20/10 7:33 AM), Omair Majid wrote: >>> Hi, >>> >>> Naoto Sato writes: >>>> >>>> Thank you for catching the error. I think your fix is fine but would >>>> like some comments noting that the extra call to >>>> getX11InputMethodData() >>>> in DestroyXIMCallback is merely to free up the pX11IMData, otherwise, >>>> the call is kind of cryptic. >>>> >>> >>> Thanks for reviewing the patch! Updated webrev is available at: >>> http://cr.openjdk.java.net/~omajid/webrevs/crash-on-xim-server-restart/webrev.01/ >>> >>> >>> >>> Thanks, >>> Omair >>> >> > From martinrb at google.com Wed Sep 22 22:55:31 2010 From: martinrb at google.com (Martin Buchholz) Date: Wed, 22 Sep 2010 22:55:31 -0700 Subject: < i18n dev> Request for review: Crash on XIM server restart In-Reply-To: <4C9A7AD1.3030303@oracle.com> References: <4C9276F2.1050007@redhat.com> <4C92898E.4010004@oracle.com> <4C98EE05.1030601@oracle.com> <4C9A0E33.8080708@redhat.com> <4C9A7AD1.3030303@oracle.com> Message-ID: On Wed, Sep 22, 2010 at 14:53, Naoto Sato wrote: >> Also, is it possible to get a bug id for this? > > I am not familiar with this process, but according to this page > (http://openjdk.java.net/contribute/), you can create a new bug report in > the OpenJDK Bugzilla. An Oracle sponsor still needs to file a bug in bugtraq, not bugzilla, and the bug id is used in the commit message. Martin From omajid at redhat.com Thu Sep 23 07:02:47 2010 From: omajid at redhat.com (Omair Majid) Date: Thu, 23 Sep 2010 10:02:47 -0400 Subject: Request for review: Crash on XIM server restart In-Reply-To: <4C9B1EE1.8070201@oracle.com> References: <4C9276F2.1050007@redhat.com> <4C9B1EE1.8070201@oracle.com> Message-ID: <4C9B5E07.4040306@redhat.com> Hi Artem, On 09/23/2010 05:33 AM, Artem Ananiev wrote: > I'm not an i18n expert, just would like to understand the problem and > the fix. > Naoto Sato was kind enough to review the patch: http://mail.openjdk.java.net/pipermail/i18n-dev/2010-September/000221.html > Could you provide the stack trace of the crash, please? > Sure. I am attaching the GtkJTextFieldTest.java (a reproducer) and the backtrace I obtained. Here are the steps I have to take to reproduce the crash: 1. Start an XIM server (I use ibus in gnome) 2. Run the reproducer and type something in one of the JTextFields 3. Restart the XIM server (for ibus, this requires right clicking on the icon in the system tray and selecting restart). 4. Switch back to the java program and try to type something again. > As I understand, the reason of calling getX11InputMethodData is that you > need to destroy "pX11IMData" and set the corresponding field in Java to > null, right? > Yeah. The code already checks (in getX11InputMethodData) if the XIM server has stopped. It can also automatically reconnect to the XIM server too. the problem is that if the XIM server is stopped and then restarted, X calls OpenXIMCallback which set XIMim to non null, skipping the check in getX11IMInputMethodData. Since pX11IMData does not correspond to the new X11im, the program crashes. I posted an updated cr with comments clarifying the operation. http://cr.openjdk.java.net/~omajid/webrevs/crash-on-xim-server-restart/webrev.01/ Cheers, Omair > > On 9/16/2010 11:58 PM, Omair Majid wrote: >> Hi, >> >> While looking at the bug filed at >> https://bugzilla.redhat.com/show_bug.cgi?id=572147, I noticed that Java >> applications crash if IBus (an X input server) is restarted. >> >> The webrev is at >> http://cr.openjdk.java.net/~omajid/webrevs/crash-on-xim-server-restart/webrev.00/ >> >> >> >> The code in awt_InputMethod.c guards against the XIM server going away, >> but does not guard against it appearing again. When the XIM server is >> restarted, the X server can send async requests to call OpenXIMCallback >> in Java automatically: >> (gdb) bt >> #0 OpenXIMCallback (display=, >> client_data=, call_data=) >> at ../../../src/solaris/native/sun/awt/awt_InputMethod.c:1464 >> #1 0x00000036b406dc4f in _XimFilterPropertyNotify >> (display=0x7f503c0df300, >> window=, event=, >> client_data=) at imInsClbk.c:126 >> #2 0x00007f4ff24f0f3f in Java_sun_awt_X11_XlibWrapper_XFilterEvent ( >> env=, clazz=, >> ptr=, window=) >> at ../../../src/solaris/native/sun/xawt/XlibWrapper.c:486 >> #3 0x00007f5039010f50 in ?? () >> #4 0x00007f5039005953 in ?? () >> #5 0x0000000000000000 in ?? () >> >> This causes the X11im pointer to get initialized and the checks in >> getX11InputMethodData are escaped. The patch simply makes sure that the >> checks are not escaped by calling getX11InputMethodData in >> DestroyXIMCallback. >> >> Any thoughts or comments? >> >> Cheers, >> Omair -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: stack.trace Url: http://mail.openjdk.java.net/pipermail/i18n-dev/attachments/20100923/67cd2ea9/attachment.ksh -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: GtkJTextFieldTest.java Url: http://mail.openjdk.java.net/pipermail/i18n-dev/attachments/20100923/67cd2ea9/attachment-0001.ksh From artem.ananiev at oracle.com Thu Sep 23 02:33:21 2010 From: artem.ananiev at oracle.com (Artem Ananiev) Date: Thu, 23 Sep 2010 13:33:21 +0400 Subject: Request for review: Crash on XIM server restart In-Reply-To: <4C9276F2.1050007@redhat.com> References: <4C9276F2.1050007@redhat.com> Message-ID: <4C9B1EE1.8070201@oracle.com> Hi, Omair, I'm not an i18n expert, just would like to understand the problem and the fix. Could you provide the stack trace of the crash, please? As I understand, the reason of calling getX11InputMethodData is that you need to destroy "pX11IMData" and set the corresponding field in Java to null, right? Thanks, Artem On 9/16/2010 11:58 PM, Omair Majid wrote: > Hi, > > While looking at the bug filed at > https://bugzilla.redhat.com/show_bug.cgi?id=572147, I noticed that Java > applications crash if IBus (an X input server) is restarted. > > The webrev is at > http://cr.openjdk.java.net/~omajid/webrevs/crash-on-xim-server-restart/webrev.00/ > > > The code in awt_InputMethod.c guards against the XIM server going away, > but does not guard against it appearing again. When the XIM server is > restarted, the X server can send async requests to call OpenXIMCallback > in Java automatically: > (gdb) bt > #0 OpenXIMCallback (display=, > client_data=, call_data=) > at ../../../src/solaris/native/sun/awt/awt_InputMethod.c:1464 > #1 0x00000036b406dc4f in _XimFilterPropertyNotify (display=0x7f503c0df300, > window=, event=, > client_data=) at imInsClbk.c:126 > #2 0x00007f4ff24f0f3f in Java_sun_awt_X11_XlibWrapper_XFilterEvent ( > env=, clazz=, > ptr=, window=) > at ../../../src/solaris/native/sun/xawt/XlibWrapper.c:486 > #3 0x00007f5039010f50 in ?? () > #4 0x00007f5039005953 in ?? () > #5 0x0000000000000000 in ?? () > > This causes the X11im pointer to get initialized and the checks in > getX11InputMethodData are escaped. The patch simply makes sure that the > checks are not escaped by calling getX11InputMethodData in > DestroyXIMCallback. > > Any thoughts or comments? > > Cheers, > Omair From naoto.sato at oracle.com Thu Sep 23 11:20:19 2010 From: naoto.sato at oracle.com (Naoto Sato) Date: Thu, 23 Sep 2010 11:20:19 -0700 Subject: < i18n dev> Request for review: Crash on XIM server restart In-Reply-To: References: <4C9276F2.1050007@redhat.com> <4C92898E.4010004@oracle.com> <4C98EE05.1030601@oracle.com> <4C9A0E33.8080708@redhat.com> <4C9A7AD1.3030303@oracle.com> Message-ID: <4C9B9A63.6020009@oracle.com> OK, I created 6986968 for this. It will show up in the external bug database soon. Naoto (9/22/10 10:55 PM), Martin Buchholz wrote: > On Wed, Sep 22, 2010 at 14:53, Naoto Sato wrote: > >>> Also, is it possible to get a bug id for this? >> >> I am not familiar with this process, but according to this page >> (http://openjdk.java.net/contribute/), you can create a new bug report in >> the OpenJDK Bugzilla. > > An Oracle sponsor still needs to file a bug in bugtraq, not bugzilla, > and the bug id is used in the commit message. > > Martin From omajid at redhat.com Mon Sep 27 08:39:50 2010 From: omajid at redhat.com (Omair Majid) Date: Mon, 27 Sep 2010 11:39:50 -0400 Subject: < i18n dev> Request for review: Crash on XIM server restart In-Reply-To: <4C9B9A63.6020009@oracle.com> References: <4C9276F2.1050007@redhat.com> <4C92898E.4010004@oracle.com> <4C98EE05.1030601@oracle.com> <4C9A0E33.8080708@redhat.com> <4C9A7AD1.3030303@oracle.com> <4C9B9A63.6020009@oracle.com> Message-ID: <4CA0BAC6.2090708@redhat.com> Hi, On 09/23/2010 02:20 PM, Naoto Sato wrote: > OK, I created 6986968 for this. It will show up in the external bug > database soon. > Thanks! I have pushed the changeset: http://hg.openjdk.java.net/jdk7/swing/jdk/rev/bbadb9484f53 Cheers, Omair