public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/20044] New: Wrong method call semantics (maybe instanceof/invokespecial)
@ 2005-02-18 0:01 bonniot at users dot sf dot net
2005-02-18 0:53 ` [Bug java/20044] " bonniot at users dot sf dot net
` (6 more replies)
0 siblings, 7 replies; 10+ messages in thread
From: bonniot at users dot sf dot net @ 2005-02-18 0:01 UTC (permalink / raw)
To: java-prs
This is a very small testcase, in which the code generated by gcj does not
behave correctly at runtime. I set the severity as critical because there is no
notification that something went wrong while the wrong method gets called, and I
see no workaround.
I suppose that there is a problem either with an instanceof test, or with the
implementation of invokespecial. Feel free to update the summary if this turns
out to be the wrong intuitition.
Attached are three small bytecode classes (I could not reproduce the bug from
Java sources).
# Normal behaviour, using Sun's JDK
$ java test.fun
true
$ gcj --main=test.fun test/*.class
$ ./a.out
false
Tested with gcj 4.0.0 20050212.
--
Summary: Wrong method call semantics (maybe
instanceof/invokespecial)
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: java
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bonniot at users dot sf dot net
CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
dot org
GCC host triplet: i386-debian-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20044
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug java/20044] Wrong method call semantics (maybe instanceof/invokespecial)
2005-02-18 0:01 [Bug java/20044] New: " bonniot at users dot sf dot net
@ 2005-02-18 0:53 ` bonniot at users dot sf dot net
2005-02-18 1:36 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: bonniot at users dot sf dot net @ 2005-02-18 0:53 UTC (permalink / raw)
To: java-prs
------- Additional Comments From bonniot at users dot sf dot net 2005-02-17 23:49 -------
Created an attachment (id=8219)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8219&action=view)
testcase
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20044
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug java/20044] Wrong method call semantics (maybe instanceof/invokespecial)
2005-02-18 0:01 [Bug java/20044] New: " bonniot at users dot sf dot net
2005-02-18 0:53 ` [Bug java/20044] " bonniot at users dot sf dot net
@ 2005-02-18 1:36 ` pinskia at gcc dot gnu dot org
2005-02-18 4:52 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-18 1:36 UTC (permalink / raw)
To: java-prs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-17 23:51 -------
Well it cannot be really that critial because nobody has hit this before.
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|critical |normal
Keywords| |wrong-code
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20044
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug java/20044] Wrong method call semantics (maybe instanceof/invokespecial)
2005-02-18 0:01 [Bug java/20044] New: " bonniot at users dot sf dot net
2005-02-18 0:53 ` [Bug java/20044] " bonniot at users dot sf dot net
2005-02-18 1:36 ` pinskia at gcc dot gnu dot org
@ 2005-02-18 4:52 ` pinskia at gcc dot gnu dot org
2005-02-18 14:52 ` tromey at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-18 4:52 UTC (permalink / raw)
To: java-prs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-18 00:00 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-02-18 00:00:09
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20044
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug java/20044] Wrong method call semantics (maybe instanceof/invokespecial)
2005-02-18 0:01 [Bug java/20044] New: " bonniot at users dot sf dot net
` (2 preceding siblings ...)
2005-02-18 4:52 ` pinskia at gcc dot gnu dot org
@ 2005-02-18 14:52 ` tromey at gcc dot gnu dot org
2005-05-04 17:45 ` bkonrath at redhat dot com
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-02-18 14:52 UTC (permalink / raw)
To: java-prs
------- Additional Comments From tromey at gcc dot gnu dot org 2005-02-18 00:53 -------
This bug occurs in 3 places.
* In the interpreter and the old abi, the problem is similar.
We do not properly implement the ACC_SUPER semantics of the
invokespecial opcode. The fix in both these cases is similar,
the "invokespecial Object.equals" must be changed into a
non-virtual call to "A.equals"
* In the BC ABI, the problem is the same, but the solution is different.
We can't search the concrete class hierarchy in the compiler.
Instead we must emit an atable (not otable, as the resulting call
will be nonvirtual) reference for the method. However, it must be
a special atable reference, since we cannot know the precise name
of the declaring class. One approach to fixing this would be to
emit a name like "+ClassNameHere" to indicate that we must search.
Or, better, some magic value like (void*)1 or NULL would suffice here
(since we know we must always start the search with the current class'
superclass)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20044
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug java/20044] Wrong method call semantics (maybe instanceof/invokespecial)
2005-02-18 0:01 [Bug java/20044] New: " bonniot at users dot sf dot net
` (3 preceding siblings ...)
2005-02-18 14:52 ` tromey at gcc dot gnu dot org
@ 2005-05-04 17:45 ` bkonrath at redhat dot com
2005-05-04 20:53 ` tromey at gcc dot gnu dot org
2005-05-16 14:45 ` aph at gcc dot gnu dot org
6 siblings, 0 replies; 10+ messages in thread
From: bkonrath at redhat dot com @ 2005-05-04 17:45 UTC (permalink / raw)
To: java-prs
------- Additional Comments From bkonrath at redhat dot com 2005-05-04 17:45 -------
Daniel, could you post the actual source for those classes? Thanks, Ben
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20044
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug java/20044] Wrong method call semantics (maybe instanceof/invokespecial)
2005-02-18 0:01 [Bug java/20044] New: " bonniot at users dot sf dot net
` (4 preceding siblings ...)
2005-05-04 17:45 ` bkonrath at redhat dot com
@ 2005-05-04 20:53 ` tromey at gcc dot gnu dot org
2005-05-16 14:45 ` aph at gcc dot gnu dot org
6 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-05-04 20:53 UTC (permalink / raw)
To: java-prs
------- Additional Comments From tromey at gcc dot gnu dot org 2005-05-04 20:53 -------
Ben --
As I recall the original test case was written in 'nice', not in java.
The sources may be of limited usefulness here.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20044
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug java/20044] Wrong method call semantics (maybe instanceof/invokespecial)
2005-02-18 0:01 [Bug java/20044] New: " bonniot at users dot sf dot net
` (5 preceding siblings ...)
2005-05-04 20:53 ` tromey at gcc dot gnu dot org
@ 2005-05-16 14:45 ` aph at gcc dot gnu dot org
6 siblings, 0 replies; 10+ messages in thread
From: aph at gcc dot gnu dot org @ 2005-05-16 14:45 UTC (permalink / raw)
To: java-prs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |aph at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20044
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2006-07-19 3:52 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-20044-6811@http.gcc.gnu.org/bugzilla/>
2005-12-15 15:54 ` [Bug java/20044] Wrong method call semantics (maybe instanceof/invokespecial) aph at gcc dot gnu dot org
2006-03-29 22:39 ` tromey at gcc dot gnu dot org
2006-07-19 3:52 ` pinskia at gcc dot gnu dot org
2005-02-18 0:01 [Bug java/20044] New: " bonniot at users dot sf dot net
2005-02-18 0:53 ` [Bug java/20044] " bonniot at users dot sf dot net
2005-02-18 1:36 ` pinskia at gcc dot gnu dot org
2005-02-18 4:52 ` pinskia at gcc dot gnu dot org
2005-02-18 14:52 ` tromey at gcc dot gnu dot org
2005-05-04 17:45 ` bkonrath at redhat dot com
2005-05-04 20:53 ` tromey at gcc dot gnu dot org
2005-05-16 14:45 ` aph at gcc dot gnu dot org
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).