verivital / hyst

HyST: A Source Transformation and Translation Tool for Hybrid Automaton Models
http://verivital.com/hyst/
Other
15 stars 18 forks source link

Large models crash hyst #6

Open ttj opened 9 years ago

ttj commented 9 years ago

Large models may crash Hyst due to a stackoverflow in the grammar/parser.

Example model has hundreds of variables. Apparently github is stupid and won't let you upload plain text files without .txt extension....

iss_full_model.cfg.txt iss_full_model.xml.txt

Possible fix is here:

http://stackoverflow.com/questions/26062730/antlr4-throws-java-lang-stackoverflowerror-on-longer-files

stanleybak commented 9 years ago

Is it the expression parser that's throwing the error? If so, we might be able to just add a unit test with the long expression that causes the problem.

ttj commented 9 years ago

It seems to be the config parser, particularly the initial condition parsing (which is an expression), after I debugged some. The overflow starts from:

https://github.com/LuanVietNguyen/hyst/blob/master/src/java/de/uni_freiburg/informatik/swt/spaxeexxmlreader/SpaceExXMLReader.java#L122

I created a test related for the flows and invariants, both of which passed:

https://github.com/LuanVietNguyen/hyst/blob/master/src/java/com/verivital/hyst/junit/SmallTest.java#L70

The original file had newlines, so I got rid of those in case they were creating extra tokens, but that didn't work.

I'll try to debug the init condition parser more.