public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* libgcj/7870: Incorrect constructor invoked in inherited class.
@ 2002-09-09 12:26 ivg2
  0 siblings, 0 replies; 3+ messages in thread
From: ivg2 @ 2002-09-09 12:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7870
>Category:       libgcj
>Synopsis:       Incorrect constructor invoked in inherited class.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 09 12:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     ivg2@cornell.edu
>Release:        gij (GNU libgcj) version 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)
>Organization:
>Environment:
Red Hat Rawhide (in sync with server on 9/9/02)
Kernel 2.4.20-pre5 
Athlon XP 1600+ processor
>Description:
Here's the code, compiled correctly, 
works under interpreter: 
gij (GNU libgcj) version 0.0.7
Does not work  under:
gij (GNU libgcj) version 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)

Summarry: It appears that a 0-arg constructor
of base class Frame is called, when a 1-argument
constructor of the derived class SaMSimulatorGUI
is present and should be invoked. 

Java below is a frontend to gij.
gij GUISimulator has precisely the same behavior.

Compiled with: javac.
gcj -C filename has the same effect.
Options: 
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=athlon-redhat-linux --with-system-zlib --enable-__cxa_atexit
Thread model: posix

============================================
[phantom@cobra bug]$ ls
GUISimulator.java  IDisplay.java  SaM.java  SaMSimulatorGUI.java

[phantom@cobra bug]$ cat IDisplay.java
interface IDisplay { }

[phantom@cobra bug]$ cat SaM.java
public class SaM { }

[phantom@cobra bug]$ cat GUISimulator.java
public class GUISimulator
{ public static void main(String[] args)
  { IDisplay g = new SaMSimulatorGUI(new SaM()); }  }


[phantom@cobra bug]$ cat SaMSimulatorGUI.java
import java.awt.*;

public class SaMSimulatorGUI extends Frame implements IDisplay { public SaMSimulatorGUI (SaM m) { } }
====================================================
[root@cobra bug]# java GUISimulator        
Exception in thread "main" java.lang.NullPointerException
   at 0x40226296: ?? (??:0)
   at 0xbffff1fc: ?? (??:0)
   at 0x4036695a: java.awt.Component.Component() (/usr/lib/libgcj.so.3)
   at 0x4036a94f: java.awt.Container.Container() (/usr/lib/libgcj.so.3)
   at 0x4037d095: java.awt.Window.Window() (/usr/lib/libgcj.so.3)
   at 0x4036fb54: java.awt.Frame.Frame(java.lang.String) (/usr/lib/libgcj.so.3)
   at 0x4036fb19: java.awt.Frame.Frame() (/usr/lib/libgcj.so.3)
   at 0x403c61bb: ffi_call_SYSV (/usr/lib/libgcj.so.3)
   at 0x403c6185: ffi_raw_call (/usr/lib/libgcj.so.3)
   at 0x4023ad4f: _Jv_InterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/l                                                               ib/libgcj.so.3)
   at 0x4023b664: _Jv_InterpMethod.run(ffi_cif, void, ffi_raw, _Jv_InterpMethodI                                                               nvocation) (/usr/lib/libgcj.so.3)
   at 0x40238c44: _Jv_InterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/us                                                               r/lib/libgcj.so.3)
   at 0x403c604c: ?? (??:0)
   at 0x403c61bb: ffi_call_SYSV (/usr/lib/libgcj.so.3)
   at 0x403c6185: ffi_raw_call (/usr/lib/libgcj.so.3)
   at 0x4023ad4f: _Jv_InterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/l                                                               ib/libgcj.so.3)
   at 0x4023b664: _Jv_InterpMethod.run(ffi_cif, void, ffi_raw, _Jv_InterpMethodI                                                               nvocation) (/usr/lib/libgcj.so.3)
   at 0x40238c44: _Jv_InterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/us                                                               r/lib/libgcj.so.3)
   at 0x403c604c: ?? (??:0)
   at 0x4024d848: gnu.gcj.runtime.FirstThread.call_main() (/usr/lib/libgcj.so.3)
   at 0x402c76b0: gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.3)
   at 0x4025a00c: _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.3)
   at 0x40227bce: _Jv_RunMain(java.lang.Class, byte const, int, byte const, bool                                                               ean) (/usr/lib/libgcj.so.3)
   at 0x08048921: ?? (??:0)
   at 0x420155e4: ?? (??:0)
   at 0x080486e1: ?? (??:0)
[root@cobra bug]# 
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: libgcj/7870: Incorrect constructor invoked in inherited class.
@ 2002-10-07 19:00 tromey
  0 siblings, 0 replies; 3+ messages in thread
From: tromey @ 2002-10-07 19:00 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, ivg2, java-prs, tromey

Synopsis: Incorrect constructor invoked in inherited class.

State-Changed-From-To: feedback->closed
State-Changed-By: tromey
State-Changed-When: Mon Oct  7 19:00:46 2002
State-Changed-Why:
    Reported as fixed.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7870


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

* Re: libgcj/7870: Incorrect constructor invoked in inherited class.
@ 2002-09-23 11:13 tromey
  0 siblings, 0 replies; 3+ messages in thread
From: tromey @ 2002-09-23 11:13 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, ivg2, java-prs, nobody, tromey

Synopsis: Incorrect constructor invoked in inherited class.

Responsible-Changed-From-To: unassigned->tromey
Responsible-Changed-By: tromey
Responsible-Changed-When: Mon Sep 23 11:13:40 2002
Responsible-Changed-Why:
    I'm handling this.
State-Changed-From-To: open->feedback
State-Changed-By: tromey
State-Changed-When: Mon Sep 23 11:13:40 2002
State-Changed-Why:
    I tried this with 3.3 (the current cvs).
    It seems to work ok.  I don't get an exception.
    
    The Frame constructor is a red herring here.
    The libffi frames after that in the trace most
    probably represent the call to the SamSimulatorGUI
    constructor; you can tell for sure if you compile to
    object code.
    
    In order to get further with this I'd need to know
    exactly where the NullPointerException is thrown.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7870


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

end of thread, other threads:[~2002-10-08  2:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-09 12:26 libgcj/7870: Incorrect constructor invoked in inherited class ivg2
2002-09-23 11:13 tromey
2002-10-07 19:00 tromey

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).