fontforge / libspiro

Spiro is the creation of Raph Levien. It simplifies the drawing of beautiful curves. (Migrated here from libspiro.sourceforge.net on 2013-04-20)
GNU General Public License v3.0
107 stars 25 forks source link

Segmentation fault in call-test20 #22

Closed fcambus closed 4 years ago

fcambus commented 4 years ago

Hi,

The issue can be reproduced out of the box when building and running the test suite on OpenBSD and FreeBSD.

It can be reproduced on Linux with GCC by enabling the Stack Smashing Protector (SSP):

./configure CFLAGS=-fstack-protector
make
tests/call-test20
JoesCat commented 4 years ago

It took a bit of fiddling to find a way to trigger this fault on test20, but managed to do that with: ./configure CFLAGS="-fstack-protector --param ssp-buffer-size=4 -g -O0"

Appears I introduced a bug after "Allow Spiros to be scaled and/or shifted. Scaling bug fixed." Valgrind comes clean for all tests here: ./libtool --mode=execute valgrind -v --error-exitcode=1 ./tests/call-test15

At this point "Corrected directions of '[' and ']' for drawing example 'a'" valgrind begins showing problems for test 0,7,9,14,15

JoesCat commented 4 years ago

Hi @fcambus - appears the git comment auto closed this issue, I'll reopen it.

Would you mind giving the latest patch a spin? Fix memory access bug/error created earlier by patch 2017-10-28

There is one more thing that has my attention that I'd like to stomp-out before doing a fresh release.

Thanks, Joe

fcambus commented 4 years ago

Thanks for looking into this issue.

I can confirm the test suite now runs all the tests correctly with your latest patch.