From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24370 invoked by alias); 9 Sep 2002 19:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 24341 invoked by uid 71); 9 Sep 2002 19:26:01 -0000 Resent-Date: 9 Sep 2002 19:26:01 -0000 Resent-Message-ID: <20020909192601.24340.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, java-prs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, ivg2@cornell.edu Received: (qmail 20879 invoked by uid 61); 9 Sep 2002 19:16:03 -0000 Message-Id: <20020909191603.20878.qmail@sources.redhat.com> Date: Mon, 09 Sep 2002 12:26:00 -0000 From: ivg2@cornell.edu Reply-To: ivg2@cornell.edu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libgcj/7870: Incorrect constructor invoked in inherited class. X-SW-Source: 2002-09/txt/msg00151.txt.bz2 List-Id: >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: