-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
"Run from here" reloads the gcode file but doesn't update the display #2418
Comments
I've had a look through the AXIS source and I think the bug is not specifically in AXIS, but in the way AXIS and LinuxCNC communicate with each other. When you load a file in AXIS, it loads the file itself to provide the gcode view, and it also asks LinuxCNC to load the same file (small race window there, but that's not the big issue). The big issue is that LinuxCNC doesn't actually buffer the file in memory at all! As far as I can tell it just open()'s the file and awaits further instruction. So if you change the file on disk before you execute something, LinuxCNC will use the updated file but AXIS won't know to refresh the gcode shown in the user interface. I'm not sure why this problem only manifested itself after I used "run from line", instead of as soon as I saved the updated file. I'm guessing LinuxCNC had buffered the rest of the file contents (maybe because of the motion planner looking ahead? I don't know). But this seems pretty dangerous generally. Maybe AXIS should check periodically to see if the mtime has changed, and if so put up a big warning and maybe pause the job? The existing behaviour is very unintuitive to anyone who doesn't already know that AXIS and LinuxCNC are so loosely coupled. (Edit:) Or maybe AXIS should simply copy your gcode file to a temporary directory, and give LinuxCNC the path to the copy (similar to what it does if you're using a "filter") so that if you change the original on disk, then at least LinuxCNC still has its copy of the original. I think that's probably better than checking mtime and giving a warning. |
The issue here is that if you open a gcode file, and then change the file on disk, you'll think your changes are completely inert because they don't show up in the GUI, but actually LinuxCNC has its own separate file handle behind-the-scenes, and your machine can do scary and unpredictable things. With this fix, the code being executed by LinuxCNC always matches what is displayed in the AXIS GUI even if you subsequently change the file.
axis: copy gcode to temporary file before opening (fixes #2418)
Unfortunately the merged fix for this causes problems and isn't a real solution in the first place (there are other GUIs than axis). #2490 |
Here are the steps I follow to reproduce the issue:
This is what I expected to happen:
I expected the machine to continue with the coordinates shown in the gcode display (i.e. the line of gcode that I actually clicked "run from here" on).
This is what happened instead:
The machine rapid'd over 100mm and broke my tool.
Information about my hardware and software:
lsb_release -a
): Debian 10 busteruname -a
):Linux linuxcnc 4.19.0-17-rt-amd64 #1 SMP PREEMPT RT Debian 4.19.194-2 (2021-06-21) x86_64 GNU/Linux
scripts/get-version-from-git
): 1:2.8.2.11.g6a3d0a434The text was updated successfully, but these errors were encountered: