Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367046

Summary: StackOverflowError in Egl2MofStatement
Product: z_Archived Reporter: Will Smythe <smythew>
Component: EDTAssignee: Project Inbox <edt.compiler-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P2 CC: jeffdouglas, pharmon, svihovec, tww
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
EGL source file that appears to be causing stack overflow
none
Workspace log file none

Description Will Smythe CLA 2011-12-18 22:19:38 EST
Created attachment 208529 [details]
EGL source file that appears to be causing stack overflow

See attached EGL source file,which contains a lot of errors. When trying to edit/save this file in EWDT 0.7, I get a popup dialog that indicates there is a StackOverflowError. This bug may be related to bug 367045. 

java.lang.StackOverflowError
	at java.lang.Exception.<init>(Unknown Source)
	at java.lang.reflect.InvocationTargetException.<init>(Unknown Source)
	at sun.reflect.GeneratedConstructorAccessor175.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at java.lang.Class.newInstance0(Unknown Source)
	at java.lang.Class.newInstance(Unknown Source)v
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofStatement.getGeneratorFor(Egl2MofStatement.java:784)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofStatement.visit(Egl2MofStatement.java:514)
	at org.eclipse.edt.compiler.core.ast.GetByPositionStatement.accept(GetByPositionStatement.java:340)
	at org.eclipse.edt.compiler.internal.egl2mof.AbstractIOStatementGenerator.genGetByPositionStatement(AbstractIOStatementGenerator.java:126)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofStatement.visit(Egl2MofStatement.java:515)
	at org.eclipse.edt.compiler.core.ast.GetByPositionStatement.accept(GetByPositionStatement.java:340)
	at org.eclipse.edt.compiler.internal.egl2mof.AbstractIOStatementGenerator.genGetByPositionStatement(AbstractIOStatementGenerator.java:126)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofStatement.visit(Egl2MofStatement.java:515)
	at org.eclipse.edt.compiler.core.ast.GetByPositionStatement.accept(GetByPositionStatement.java:340)
	at org.eclipse.edt.compiler.internal.egl2mof.AbstractIOStatementGenerator.genGetByPositionStatement(AbstractIOStatementGenerator.java:126)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofStatement.visit(Egl2MofStatement.java:515)
	at org.eclipse.edt.compiler.core.ast.GetByPositionStatement.accept(GetByPositionStatement.java:340)
	at org.eclipse.edt.compiler.internal.egl2mof.AbstractIOStatementGenerator.genGetByPositionStatement(AbstractIOStatementGenerator.java:126)
	at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofStatement.visit(Egl2MofStatement.java:515)
Comment 1 Will Smythe CLA 2011-12-18 22:20:19 EST
Created attachment 208530 [details]
Workspace log file
Comment 2 Will Smythe CLA 2011-12-28 10:25:06 EST
I am seeing this same error/exception in the all-in-one 0.7 IDE.
Comment 3 Paul Harmon CLA 2012-01-17 14:09:52 EST
The problem was caused by the presence of a GetByPosition statement in the testcase. Since this type of statement is not supported by the sql dataSource, the statement generator didnt know what to do with it, so it threw it into an infinite loop.

I have added a validator for this statement, so that an error is thrown that indicates that this type of GET statement is not allowed. I also fixed the IR generator to not go into an infinite loop. 

The following files have been updated:

	IProblemRequestor
	EGLValidationResource.properties
	FunctionValidator
	MoveStatementValidator
	AbstractIOStatementGenerator
	EGL2MofStatement
	IOStatementGenerator
	SQLActionStatementGenerator
	SQLActionStatementValidator
	GetByPositionStatementValidator
	SqlFactory
	SqlFactoryImpl
Comment 4 Will Smythe CLA 2012-02-21 08:02:02 EST
Verified.