This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 167342 - [gcj] Calling virtual method from anon class gets segv
[gcj] Calling virtual method from anon class gets segv
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc4 (Show other bugs)
4.0
All Linux
high Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks: 168429 173278
  Show dependency treegraph
 
Reported: 2005-09-01 15:11 EDT by Andrew Cagney
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2006-0127
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-07 13:24:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Source to Anon (362 bytes, text/x-java)
2005-09-01 15:13 EDT, Andrew Cagney
no flags Details

  None (edit)
Description Andrew Cagney 2005-09-01 15:11:52 EDT
1  public abstract class Anon
     2  {
     3      static void staticCallee () {
     4          System.out.println ("staticCallee");
     5      }
     6      void callee () {
     7          System.out.println ("callee");
     8      }
     9      abstract void caller ();
    10      public static void main (String[] argv)
    11      {
    12          Anon a = new Anon () {
    13                  void caller () {
    14                      staticCallee ();
    15                      callee ();
    16                  }
    17              };
    18          a.caller ();
    19      }
    20  }

cagney@localhost$ gcj -g --main=Anon Anon.java
cagney@localhost$ ./a.out
staticCallee
Exception in thread "main" java.lang.NullPointerException
   at Anon$1.caller()
(/home/scratch/frysk/frysk/frysk-imports/tests/anoncall/Anon.java:15)
   at Anon.main(java.lang.String[])
(/home/scratch/frysk/frysk/frysk-imports/tests/anoncall/Anon.java:18)
   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)

cagney@localhost$ ecj Anon.java
cagney@localhost$ gij Anon
staticCallee
callee

rumor has it that this is fixed in CVS head.
Comment 1 Andrew Cagney 2005-09-01 15:13:08 EDT
Created attachment 118364 [details]
Source to Anon
Comment 2 Jakub Jelinek 2005-09-06 11:09:46 EDT
Indeed, it is fixed even in GCC 4.0.x.
Now, is there any customer request or something that would justify changing
GCC 3.4.x Java?  We include GCC 4.0.x Java starting with RHEL4 U2, so if somebody
really needs this, he can use that.  But there are many known Java deficiencies
in GCC 3.4.x Java I guess...
Comment 10 Jakub Jelinek 2005-11-30 13:45:36 EST
gcc4-4.0.2-9.EL4 built in dist-4E-qu-candidate.
Comment 14 Red Hat Bugzilla 2006-03-07 13:24:52 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0127.html

Note You need to log in before you can comment on or make changes to this bug.