More information: My cow-orker Ilmari did some analysis on which part of the perl code is involved. He mailed the results to RT, but the message hasn't shown up there. In brief: the memory allocations are for the start/end indices of captured submatches, and the writes that exceed the allocations are trying to clear the indices to -1. There's a pair of capturing parens in one of the regexps in the test program. If they are removed then valgrind reports no errors. In the real application, removing the corresponding parens (which are actually not meant to be there) avoids all crashes. -zefram