Summary: | duplicate class registration bug | ||
---|---|---|---|
Product: | gcc | Reporter: | oskar |
Component: | libgcj | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | bryce, gcc-bugs, java-prs |
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2005-09-10 19:33:08 | |
Bug Depends on: | 12725 | ||
Bug Blocks: |
Description
oskar
2002-05-26 08:36:00 UTC
From: Bryce McKinlay <bryce@waitaki.otago.ac.nz> To: gcc-gnats@gcc.gnu.org Cc: Subject: Re: libgcj/6819: duplicate class registration bug Date: Mon, 27 May 2002 16:03:41 +1200 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6819 Yes, this is a well known issue. The problem is that if we have duplicated symbols (ie the same symbol representing both old and new versions of a class), it is quite non-deterministic (or at least non-portable) which of them will actually be found and used at runtime by the linker. This should be fixable in conjunction with implementing a weaker linking model - this is also needed for strict adherance to Java's binary compatibility spec, and would allow us to do cool things like link compiled classes against interpreted class files, etc. Bryce. Hello, A good many things have changed since gcc 3.1. Can you confirm whether this bug is still current with gcc 3.3? Thanks, Dara See Dara's question. But I think this is still a problem, Can you provide a self contained example of this, I think I know how to repoduce this but It would be nice for other people. It seems this bug is fixed in 3.3. echo >Demo.java 'class Demo { public static void main(String[] args) { File f = new File(); } }' mkdir java java/io echo >java/io/File.java 'public class File { public File() { System.out.println("hello"); } }' gcj-3.3 -o Demo java/io/File.java Demo.java --main=Demo ./Demo That should print 'hello', which it does with 3.3. I haven't tested 3.1 or earlier with this example though. I'm sorry, this bug still exists. I forgot to include 'package java.io;' in the File.java source file in the test above. When you do, you will still get this error at runtime: libgcj failure: Duplicate class registration: java.io.File Aborted Thanks for the confirmation. Sorry that this one still isn't fixed :-( This problem will be fixed by the binary compatibility ABI. I've marked the dependency on the BC-ABI tracking bug. Closing as won't fix as libgcj (and the java front-end) has been removed from the trunk. |