Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9525: Assert with program termination due to context<...>() call in simple_state's entry action is incorrect
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-12-31 14:25:20
#9525: Assert with program termination due to context<...>() call in
simple_state's entry action is incorrect
-------------------------------+-----------------------------
Reporter: anonymous | Owner: andreas_huber69
Type: Bugs | Status: new
Milestone: To Be Determined | Component: statechart
Version: Boost 1.49.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+-----------------------------
Comment (by andreas_huber69):
Replying to [ticket:9525 anonymous]:
> It's not correct to throw uncatchable surprises like asserts. It's
especially incorrect when your library is used in the embedded software.
>
> Not to mention this isn't reflected anywhere in the documentation.
Do you use std::vector? If yes, I'm wondering what you get when you run
something to the effect of *std::vector::end()? Last time I accidentally
did that I got an assertion in DEBUG mode. I RELEASE mode, on most
platforms the aforementioned statement would have done the wrong thing and
returned the contents of an invalid memory location. IIRC, the standard
says that the iterator you get from vector::end() must not be
dereferenced.
I would argue that it's an almost identical situation with the
simple_state::context() function. The reference docs say that you can't
call this function in the constructor of a simple_state subclass:
<http://www.boost.org/doc/libs/1_55_0/libs/statechart/doc/reference.html#ClassTemplatesimple_state>
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9525#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:15 UTC