hzeller / beagleg

G-code interpreter and stepmotor controller for crazy fast coordinated moves of up to 8 steppers. Uses the Programmable Realtime Unit (PRU) of the Beaglebone.
http://beagleg.org/
GNU General Public License v3.0
122 stars 51 forks source link

Testing with PostScript output broken #36

Closed hzeller closed 6 years ago

hzeller commented 6 years ago

The following does PostScript output does not seem to work anymore

make -C src clean && make -C src/ gcode2ps && ./src/gcode2ps -o/tmp/x.ps -T2 -c src/testdata/step-speed-same.config -s src/testdata/superellipse.gcode

With git-bisect with the following starting conditions:

git bisect start
git bisect bad
git bisect good 2922596044466d63c120605e31a2d619bc7d36a7

... it can be tracked to 12d3e14b58519963859d7d7ce0916a18d402f477 (The M114 change). Possibly some reporting the postscript generator was relying on is not working anymore.

hzeller commented 6 years ago

So it looks like there are a lot of uninitialized values, probably that generates unpredictable outputs. We can see this by using valgrind (and non-opt mode is good to better see line-numbers):

BEAGLEG_OPT_CFLAGS="-O0 -g" make
valgrind src/gcode2ps -c sample.config -s -o /tmp/b.ps src/testdata/rounded-bracket-simple.gcode

Also notable: with this optimization switchd off the output often looks better, which also strongly indicates that there is something undefined going on.

While with the standard optimization

BEAGLEG_OPT_CFLAGS="-O3" make

The output breaks.

So pretty likely there are fields that are not properly initialized in the M114 patch.

hzeller commented 6 years ago

I have now added an output to the HTML page generated by make test-html that indicates if there are valgrind errors.