Losing $r->user between PerlFixupHandler and PerlLogHandler

2008-06-05 Thread Kevin Thorpe
Hi, I have just upgraded from Apache1 to Apache2 and I am now having 
problems with logging to my database.


I am using AuthCookie and AuthCookieDBI for logging in. AuthCookie sets 
$r->user in the PerlFixupHandler.
However reading $r->user in PerlLogHandler doesn't always return the 
user set in the previous handler.


Can anyone shed any light on why the RequestRec is losing the user name?

thanks


Re: Segfault Help!?!?

2008-06-05 Thread amiribarksdale

It appears that downgrading DBD::mysql to version 4.004 has done the trick.

Amiri
-- 
View this message in context: 
http://www.nabble.com/Segfault-Help%21-%21--tp17599739p17668030.html
Sent from the mod_perl - General mailing list archive at Nabble.com.



Re: Losing $r->user between PerlFixupHandler and PerlLogHandler

2008-06-05 Thread Vegard Vesterheim
On Thu, 5 Jun 2008 12:25:17 +0100 Kevin Thorpe <[EMAIL PROTECTED]> wrote:

> Hi, I have just upgraded from Apache1 to Apache2 and I am now having
> problems with logging to my database.
>
> I am using AuthCookie and AuthCookieDBI for logging in. AuthCookie
> sets $r->user in the PerlFixupHandler.
> However reading $r->user in PerlLogHandler doesn't always return the
> user set in the previous handler.
>
> Can anyone shed any light on why the RequestRec is losing the user name?

I encountered a similar problem some time ago. Have a look at this
thread, maybe your problem is related:

http://marc.info/?l=apache-modperl&m=119996305532711&w=2

 - Vegard V -


Re: Losing $r->user between PerlFixupHandler and PerlLogHandler

2008-06-05 Thread Kevin Thorpe

Vegard Vesterheim wrote:

On Thu, 5 Jun 2008 12:25:17 +0100 Kevin Thorpe <[EMAIL PROTECTED]> wrote:

  

Hi, I have just upgraded from Apache1 to Apache2 and I am now having
problems with logging to my database.

I am using AuthCookie and AuthCookieDBI for logging in. AuthCookie
sets $r->user in the PerlFixupHandler.
However reading $r->user in PerlLogHandler doesn't always return the
user set in the previous handler.

Can anyone shed any light on why the RequestRec is losing the user name?



I encountered a similar problem some time ago. Have a look at this
thread, maybe your problem is related:

http://marc.info/?l=apache-modperl&m=119996305532711&w=2

  

Nope, $r->main and $r->prev are both empty and $r->is_initial_req == 1

now I'm really baffled


Re: Losing $r->user between PerlFixupHandler and PerlLogHandler

2008-06-05 Thread Kevin Thorpe

Kevin Thorpe wrote:
Hi, I have just upgraded from Apache1 to Apache2 and I am now having 
problems with logging to my database.


I am using AuthCookie and AuthCookieDBI for logging in. AuthCookie 
sets $r->user in the PerlFixupHandler.
However reading $r->user in PerlLogHandler doesn't always return the 
user set in the previous handler.


Can anyone shed any light on why the RequestRec is losing the user name?

thanks
Ah, found it! mod_php was destroying the contents of $r->user as it was 
trying to do authentication itself. Notes

here about the problem

http://mail-archives.apache.org/mod_mbox/perl-modperl/200401.mbox/[EMAIL 
PROTECTED]


Re: Segfault Help!?!?

2008-06-05 Thread Fred Moyer

What version were you using that was causing the problems?

amiribarksdale wrote:

It appears that downgrading DBD::mysql to version 4.004 has done the trick.

Amiri



--
Red Hot Penguin Consulting LLC
mod_perl/PostgreSQL consulting and implementation
http://www.redhotpenguin.com/


Re: Segfault Help!?!?

2008-06-05 Thread amiribarksdale



Fred Moyer wrote:
> 
> What version were you using that was causing the problems?
> 

