Someone has logged a bug against DBD::Informix because it wasn't cleaning up properly as a handle was destroyed. It turns out that the statement-level active flag was not set. But, simply setting it on means DBD::Informix runs foul of all sorts of issues during destroy. Of course it's a bug that it isn't set on; but having it set on leads to some very odd (core dumping) behaviour.
It may well be completely unrelated, but it looks like something is iffy in regards to the state of a statement handle right after a prepare.
The state of a sth after a prepare seems pejoratively magical.
Try the following:
use Devel::Peek; $sth = $dbh->prepare( $sql ); $sth->execute; $sth->finish; Dump ($sth); $sth = $dbh->prepare( $sql ); $sth->finish; Dump ($sth);
Note that the first dump works, the second totally hangs. That's under DBD::Sybase, but it probably isn't at the driver level.
So to go back to the quoting above, if you destroy a handle after a prepare, nothing happens and the handle isn't destroyed. And if you try to do anything fancy with its dbh at the XS level, you're out of luck and the whole thing freezes with 100% cpu usage.
Henri