develooper Front page | perl.perl5.porters | Postings from September 2003

re-using perl interpreters under 5.8.1

Thread Next
Zac Hansen
September 27, 2003 12:47
re-using perl interpreters under 5.8.1
Message ID:

I'm pretty sure this is a known issue, but you still can't re-use a perl 
interpreter with perl compiled with MULTIPLICITY.  This does not seem to 
be fixed under 5.8.1.  

It dies in perl_construct on the second call with PL_perl_destruct_level 
set to 1.  

The workaround I've found is to just perl_free and perl_alloc along with 
the second perl_construct call, but this just seems wasteful.

Here's gdb output of the error.  EP::GetEPI is my function.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 2448)]
0x080e8bff in S_new_xpvav (my_perl=0x819df58) at sv.c:940
940         PL_xpvav_root = (XPVAV*)xpvav->xav_array;
Current language:  auto; currently c
(gdb) bt
#0  0x080e8bff in S_new_xpvav (my_perl=0x819df58) at sv.c:940
#1  0x080e96c6 in Perl_sv_upgrade (my_perl=0x819df58, sv=0x819edc4, mt=10) 
at sv.c:1440
#2  0x080d9760 in Perl_newAV (my_perl=0x819df58) at av.c:354
#3  0x080696bb in perl_construct (my_perl=0x819df58) at perl.c:283
#4  0x08067024 in EP::GetEPI() (this=0x819ea68) at EP.cpp:1136
#5  0x08061fc6 in main (argc=1, argv=0xbfffedd4, env=0xbfffeddc) at 
#6  0x401c2767 in __libc_start_main () from /lib/
(gdb) print xpvav
$1 = (XPVAV *) 0xabababab

When run under valgrind, it doesn't crash.  In fact, it reports no errors 
where the crash otherwise occurs.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About