4.007.

Amiri
-- 
View this message in context: 
http://www.nabble.com/Segfault-Help%21-%21--tp17599739p17675687.html
Sent from the mod_perl - General mailing list archive at Nabble.com.



Re: mod_perl BOF at YAPC::NA

2008-06-05 Thread Perrin Harkins
On Sat, May 31, 2008 at 7:59 PM, Adam Prime <[EMAIL PROTECTED]> wrote:
> YAPC::NA is only a few weeks away, and I stumbled upon the beginning of
> plans for a BOF there.

Count me in.  This should be fun.  Work on your mod_php jokes.

- Perrin


Re: mod_perl BOF at YAPC::NA

2008-06-05 Thread David E. Wheeler

On Jun 5, 2008, at 12:09, Perrin Harkins wrote:

On Sat, May 31, 2008 at 7:59 PM, Adam Prime <[EMAIL PROTECTED]>  
wrote:
YAPC::NA is only a few weeks away, and I stumbled upon the  
beginning of

plans for a BOF there.


Count me in.  This should be fun.  Work on your mod_php jokes.


I'll be there, too.

David



[mp2]Perl_parse free some resources

2008-06-05 Thread Dinesh Premalal
Hi All,

I'm using modperl2 with PerlRun to invoke my cgi script. My server
configuration is as follows

Apache/2.2.6 (Unix) Axis2C/1.3.1 mod_perl/2.0.4 Perl/v5.10.0

script I invoke via mod_perl2 (say echo_service.pl) call to some other C
program. In that c program going to invoke a perl function. However when I
call perl function from C ,perl_parse method seems freeing some resources
that mod_perl2 using.

Here is the valgrind trace.
-
==21847== Invalid read of size 4
==21847==at 0x4A0A7C8: Perl_save_clearsv (scope.c:490)
==21847==by 0x4975B53: Perl_pp_padsv (pp_hot.c:309)
==21847==by 0x492DB39: Perl_runops_debug (dump.c:1931)
==21847==by 0x4969A2B: Perl_call_sv (perl.c:2646)
==21847==by 0x481A593: modperl_callback (modperl_callback.c:101)
==21847==by 0x481B8C4: modperl_callback_run_handlers
(modperl_callback.c:262)
==21847==by 0x481C458: modperl_callback_per_dir (modperl_callback.c:369)
==21847==by 0x4814668: modperl_response_handler_run (mod_perl.c:1000)
==21847==by 0x4814940: modperl_response_handler_cgi (mod_perl.c:1100)
==21847==by 0x807D864: ap_run_handler (in /usr/local/apache2/bin/httpd)
==21847==by 0x807DFB4: ap_invoke_handler (in
/usr/local/apache2/bin/httpd)
==21847==by 0x809BC1F: ap_process_request (in
/usr/local/apache2/bin/httpd)
==21847==  Address 0x51cf5cc is 8 bytes after a block of size 28 free'd
==21847==at 0x402265C: free (vg_replace_malloc.c:323)
==21847==by 0x48CCD1D: S_op_destroy (op.c:417)
==21847==by 0x48D2EBC: Perl_append_list (op.c:2588)
==21847==by 0x48C98BC: Perl_yyparse (perly.y:189)
==21847==by 0x4967A5D: S_parse_body (perl.c:2230)
==21847==by 0x4965FD3: perl_parse (perl.c:1650)
==21847==by 0x4CFDA29: wsf_xml_msg_recv_invoke_other
(wsf_xml_msg_recv.c:429)
==21847==by 0x4CFD329: wsf_xml_msg_recv_invoke_business_logic_sync
(wsf_xml_msg_recv.c:207)
==21847==by 0x46F899E: axis2_msg_recv_invoke_business_logic
(msg_recv.c:392)
==21847==by 0x46F877C: axis2_msg_recv_receive_impl (msg_recv.c:319)
==21847==by 0x46F89FA: axis2_msg_recv_receive (msg_recv.c:431)
==21847==by 0x46E9F34: axis2_engine_receive (engine.c:315)


