Perl Bug 14 - setting $0 in embedded eval_pv causes segfault


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

Setting $0 in an embedded perl (such as with eval_pv) causes a segfault. Example case:

#include 
#include 

int
main(int argc, char **argv, char **env) {
  PerlInterpreter *my_perl;
  char *arg[] = { "", "-e", "" };

  my_perl = perl_alloc();
  perl_construct(my_perl);
  if (perl_parse(my_perl, NULL, 3, arg, (char **)NULL)) {
    fprintf(stderr,"Trouble opening perl parser\n");
    return -1;
  }

  eval_pv( "$0='fubar'" , G_VOID);


  perl_destruct(my_perl);
  perl_free(my_perl);
  return 0;
}