unclebob/fitnesse — Issue #55: Infinite loop when parsing some hashes
Author: wapcaplet
Created: 2012-01-03 18:37:06+00:00
State: open

There appears to be a problem when parsing pages containing a badly-formatted hash, or a hash containing a space instead of a comma. For example, when saving or viewing a page containing a hash like either of these:

!{name:bob dob:19521205}
!{value_without_colon}

then the java process running FitNesse begins consuming 100% of the CPU, and FitNesse becomes unresponsive (using v20110104). I have not narrowed down exactly what is wrong, but I think it originates in `src/fitnesse/wikitext/parser/HashTable.java`. The `parse` method contains a `while (true)` loop that can only be escaped from if `parser.atEnd()` is true, or if a closing brace is encountered. I suspect the parser is getting hung up on something in the middle of the hash, and thus is never reaching the end of the hash.

Once a page is saved with such a badly-formatted hash, it becomes impossible to view or edit/save the page; the only workaround I've found is to manually edit the `content.txt` file to fix the offending hash.