public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/17021] New: gij: class resolution throws errors too eagerly
@ 2004-08-13 21:07 mckinlay at redhat dot com
  2004-08-13 21:51 ` [Bug libgcj/17021] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mckinlay at redhat dot com @ 2004-08-13 21:07 UTC (permalink / raw)
  To: java-prs

NoClassDefFoundError should only be thrown if a code path that attempts to use
the missing class is actually used. GIJ, however, throws the error too early.
This can be seen by compiling the following test case and deleting the class
file for "Bar".

$ gcj -C Foo.java Bar.java 
$ rm Bar.class 
$ gij Foo

Exception in thread "main" java.lang.NoClassDefFoundError: while resolving
class: Foo 
   at java.lang.ClassLoader.resolveClass0(java.lang.Class)
(/usr/lib/libgcj.so.4.0.0)
   at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.4.0.0)
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
(/usr/lib/libgcj.so.4.0.0)
...

public class Foo
{
  public boolean missing_class_code_path = false;

  public static void main(String[] args)
  {
    new Foo().j();
  }

  void j()
  {
    if (missing_class_code_path)
      new Bar().x();
  }
}

public class Bar 
{
  public void x() {}
}

-- 
           Summary: gij: class resolution throws errors too eagerly
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mckinlay at redhat dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17021


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libgcj/17021] gij: class resolution throws errors too eagerly
  2004-08-13 21:07 [Bug libgcj/17021] New: gij: class resolution throws errors too eagerly mckinlay at redhat dot com
@ 2004-08-13 21:51 ` pinskia at gcc dot gnu dot org
  2004-10-13 21:33 ` tromey at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-13 21:51 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-13 21:51 -------
Confirmed, I thought I saw a bug like this somewhere.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-08-13 21:51:18
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17021


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libgcj/17021] gij: class resolution throws errors too eagerly
  2004-08-13 21:07 [Bug libgcj/17021] New: gij: class resolution throws errors too eagerly mckinlay at redhat dot com
  2004-08-13 21:51 ` [Bug libgcj/17021] " pinskia at gcc dot gnu dot org
@ 2004-10-13 21:33 ` tromey at gcc dot gnu dot org
  2005-07-13 18:12 ` pinskia at gcc dot gnu dot org
  2005-07-13 21:43 ` [Bug libgcj/17021] gij: class resolution throws errors too eagerl dberlin at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at gcc dot gnu dot org @ 2004-10-13 21:33 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2004-10-13 21:33 -------
*** Bug 17980 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17021


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libgcj/17021] gij: class resolution throws errors too eagerly
  2004-08-13 21:07 [Bug libgcj/17021] New: gij: class resolution throws errors too eagerly mckinlay at redhat dot com
  2004-08-13 21:51 ` [Bug libgcj/17021] " pinskia at gcc dot gnu dot org
  2004-10-13 21:33 ` tromey at gcc dot gnu dot org
@ 2005-07-13 18:12 ` pinskia at gcc dot gnu dot org
  2005-07-13 21:43 ` [Bug libgcj/17021] gij: class resolution throws errors too eagerl dberlin at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-13 18:12 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-13 18:12 -------
*** Bug 22463 has been marked as a duplicate of this bug. ***

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17021


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libgcj/17021] gij: class resolution throws errors too eagerl
  2004-08-13 21:07 [Bug libgcj/17021] New: gij: class resolution throws errors too eagerly mckinlay at redhat dot com
                   ` (2 preceding siblings ...)
  2005-07-13 18:12 ` pinskia at gcc dot gnu dot org
@ 2005-07-13 21:43 ` dberlin at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2005-07-13 21:43 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From mckinlay at redhat dot com  2005-07-13 18:18 -------
Updated summary to reflect that this is actually caused by the libgcj verifier.

A workaround is to use "gij -noverify"


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|gij: class resolution throws|gij: class resolution throws
                   |errors too eagerly          |errors too eagerl


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17021


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-07-13 21:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-13 21:07 [Bug libgcj/17021] New: gij: class resolution throws errors too eagerly mckinlay at redhat dot com
2004-08-13 21:51 ` [Bug libgcj/17021] " pinskia at gcc dot gnu dot org
2004-10-13 21:33 ` tromey at gcc dot gnu dot org
2005-07-13 18:12 ` pinskia at gcc dot gnu dot org
2005-07-13 21:43 ` [Bug libgcj/17021] gij: class resolution throws errors too eagerl dberlin at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).