|
Boost Users : |
Subject: [Boost-users] [MSM] stack overflow happens when there is afalse-guard anonymous transition
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2010-09-05 15:36:30
<snip>
>When start() got called in main(), it will enter a endless reentering between state_machine::process_event() and >state_machine::handle_eventless_transitions_helper::process_completion_event(). Finally it caused a stack overflow.
>
>
>Could somebody please help me to fix this problem?
Hi,
The problem is that UML does not specify how often an anonymous
transition should be "tried" and I probably chose the wrong solution
(to try again and again).
So, as your guard always returns false, msm keeps trying, which means
calls to process_event() until the stack overflows.
The solution probably is to try just once but it will force you to
manually try to reprocess by calling, say a process() function without
event, but it arguably simply means passing the buck to you.
Please let me think about it a bit more, I'd like to think this out a bit more.
For the moment, I suggest you to either write a useful guard or revert
to a named event, which you will process when it makes sense in your
application.
Regards,
Christophe
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net