FluidNC icon indicating copy to clipboard operation
FluidNC copied to clipboard

Prevent underflow when recalculating an empty planner buffer

Open pentacular opened this issue 1 year ago • 1 comments

planner_recalculate did not check for an empty planner buffer.

This change adds an early exit guard.

pentacular avatar Mar 23 '24 12:03 pentacular

I discovered the issue by calling protocol_send_event(&feedOverrideEvent, -FeedOverride::CoarseIncrement) every 10ms resulting in Stepper::get_realtime_rate() returning NaN due to a negative max_entry_speed_sqr being used in replanning.

The extent of the stress testing I have done is to run with the fix for about ten minutes.

pentacular avatar Mar 24 '24 00:03 pentacular