Bug 155119 - libgcj missing symbols/code?
libgcj missing symbols/code?
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2005-04-16 11:40 EDT by Anthony Green
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version: 4.0.0-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-04-24 08:16:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Anthony Green 2005-04-16 11:40:45 EDT
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: gnu.java.awt.peer.gtk.GtkToolkit
   at java.awt.Toolkit.getDefaultToolkit() (/usr/lib/libgcj.so.6.0.0)
   at ShowJPEGReader.main(java.lang.String[]) (Unknown Source)
   at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
Caused by: java.lang.NoClassDefFoundError: gnu.java.awt.peer.gtk.GtkToolkit$GtkErrorImage
   at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.6.0.0)
   at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)
   at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
   at java.awt.Toolkit.getDefaultToolkit() (/usr/lib/libgcj.so.6.0.0)
   ...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/lib-gnu-java-awt-peer-gtk.so.6.0.0 | 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 libgcj.so.6.0.0.

$ nm -D /usr/lib/libgcj.so.6.0.0 | c++filt | grep ReaderFormatFilter
$ nm -D ~green/FSF/4.0/i/lib/libgcj.so.6.0.0 | 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 14:14:31 EDT
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$1.next()
[ ... ]

Is that normal?  Should there be a next() here?
Comment 2 Anthony Green 2005-04-16 15:08:42 EDT
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-16 20:38:52 EDT
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 16:05:13 EDT
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 08:16:29 EDT
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.