public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/13496] New: Class.forName(String) uses wrong ClassLoader
@ 2003-12-27 15:26 bothner at gcc dot gnu dot org
  2003-12-27 17:09 ` [Bug libgcj/13496] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bothner at gcc dot gnu dot org @ 2003-12-27 15:26 UTC (permalink / raw)
  To: gcc-bugs

The 1-argument Class.forName(String) method is supposed to find the named class
using the ClassLoader of the class that contains the forName invocation.
The implementation in natClass.java searches the call stack looking for the
invoking class.  This does not seem to work for interpreted code.  It maybe that
only searching the top 4 elements is insufficient.  But when I bumped it up (in
gdb) to 12 elements, it found a class at frame 11 - but that was
java.lang.Class, so I'm not sure that is enough to fix the problem.

To reproduce the problem, grab kawa-1.7.90.jar from
ftp://ftp.gnu.org/pub/gnu/kawa/ and and do:
gij -jar kawa-1.7.90.jar -e '(define-simple-class <S> ())'

The same problem also happens if kawa itself is compiled to native code.  The
problem is finding the interpreted class for S that is generated internally in a
Kawa ArrayClassLoader.

-- 
           Summary: Class.forName(String) uses wrong ClassLoader
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bothner at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug libgcj/13496] Class.forName(String) uses wrong ClassLoader
  2003-12-27 15:26 [Bug libgcj/13496] New: Class.forName(String) uses wrong ClassLoader bothner at gcc dot gnu dot org
@ 2003-12-27 17:09 ` pinskia at gcc dot gnu dot org
  2003-12-29  1:34 ` tromey at gcc dot gnu dot org
  2003-12-30  0:52 ` tromey at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-27 17:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-27 15:26 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-12-27 15:26:09
               date|                            |


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


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

* [Bug libgcj/13496] Class.forName(String) uses wrong ClassLoader
  2003-12-27 15:26 [Bug libgcj/13496] New: Class.forName(String) uses wrong ClassLoader bothner at gcc dot gnu dot org
  2003-12-27 17:09 ` [Bug libgcj/13496] " pinskia at gcc dot gnu dot org
@ 2003-12-29  1:34 ` tromey at gcc dot gnu dot org
  2003-12-30  0:52 ` tromey at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: tromey at gcc dot gnu dot org @ 2003-12-29  1:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tromey at gcc dot gnu dot org  2003-12-29 00:10 -------
Must fix for 3.4


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.4.0


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


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

* [Bug libgcj/13496] Class.forName(String) uses wrong ClassLoader
  2003-12-27 15:26 [Bug libgcj/13496] New: Class.forName(String) uses wrong ClassLoader bothner at gcc dot gnu dot org
  2003-12-27 17:09 ` [Bug libgcj/13496] " pinskia at gcc dot gnu dot org
  2003-12-29  1:34 ` tromey at gcc dot gnu dot org
@ 2003-12-30  0:52 ` tromey at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: tromey at gcc dot gnu dot org @ 2003-12-30  0:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tromey at gcc dot gnu dot org  2003-12-30 00:20 -------
I remembered last night that this is a duplicate.
You can work around the problem by compiling interpret.cc
without optimization.
This is still must-fix for 3.4 though


*** This bug has been marked as a duplicate of 13468 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2003-12-30  0:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-27 15:26 [Bug libgcj/13496] New: Class.forName(String) uses wrong ClassLoader bothner at gcc dot gnu dot org
2003-12-27 17:09 ` [Bug libgcj/13496] " pinskia at gcc dot gnu dot org
2003-12-29  1:34 ` tromey at gcc dot gnu dot org
2003-12-30  0:52 ` tromey 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).