Kbase P132952: Session crashes with errors 5636 or 1 when instantiating a child object from the constructor of a su
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  7/3/2008 |
|
Status: Unverified
SYMPTOM(s):
Session crashes with errors 5636 or 1 when instantiating a child object from the constructor of a super object
An instance of the super class is created
Super class constructor creates an instance of the child object
Warning 5407 is displayed several times before the process terminates
WARNING: -nb exceeded. Automatically increasing from <old value> to <new value>. (5407)
SYSTEM ERROR: -s exceeded. Raising STOP condition and attempting to write stack trace to file 'procore'. Consider increasing -s startup parameter. (5635)
bfblst -- Too many block levels. Increase -nb parameter. (1)
Debugger shows that the code never gets past the Super class constructor
By definition, a Child class inherits from a Super class
FACT(s) (Environment):
OpenEdge 10.1x
All Supported Operating Systems
CAUSE:
This is expected behaviour as the code causes an infinite loop. The Constructor in the Super class is called which instantiates an instance of the Child object. The Child class inherits from the Super class so the Super class' Constructor is called again which instantiates an instance of the Child object. The Child class inherits from the Super class so the Super class' Constructor is called again...
As per the documentation:
"If there is a super class constructor that does not take parameters (serving as a defined default), an explicit call from the subclass is optional. If you do not explicitly invoke a super class constructor, the AVM automatically invokes the super class's default constructor before executing any statements in the subclass constructor."
OpenEdge Getting Started: Object-Orientated Programming, Defining Class Constructors - 2-35
FIX:
Do not instantiate Child objects from the Constructor of a Super class