Skip to content

task: unblock tool-change abort by setting io.status=DONE#4031

Open
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:fix/3675-tool-change-abort-wedge
Open

task: unblock tool-change abort by setting io.status=DONE#4031
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:fix/3675-tool-change-abort-wedge

Conversation

@grandixximo
Copy link
Copy Markdown
Contributor

Summary

Fixes #3675 (2.10 regression: aborting during a tool-change wedges the UI; MDI and further auto runs are dead until restart).

After 764655e moved IO handling from the out-of-process iocontrol into Task, EMC_TOOL_ABORT no longer flips emcioStatus.status back to RCS_DONE. The old NML dispatcher in ioControl.cc set RCS_DONE by default for every command before the switch; the new in-process Task::emcIoAbort clears the tool_change/tool_prepare pins but leaves status stuck at RCS_EXEC from the prior emcToolLoad/emcToolPrepare.

emctaskmain's MDI, auto and state-restore paths gate on io.status == RCS_DONE, so abort while tool-change is pending wedges everything.

One-line fix: set emcioStatus.status = RCS_STATUS::DONE at the end of Task::emcIoAbort, restoring the old default.

@rene-dev, sorry for stepping on this one. Bisect from #3675 pointed at 764655e so I had a clear lead and went ahead. Happy to defer if you'd prefer to take it.

Test plan

  • Reproduced original bug on master (sim/axis, sample G-code with M6 T1 G43 / M6 T2 G43, iocontrol.0.tool-changed unlinked, linuxcnc.command().abort() while tool-change=1): UI sluggish/unresponsive, MDI dead.
  • With patch applied: abort recovers cleanly, MDI works, G-code can be re-run.
  • Reviewer to confirm on real hardware tool-changer.

After commit 764655e moved IO handling from the out-of-process
iocontrol into Task, EMC_TOOL_ABORT no longer flips emcioStatus.status
back to RCS_DONE. The old NML dispatcher set RCS_DONE by default for
every command; the new in-process emcIoAbort cleared the tool_change
and tool_prepare pins but left status stuck at RCS_EXEC from the prior
emcToolLoad/emcToolPrepare call.

emctaskmain's MDI, auto and state-restore paths gate on
io.status == RCS_DONE, so an abort received while tool-change was
pending wedged the UI and prevented further MDI or program runs.

Closes LinuxCNC#3675
@grandixximo
Copy link
Copy Markdown
Contributor Author

@andypugh I reproduced with your steps in #3675 and this fixes it. 2.9 not effected.

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

Successfully merging this pull request may close these issues.

LinuxCNC 2.10 becomes unresponsive if aborted during tool change

1 participant