Boost logo

Boost Users :

Subject: [Boost-users] [statechart] state_machine send_event assertion fails
From: Gooding, Dustin R. (JSC-ER411) (dustin.r.gooding_at_[hidden])
Date: 2013-06-13 21:33:01


Hello,

I'm a new user of statechart and for the most part am enjoying it very much. I've implemented a state machine with about 30 states (9 orthogonal regions) and over 50 events. It works very well and as expected, except for this one issue. Every once in a while, and in a way I've been unable to consistently repeat, I get an assertion failure resulting in a core dump.

/usr/include/boost/statechart/state_machine.hpp:873: boost::statechart::detail::reaction_result boost::statechart::state_machine<MostDerived, InitialState, Allocator, ExceptionTranslator>::send_event(const event_base_type&) [with MostDerived = GripperPosition, InitialState = Container, Allocator = std::allocator<void>, ExceptionTranslator = boost::statechart::null_exception_translator, boost::statechart::state_machine<MostDerived, InitialState, Allocator, ExceptionTranslator>::event_base_type = boost::statechart::event_base]: Assertion `get_pointer( pOutermostUnstableState_ ) == 0' failed.

"GripperPosition" is my state_machine. "Container" is the simple_state the state machine initially enters. Container has no transitions, but many sub states (it's the owner of the 9 orthogonal regions). (As far as I can tell, if the state machine is alive, then "Container" is an active state.) "Container" has a handful of custom_reactions that essentially listen for user-supplied events, "forward" those events in to the appropriate orthogonal regions using internal-only events, and then discard the user-supplied events. The intention here is to have a single event propagate to multiple orthogonal regions, allowing them all to react. For example:

boost::statechart::result Container::react(const e_still&)
{
    post_event(i_still_action());
    post_event(i_still_moving());
    return discard_event();
}

I am unsure if these reactions are the cause of the assertion failure, but given that the error message says "Container" is the InitialState, I have to assume so. Given that, I don't see how either Container or GripperPosition are inactive and don't know how to interpret this error. I'd appreciate some guidance.

I'm running Ubuntu 12.04, GCC 4.6.3, and Boost 1.46.1.

--
Dustin Gooding
NASA/JSC Robotics


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