To reproduce, store the following content in a file tags.reweight:
+Cmp +2 +Der +2
Then run the following command (the input fst can be any fst):
hfst-reweight -T tags.reweight -i generator-fstspeller-gt-norm.hfst > /dev/null
Actual result:
hfst-reweight(1434,0x7fff753f2300) malloc: *** error for object 0x7fff5d47d390: pointer being realloc'd was not allocated *** set a breakpoint in malloc_error_break to debug Abort trap: 6
Expected result: No crash, and a reweighted fst.
I looked further into this bug, and located the bug in the function 'hfst_getline()' on line 673 in the file ''tools/src/hfst-commandline.cc''. I added a couple of debug statements, so that the function code looks like the following:
When running hfst-reweight using this modified version of hfst-commandline.cc, I get the following:
Based on the above, it looks like the bug is on the line:
In the end, the error was in hfst-reweight.cc. A pointer was not initialised. The bug should be fixed in revision 4329.
Please review, and close the bug report if the commit is ok.