in reply to Script crashes when parsing XML

From the Thread docs:

For new code the use of the Thread module is discouraged and the direct use of the threads and threads::shared modules is encouraged instead. Finally, note that there are many known serious problems with the 5005threads, one of the least of which is that regular expression match variables like $1 are not threadsafe, that is, they easily get corrupted by competing threads. Other problems include more insidious data corruption and mysterious crashes. You are seriously urged to use ithreads instead.

So I'd suggest that for a start you switched to threads and see what happens. Then, in order to eliminate some possible exotic reasons for the bug, try with pure ascii XML, then without handlers... in short try simplifying your code until you find the simplest version that triggers the problem. Then you can send me the code (if it comes as a self-contained test-case, that's even better). Note that I have never worked with threads, so don't expect too much, but at least I'll look into it.

Thanks