Any idea on fixing this segmentation fault would be a great help.

thanks,
Dinesh

-- 
http://nethu.org/


Re: [mp2]Perl_parse free some resources

2008-06-05 Thread Dinesh Premalal
and my functions are.

static axiom_node_t *
wsf_xml_msg_recv_invoke_other (axis2_msg_recv_t* msg_recv,
   const axutil_env_t* env,
   wsf_svc_info_t* svc_info,
   axis2_msg_ctx_t* in_msg_ctx,
   axis2_msg_ctx_t* out_msg_ctx,
   axis2_char_t* function_name,
   axis2_char_t* class_name)
{
AXIS2_PARAM_CHECK (env->error, svc_info, NULL);
AXIS2_PARAM_CHECK (env->error, in_msg_ctx, NULL);
AXIS2_PARAM_CHECK (env->error, out_msg_ctx, NULL);

axiom_node_t *node = NULL;
axiom_node_t *om_node = NULL;
axiom_soap_envelope_t *envelope = NULL;
axiom_soap_body_t *body = NULL;
axis2_char_t *retstr = NULL;

/* extracting payload from the soap message */
envelope = axis2_msg_ctx_get_soap_envelope (in_msg_ctx, env);
body = axiom_soap_envelope_get_body (envelope, env);
om_node = axiom_soap_body_get_base_node (body, env);
om_node = axiom_node_get_first_child (om_node, env);

axis2_char_t *embedding[] = {"", NULL};
if (!svc_info->script_filename)
{
AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
 "perl function invocation failed, script_file name
not found for \
service %s", svc_info->svc_name);
return NULL;
}
/* passing script real path into perl interpreter. */
embedding[1] = svc_info->script_filename;

my_perl = perl_alloc();
perl_construct( my_perl );
/* loading WSO2::WSF::C and WSO2::WSF::Server using dynamic loader */
eval_pv("use WSO2::WSF::C", FALSE);
eval_pv("use WSO2::WSF::Server", FALSE);

if (perl_parse(my_perl, xs_init, 2, embedding, NULL))
{
AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "perl_parse method
failed");
return NULL;
}

perl_run(my_perl);

if (SvTRUE(ERRSV))
{
AXIS2_LOG_DEBUG (env->log, AXIS2_LOG_SI, "invoke perl function
failed");
}

retstr = invoke_perl_function(env, om_node, function_name, NULL);

if (retstr)
{
node = wsf_util_deserialize_buffer (env, retstr);
}

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

static axis2_char_t *
invoke_perl_function(const axutil_env_t *env, axiom_node_t *om_node,
 axis2_char_t *operation, axis2_char_t *class_name)
{
int count = 0;
axis2_char_t *inmsg = NULL;
axis2_char_t *ret = NULL;

if (!operation)
{
AXIS2_LOG_DEBUG (env->log, AXIS2_LOG_SI,
 "invoking perl function failed, operation not
available");
return;
}

if (om_node)
{
inmsg = axiom_node_to_string (om_node, env);
}

dSP ;

ENTER ;
SAVETMPS ;

PUSHMARK(SP) ;
XPUSHs(sv_2mortal(newSVpv(inmsg, 0)));
PUTBACK;

/* calling user perl function which returns a scaler value */
count = perl_call_pv(operation, G_SCALAR);
SPAGAIN;

if (count != 1)
{
croak("perl function invocation failed") ;
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
"perl function %s invocation failed", operation);

}

/* we pop string from the stack and doing strdup on it */
ret = savepv(POPpx);

PUTBACK;
FREETMPS ;
LEAVE ;
return ret;
}


/* xs_init is for support dynamic loading of modules */
static void
xs_init(pTHX)
{
char *file = __FILE__;
dXSUB_SYS;

/* DynaLoader is a special case */
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
}

thanks,
Dinesh
-- 
http://nethu.org/