Hello Guest it is June 14, 2025, 05:28:30 PM

Author Topic: mach4 crash  (Read 3184 times)

0 Members and 1 Guest are viewing this topic.

mach4 crash
« on: January 12, 2025, 12:14:55 PM »
  OldSoftLimitZ = GetSoftLimitForAxis(mc.Z_AXIS)

  OldSoftLimitZ = GetSoftLimitForAxis(mc.Z_AXIS))

One of these lines is not like the other..  In fact there is an extra ) on the last line. This will cause mach4 to instantly crash. this was in a m6 macro and caused me an hour or two of frustration to find. Running my m6 from the editor did not find this issue. I had to go through line by line to find this and when I did, I slapped my forehead.

btw, for those that care. This causes a divide by zero error in the mach4core.dll file. I found that by loading it into visual studio and running the program under the debugger.

This kind of bug shouldn't exist by now. it's been what, 10-12 years now with mach4. ( I was an early,early adopter)
Re: mach4 crash
« Reply #1 on: January 12, 2025, 12:28:47 PM »
Which build of Mach4 are you running?
Re: mach4 crash
« Reply #2 on: January 12, 2025, 02:27:59 PM »
that'd be build 5596 on a modified Industrial screenset.
Re: mach4 crash
« Reply #3 on: January 14, 2025, 02:27:04 PM »
You might need to update your Microsoft redistributable to 2022, I had an issue recently where I couldn’t debug anything in Zerobrane, updating this fixed it.

I can compile the code you posted above it it throws an error for me

Offline smurph

*
  • *
  •  1,574 1,574
  • "That there... that's an RV."
Re: mach4 crash
« Reply #4 on: January 14, 2025, 05:03:35 PM »
This is what happens when I paste your code into the ZeroBrane editor and hit F7 (compile).

Code: [Select]
Compilation error on line 3:
untitled.lua:3: unexpected symbol near ')'
See the attached picture of the action in the ZeroBrane editor. 

When I edit code, I ALWAYS hit F7 before I save it and try to run it in Mach. 

I'm sorry, but bad script code is a killer.  You can ALWAYS crash Mach with bad LUA code.  We chose LUA because it was faster than anything else and the scripts run at near compiled C++ speed.  Unfortunately, with that speed comes the ability to crash because there is literally no protection layer.  You, the integrator, must be the protection layer.  Especially if you are doing something custom like a tool change script.  Zerobrane and F7 is your friend. 

Steve