Bug 163365 - [compiler] problem methods can throw java.lang.VerifyError at runtime
Summary: [compiler] problem methods can throw java.lang.VerifyError at runtime
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
: 163378 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-11-03 13:09 EST by Jon Barrilleaux CLA
Modified: 2023-06-21 11:53 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Barrilleaux CLA 2006-11-03 13:09:16 EST
This is a new one. I'm using the latest integration build, eclipse-SDK-I20061102-1715-win32.zip


java.lang.VerifyError: class gumbo2.graphic.math.Matrix4$Impl overrides final method .
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.access$100(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	at gumbo2.test.graphic.math.Matrix4Test.setUp(Matrix4Test.java:554)
	at junit.framework.TestCase.runBare(TestCase.java:125)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Comment 1 Jon Barrilleaux CLA 2006-11-03 13:16:44 EST
Of course, right after i submitted the bug I noticed that a dependent class had a compiler error because it was trying to override a final method.  I removed the offending code and all is now right with the world.

However, shouldn't I have gotten a "compiler error" instead of a "verify error" when I tried to run the bad code?

(I changed the severity level of the bug to "normal", and will let you decide whether this is really a bug or not.)
Comment 2 Olivier Thomann CLA 2006-11-03 13:40:06 EST
Could you please provide a test case to reproduce this issue?
This looks like a bug in the problem method support.
Comment 3 Olivier Thomann CLA 2006-11-03 15:07:13 EST
*** Bug 163378 has been marked as a duplicate of this bug. ***
Comment 4 Olivier Thomann CLA 2006-11-07 09:41:07 EST
(In reply to comment #1)
> Of course, right after i submitted the bug I noticed that a dependent class had
> a compiler error because it was trying to override a final method.  I removed
> the offending code and all is now right with the world.
This would be related to the problem method support.

> However, shouldn't I have gotten a "compiler error" instead of a "verify error"
> when I tried to run the bad code?
Definitely! You should never get a VerifyError. You should get an unresolved compilation error.

> (I changed the severity level of the bug to "normal", and will let you decide
> whether this is really a bug or not.)
This is definitely a bug and a test case to reproduce it would be welcome.

Thanks.
Comment 5 Olivier Thomann CLA 2006-11-07 10:13:43 EST
Reproduced with:
class Y {
	final public void foo() {
	}
}
public class X extends Y {

	public void foo() {}
	
	public static void main(String[] args) {
		new X().foo();
	}
}

Not sure what is the best way to fix this. I'll investigate. Let me know if this looks like the code you had.
Comment 6 Jon Barrilleaux CLA 2006-11-07 10:22:09 EST
I already posted my code demonstrating the problem with instructions on what to
run and where to look in the original bug....

https://bugs.eclipse.org/bugs/show_bug.cgi?id=163378

I see that you tried to boil it down.  I'll take a look at this in the next day or so (its election day here and must go fight for democracy).
Comment 7 Olivier Thomann CLA 2006-11-07 11:30:53 EST
In this case the only way this can be fixed would be to report the compilation error on the type (not inside a method) and remove the method from the problem type.
Comment 8 Eclipse Genie CLA 2019-07-10 15:46:42 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 9 Stephan Herrmann CLA 2019-07-10 16:48:46 EDT
Still relevant

(In reply to Olivier Thomann from comment #7)
> In this case the only way this can be fixed would be to report the
> compilation error on the type (not inside a method) and remove the method
> from the problem type.

I think the tricky part here is: *report* against the method, but *generate* <init> or <clinit> as a ProblemMethod rather than the illegal override, right?
Comment 10 Eclipse Genie CLA 2021-06-30 14:05:27 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 11 Eclipse Genie CLA 2023-06-21 11:53:09 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.