apertium / apertium-lex-tools

Module for compiling lexical selection rules and processing them in the pipeline.
https://wiki.apertium.org/wiki/Constraint-based_lexical_selection_module
GNU General Public License v3.0
5 stars 12 forks source link

Throws bad_alloc #21

Closed TinoDidriksen closed 5 years ago

TinoDidriksen commented 5 years ago

With https://github.com/apertium/apertium-lex-tools/commit/4165215069a708a6a2182a3d9c9a3c3defed6dd1, curl -Ss https://termbin.com/4q1i |lrx-comp - /tmp/fra.bin runs and yields 991 bytes. On 32 bit it yields 975 bytes. curl -Ss https://termbin.com/cwbf |lrx-proc -m -t /tmp/fra.bin dies with bad_alloc on both 32 and 64 bit.

Which exact commit caused it I haven't tested yet.

TinoDidriksen commented 5 years ago

First test says https://github.com/apertium/apertium-lex-tools/blob/master/lrx_processor.cc#L835 grows infinitely. Could be any of the appends to that string, not necessarily that exact line.

TinoDidriksen commented 5 years ago

This happens all the way back to https://github.com/apertium/apertium-lex-tools/commit/4fe00c63c47d8bad95ee98f595acb1ccec616324 from 2018-08-06 - can't easily test before that because lttoolbox was also changed.

TinoDidriksen commented 5 years ago

In the old versions the same append is reported (https://github.com/apertium/apertium-lex-tools/blob/4fe00c63c47d8bad95ee98f595acb1ccec616324/lrx_processor.cc#L837), so there's something to look at.

unhammer commented 5 years ago

Does that while loop need to check for WEOF?