From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17600 invoked by alias); 7 Feb 2006 11:10:28 -0000 Received: (qmail 17447 invoked by uid 48); 7 Feb 2006 11:10:20 -0000 Date: Tue, 07 Feb 2006 11:10:00 -0000 Subject: [Bug java/26152] New: gtkImage.c complains and crashes the application X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "cardona at ucla dot edu" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-02/txt/msg00627.txt.bz2 List-Id: ImageJ, the public domain scientific-grade image processing application compiles fine with the gcj-wrapper-4.0 in Kubuntu GNU/Linux-ppc when stripped of JPEG functionality and its dependance on the tools.jar. But when trying to open an image, the gtkImage.c file complains: ** ERROR **: file ../../../src/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c: line 572 (createRawData): assertion failed: (data_fid != 0) aborting... I attach a self-contained test case below. Here are the commands to compile and run it: $ /usr/bin/gcj-wrapper-4.0 -g testGtkImage.java $ /usr/lib/jvm/java-gcj/bin/java testGtkImage The JFileChooser never shows. Here's the error message: ** ERROR **: file ../../../src/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c: line 572 (createRawData): assertion failed: (data_fid != 0) aborting... Aborted /************* START TEST CASE ************/ import java.awt.Canvas; import java.awt.FileDialog; import java.awt.Frame; import java.io.File; import javax.swing.SwingUtilities; import javax.swing.JFileChooser; public class testGtkImage { String omDirectory; File[] omFiles; testGtkImage() { final Frame frame = new Frame("testGtkImage"); Canvas canvas = new Canvas(); canvas.setSize(400, 200); frame.add(canvas); frame.setSize(400, 200); frame.pack(); frame.show(); // test FileDialog FileDialog fd = new FileDialog(frame, "Select file", FileDialog.LOAD); fd.show(); System.out.println(fd.getDirectory() + " " + fd.getFile()); // NO PROBLEM with FileDialog // test JFileChooser as in ij.io.Opener.openMultiple() try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { JFileChooser fc = new JFileChooser(); fc.setMultiSelectionEnabled(true); File dir = null; String sdir = "/home/"; // OpenDialog.getDefaultDirectory(); if (sdir!=null) dir = new File(sdir); if (dir!=null) fc.setCurrentDirectory(dir); int returnVal = fc.showOpenDialog(frame); if (returnVal!=JFileChooser.APPROVE_OPTION) return; omFiles = fc.getSelectedFiles(); if (omFiles.length==0) { // getSelectedFiles does not work on some JVMs omFiles = new File[1]; omFiles[0] = fc.getSelectedFile(); } omDirectory = fc.getCurrentDirectory().getPath()+File.separator; } }); } catch (Exception e) {} if (omDirectory==null) return; //OpenDialog.setDefaultDirectory(omDirectory); for (int i=0; i