Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 155119 - libgcj missing symbols/code?
Summary: libgcj missing symbols/code?
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-04-16 15:40 UTC by Anthony Green
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version: 4.0.0-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-04-24 12:16:29 UTC

Attachments (Terms of Use)

Description Anthony Green 2005-04-16 15:40:45 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041111 Firefox/1.0

Description of problem:
Here's a test program...
---- cut here ----------------------------------------------
import java.awt.*;
import javax.imageio.*;

public class ShowJPEGReader
    public static void main (String args[])
        System.out.println (Toolkit.getDefaultToolkit ());
        System.out.println (ImageIO.getImageReadersByFormatName("JPEG").next());
---- cut here ----------------------------------------------

When I run it I get:

$ gij ShowJPEGReader
Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit:
   at java.awt.Toolkit.getDefaultToolkit() (/usr/lib/
   at ShowJPEGReader.main(java.lang.String[]) (Unknown Source)
   at (/usr/lib/
   at (/usr/lib/
Caused by: java.lang.NoClassDefFoundError:$GtkErrorImage
   at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/
   at java.lang.Class.initializeClass() (/usr/lib/
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/
   at java.lang.Class.forName(java.lang.String) (/usr/lib/
   at java.awt.Toolkit.getDefaultToolkit() (/usr/lib/
   ...3 more

GtkErrorImage is a private inner class of GtkToolkit.  It should exist in the awt peer .so file.   The really weird thing is that it doesn't, although it _does_ contain code for an anonymous inner class that it contains!

$ nm -D /usr/lib/ | c++filt | grep GtkErrorImage
0006d258 T gnu::java::awt::peer::gtk::GtkToolkit$GtkErrorImage$1::isConsumer(java::awt::image::ImageConsumer*)
0006d220 T gnu::java::awt::peer::gtk::GtkToolkit$GtkErrorImage$1::addConsumer(java::awt::image::ImageConsumer*)
0006d290 T gnu::java::awt::peer::gtk::GtkToolkit$GtkErrorImage$1::removeConsumer(java::awt::image::ImageConsumer*)
0006d2c8 T gnu::java::awt::peer::gtk::GtkToolkit$GtkErrorImage$1::startProduction(java::awt::image::ImageConsumer*)
0006d38c T gnu::java::awt::peer::gtk::GtkToolkit$GtkErrorImage$1::requestTopDownLeftRightResend(java::awt::image::ImageConsumer*)
000a3700 D gnu::java::awt::peer::gtk::GtkToolkit$GtkErrorImage$1::class$
0006d1e0 T gnu::java::awt::peer::gtk::GtkToolkit$GtkErrorImage$1::finit$()
0006d194 T gnu::java::awt::peer::gtk::GtkToolkit$GtkErrorImage$1::GtkToolkit$GtkErrorImage$1(gnu::java::awt::peer::gtk::GtkToolkit$GtkErrorImage*)

My FSF 4.0 branch build that I did myself doesn't have this problem.  I tried replacing the /usr/lib peer library with my own build, and came across another instance of a missing inner private class: javax.imageio.ImageIO$ReaderFormatFilter.  This class is missing from

$ nm -D /usr/lib/ | c++filt | grep ReaderFormatFilter
$ nm -D ~green/FSF/4.0/i/lib/ | c++filt | grep ReaderFormatFilter
00e26240 D javax::imageio::ImageIO$ReaderFormatFilter::class$
00997670 T javax::imageio::ImageIO$ReaderFormatFilter::filter(java::lang::Object*)
00997630 T javax::imageio::ImageIO$ReaderFormatFilter::ImageIO$ReaderFormatFilter(java::lang::String*)

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Try running my example program.

Additional info:

Comment 1 Tom Tromey 2005-04-16 18:14:31 UTC
fwiw, when I run this with my own 4.0 build I get:

opsy. gij ShowJPEGReader
Exception in thread "main" java.util.NoSuchElementException
   at java.util.AbstractList$
[ ... ]

Is that normal?  Should there be a next() here?

Comment 2 Anthony Green 2005-04-16 19:08:42 UTC
That looks like correct output assuming we don't find any jpeg readers.

AbstractList is returning an anonymous ListIterator, which is throwing an
exception in next() because it is empty.

So... why is it empty?  Did you configure with the gtk peers?  I'm hoping to
find the gtk image reader in the list.  

Could you try "JPG" "jpeg" "jpg"?  

I'm going to do a clean rebuild of everything, since you don't seem to be having
the same problem as me.

Comment 3 Anthony Green 2005-04-17 00:38:52 UTC
This is a duplicate of libgcj/20693 in the GCC bugzilla database.

HJ posted a libtool patch, and we need to apply it in order to build properly.

Comment 4 Anthony Green 2005-04-19 20:05:13 UTC
I checked in an alternate fix to the 4.0 branch a few days ago.

This should be fixed in rawhide as soon as jukub pulls the latest bits from FSF.

Comment 5 Jakub Jelinek 2005-04-24 12:16:29 UTC
This change is in libgcj-4.0.0-1.

Note You need to log in before you can comment on or make changes to this bug.