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

re-using perl interpreters under 5.8.1

Thread Next
From:
Zac Hansen
Date:
September 27, 2003 12:47
Subject:
re-using perl interpreters under 5.8.1
Message ID:
Pine.LNX.4.44.0309271535070.9448-100000@chopper.slackworks.com

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 
EPTest.cpp:139
#6  0x401c2767 in __libc_start_main () from /lib/libc.so.6
(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.


--Zac
xaxxon@slackworks.com


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About