<AWT Dev> Bug 6913179, FileDialog uses native GTK under Linux: first patch
Costantino Cerbo
c.cerbo at gmail.com
Thu Feb 11 14:35:49 PST 2010
Hi Peter, Hi Damjan,
I've observed that the FileChooser with the GTK L&F either silently
exits or indefinitely hangs when the function
fp_gtk_main()
is called in sun_awt_X11_GtkFileDialogPeer.c
Calling gtk-main() more times shouldn't be a problem.
I've read on http://library.gnome.org/devel/gtk/unstable/gtk-General.html#gtk-main
that is supports nested calls.
How do we can debug the native code to capture further information?
Cheers,
Costantino
P.S.: My OS is Fedora 12 with GTK+ 2.18.6
2010/2/11 Peter Zhelezniakov <Peter.Zhelezniakov at sun.com>:
> Hi Costantino,
>
> Costantino Cerbo wrote:
>> It works correctly, but only if we don't use the GTK L&F.
>> I didn't realise it and this is a very useful clue: it means that we
>> do something wrong with the initialization of GTK.
>>
>> With the GTK L&F, I get these errors:
>> Xlib: sequence lost (0x11fae > 0x2233) in reply type 0x1c!
>>
>> *** glibc detected ***
>> /home/c.cerbo/openjdk-awt/jdk/build/linux-i586/bin/java: double free
>> or corruption (fasttop): 0x912db9d0 ***
>> *** glibc detected ***
>> /home/c.cerbo/openjdk-awt/jdk/build/linux-i586/bin/java: double free
>> or corruption (out): 0x912d2d10 ***
>
> I tried again, this time with your newest patch
> http://cr.openjdk.java.net/~anthony/7-43-GTKFileDialog-6913179.2/
>
> My only change was to start a new thread in GtkFileDialogPeer (see
> gtkfd2.patch, attached). It worked with GTK LAF for me, and i wasn't getting
> any messages. I was running attached GtkFD.java on a Gentoo box with
> gtk+-2.16.6, and was using latest jdk7 sources.
>
> Could you try my patch and test on your machine?
>
> Thanks!
> --
> Peter
>
> *** src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java.old Thu Feb 11
> 13:07:16 2010
> --- src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java Thu Feb 11
> 13:07:22 2010
> ***************
> *** 84,93 ****
> XToolkit.awtLock();
> try {
> if (b) {
> ! run(fd.getTitle(), fd.getMode(), fd.getDirectory(),
> ! fd.getFile(), fd.getFilenameFilter());
>
> ! fd.setVisible(false);
> } else {
> quit();
> fd.setVisible(false);
> --- 84,98 ----
> XToolkit.awtLock();
> try {
> if (b) {
> ! Thread t = new Thread() {
> ! public void run() {
> ! GtkFileDialogPeer.this.run(fd.getTitle(),
> fd.getMode(), fd.getDirectory(),
> ! fd.getFile(), fd.getFilenameFilter());
>
> ! fd.setVisible(false);
> ! }
> ! };
> ! t.start();
> } else {
> quit();
> fd.setVisible(false);
>
>
More information about the awt-dev
mailing list