Hi Rubén,
that is an interesting case and you obviously came across a validation bug.
The problem is that the statechart is invalid and the validation mechanism should have detected the error:
A transition from an initial node to its parent state is illegal. The purpose of the initial entry is to indicate what child state should be entered when the parent state is entered so must 'point to' a state in the same region. In your case the The following happens:
1. enter 'Loaded' and since it is a composite state the initial sub state must be entered so
2. enter 'Stopped' and since it is a composite state enter the state the initial entry points to so
2. enter 'Stopped' and since it is a composite state enter the state the initial entry points to so
2. ...
So we are in an infinite loop. Due to the construction of the interpreter you get a stack overflow .... Of course you should get error markers that indicate that problem.
It is important to be aware of a fundamental property of composite states: If a state is active and contains child states than for each containing region exactly one child state must be active and an active child state also implies that all parent states are active as well. In your case that means that an active state 'Stopped' also implies that 'Starting' is active what i assume is not you intention...
A possible constructions with hierarchical states is :
... and an equivalent flat statechart is:
Best regards,
Axel