LyX hangs when \def\foo{\foo} or similar appears in the .tex output. A recent article (<[EMAIL PROTECTED]>) in de.comp.text.tex suggests that there are even methods to eat all memory by saying \def~{\if~}~.
The recommended work-around for batch processing is a 'watchdog' based on ulimit + timeout. Andre'