While experimenting with the C++ examples, I tried
generating a defined event with the FSM in a state
which had no transition defined for that event. This
threw an exception which resulted in a SIGABRT.
The exact steps to duplicate the symptoms on RedHat
7.2 or 8.0 are as follows:
# cd examples
Edit test.fsm and delete (or comment out) transition t00.
# fsmgenerator test.fsm Cpp .
Edit FSMIsEven/FSMIsEven.cpp and add
#include "main_FSMIsEven.h"
to the top of the file.
# g++ -I../api/Cpp -IFSMIsEven -ICpp -o FSMtest
Cpp/main_FSMIsEven.cpp FSMIsEven/FSMIsEven.cpp
Note: On RedHat 8.0 I also had to
modify ../api/Cpp/FSMException.h by adding the
following destructor definition to the FSMException class:
~FSMException() throw() {};
Otherwise I got an error something like 'looser throw
specifier'
Now run the test - this is what I got:
# ./FSMtest
in Func0
in Func3
Aborted
#
I haven't used exception handling a lot, so I wasn't sure
(and I'm still not entirely sure:) if it was a bug or
something I was doing wrong. Eventually I was able to
get it working, however, by adding a few catches and
removing "throw()" from some of the function
declarations. I will zip up and attach the files that I
changed.
Files modified to work around SIGABRT