Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Stack size limitation in EMF-specific VM
Stack size limitation in EMF-specific VM [message #989671] Fri, 07 December 2012 04:17
Andreas Brieg is currently offline Andreas Brieg
Messages: 48
Registered: November 2012
Member
I'm hitting the stack size limit of the EMF-specific VM in a rather small transformation. There was already a bug filed about the stack size limit. However I think I'm getting into this in some other way however.

The transformation that causes the problem is this one:

-- @atlcompiler atl2010
-- @nsURI ECore=http://www.eclipse.org/emf/2002/Ecore


module convertVertragAttributeToReference;
create output: ECore refining input: ECore;

rule dropVertragAttribute {
	from input: ECore!EAttribute (
			input.isVertragAttribute()
		)
	to
		drop
}

rule addVertragReference {
	from
		input: ECore!EClass (
			input.requiresVertrag()
		)
	to
		outputClass: ECore!EClass (
			eStructuralFeatures <- Sequence{vertragReference}
		),
		vertragReference: ECore!EReference (
			-- causes stackoverflow
			eAnnotations <- input.eStructuralFeatures->select(e|e.isVertragAttribute())->collect(e|e.eAnnotations).flatten(),
			eType <- thisModule.vertragClassifier,
			name <- 'vertrag'
		)
}

helper context ECore!EClass def: requiresVertrag(): Boolean =
	self.name <> 'Vertrag' and self.eStructuralFeatures -> exists(e | e.
			isVertragAttribute());

helper context ECore!EStructuralFeature def: isVertragAttribute(): Boolean =
	false;

helper context ECore!EAttribute def: isVertragAttribute(): Boolean =
	self.name = 'vertrId';

helper def: dbadm: ECore!EPackage =
	ECore!EPackage.allInstances() -> select(e | e.nsURI = 'http://dbadm/1.0').first();

helper def: vertragClassifier: ECore!EClassifier =
	thisModule.dbadm.eClassifiers -> select(e | e.name = 'Vertrag').first();


The line below the comment shows the assignment, which causes the stack overflow. If the assignment is removed the transformation runs through.

The reported error is:
org.eclipse.m2m.atl.engine.emfvm.VMException: 100
	at __applyRefiningTrace__#47(convertVertragAttributeToReference.atl)
		local variables: self=convertVertragAttributeToReference : ASMModule
	at main#79(convertVertragAttributeToReference.atl)
		local variables: self=convertVertragAttributeToReference : ASMModule
Java Stack:
org.eclipse.m2m.atl.engine.emfvm.VMException: 100
	at org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:643)
	at org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:388)
	at org.eclipse.m2m.atl.engine.emfvm.ASM.run(ASM.java:208)
	at org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMLauncher.internalLaunch(EMFVMLauncher.java:170)
	at org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMUILauncher.launch(EMFVMUILauncher.java:46)
	at org.eclipse.m2m.atl.core.service.LauncherService.launch(LauncherService.java:136)
	at org.eclipse.m2m.atl.core.ui.launch.AtlLaunchConfigurationDelegate.launchOrDebug(AtlLaunchConfigurationDelegate.java:300)
	at org.eclipse.m2m.atl.core.ui.launch.AtlLaunchConfigurationDelegate.launch(AtlLaunchConfigurationDelegate.java:234)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 100
	at org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:494)
	... 12 more


Am I doing something wrong? Should I file this as a bug? Does anybody know a workaround?

Thanks for advice.

Edit:

I'm using Juno with ATL 3.3.1.
The transformation is applied to an ecore model with about 150 classes and 1900 structural features.

[Updated on: Fri, 07 December 2012 04:19]

Report message to a moderator

Previous Topic:ATL to ATL Refining Mode
Next Topic:[ATL] Containment references cannot span across models
Goto Forum:
  


Current Time: Wed Aug 27 23:16:20 EDT 2014

Powered by FUDForum. Page generated in 0.02147 seconds