Perl Bug 13 - panic: top_env from embedded perl using 'do' with unused XS calls

perl version: 5.8.8
Operating System: i486-linux-gnu-thread-multi

I'm getting a panic: top_env

I've managed to reduce the test case to the following:

  1. From a C program, create/start a perl interpreter object
  2. Load a perl script (using eval_pv "do ...")
  3. Setup an XS routine (which, incidentally, never gets used)
  4. Call a perl routine in the perl script
  5. From that perl routine, execute another perl script (using 'do file')
  6. That perl script needs to define four subs, two which must call the XS routine at least four times, and two which must call it at least once - though again note that none of the routines are called.

The attempt to 'do file' in step 5 causes the panic.

Here's a directory showing the failure