java/5135: Compiler segfault on non public Interfaces

olivier@zipworld.com.au olivier@zipworld.com.au
Sun Dec 16 14:26:00 GMT 2001


>Number:         5135
>Category:       java
>Synopsis:       Compiler segfault on non public Interfaces
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 16 13:56:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     olivier@zipworld.com.au
>Release:        gcc version 3.1 20011211 (experimental)
>Organization:
>Environment:
Reading specs from /usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../../program/cvs/gcc/configure --prefix=/usr/local/gcc --enable-shared --enable-threads=posix --enable-languages=c++,java
Thread model: posix
gcc version 3.1 20011211 (experimental)
>Description:
gcj compilation aborts with a segfault in the following
situation:

Class: 
  a/A.java    a package protected interface.
  a/B.java    a class that implement interface A.
  a/b/C.java  a class in a different package that import
              both A and B and try to use a constant
              defined in interface A.

Note that "A" and therefore "A.Hello" are protected in package "a" and should
not be accessible from class "C". Sun JDK correctly reports:   

  tournesol$ javac a/b/C.java
  a/b/C.java:3: a.A is not public in a; cannot be accessed from outside
  package
  import a.A;
         ^
         a/b/C.java:10: a.A is not public in a; cannot be accessed from
         outside package
               System.out.println(A.HELLO);


but gcj gets confused by the fact that class "B" (also imported) is
public in package "a" and implements "A". It wrongly believes that "A"
is accessible and segfault.

>How-To-Repeat:
gcj -C a/b/C.java
>Fix:
Unknown...
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="a.tgz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="a.tgz"

H4sIALkUHTwAA+3WTWvCMBgH8J7zKR486aVN0tYeyg5VBjsIO+wTRJe5bn2jjcIYfvel3ZwiiAxW
Ze7/u6QvgYY+PMlfeU7vOA9kFIZ25CIK+f645fAo4JHg3Jf2WgjJhUNh/0tznFVjVE3klFm6TnV9
dN6p93+U8hL3Ra1Vn9/gtq7jIDhe/2hXfxkKO19KETnE+1zU1j+vf6UWr2qpScWMpYXR9ZNaaErY
OyOiB1OnxZLubmeze7qhwbPOsnIQsw1jl143/A7lTS7f/+3ZsO3/KOz63xfo/3PY7/9qNc/SBS0y
1TQ0YWleZTrXhWm6/QBNf42UN+89Af4o/439Nv8FPvLfWbT1n/Z8Apza/yUPD+ovg2CM/f8cvvd/
d94mwLwqa2Nvknh3PTk8Gqaf6fDrmf1/xg7rMn2kLiAOR+3bbkqbId8ao3O3XBm3smnSZMUwcbtE
OYrbKRt7sFz6JwAAAAAAAAAAAAAAAFyRDxetJjMAKAAA



More information about the Gcc-bugs mailing list