ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-mod_perl
perl-mod_perl
perl_free(my_perl) affecting mod_perl?
by Chintana Wilamuna other posts by this author
Jun 30 2008 11:34PM messages near this date
Re: [MP2]how to catch the response body of a subrequest? | mod_perl and perlMagick Write
Hi,

I'm trying to call a Perl function from C code and clean the
interpreter I just created.  I have a Perl script hosted with Apache +
mod_perl and when a request comes to the file (say example.pl) it'll
call a C function which is wrapped with SWIG.  I'm getting the global
request via Apache2::RequestUtil-> request() and fills a C struct with
the all the request parameters and pass it to a C function.

In this function, after figuring out what function to call by looking
at request data, that function is called using call_pv().  Note that
this function is also defined in the same file (example.pl).  At the
time of the call_pv() since it cannot get the global request I have
put the part that gets the global request inside if defined
$ENV{MOD_PERL} block.

The issue I'm facing is, after,

perl_destruct(my_perl);
perl_free(my_perl);
PERL_SYS_TERM();

gets called, seems that it's not only affecting the Perl interpreter
instance I just created but some global state as well.  From valgrind
I can see that it tries to access the freed pointer.  So I tried to
change the variable name my_perl to something else but macros like dSP
seems to be using that.

When I clean up the interpreter within my function, does it affect
mod_perl?  Is there a way I can get access to the interpreter used by
mod_perl so that I can execute a Perl function after using that as an
argument to perl_parse()?

Thanks in advance,

Bye,

    -Chintana

-- 
http://engwar.com/

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved