Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: single-state machine in infinite loop crashes after a while #1

Open
ghost opened this issue Aug 25, 2015 · 0 comments
Open

bug: single-state machine in infinite loop crashes after a while #1

ghost opened this issue Aug 25, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Aug 25, 2015

bug

A finite state machine implemented using mruby-fsm with a single state in an infinite loop crashes after a random number of cycles.

how to reproduce

  1. build mruby using "run_test.rb" provided in the repository;
  2. run the following test program ("test.rb"):
fsm = FSM::Machine.new(:counter)
fsm.params.counter = 0

loop_state = FSM::State.new("loop")
loop_state.in_loop do
  fsm.params.counter += 1
  puts "fsm.params.counter += 1  =>  #{fsm.params.counter}"
end
loop_state.timing = 0.010
fsm.add(loop_state)

fsm.run "loop"
  1. wait a random number of cycles (187|1006|6630|50826|73511|...) until the program exits with one of the following errors:
trace:
    [0] test.rb:12
test.rb:12: cannot set instance variable (ArgumentError)

or

trace:
    [0] test.rb:12
test.rb:12: non float value (TypeError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants