Stas Bekman wrote:
>Steve Hay wrote:
>
>
>
>>>Index: src/modules/perl/mod_perl.c
>>>===================================================================
>>>--- src/modules/perl/mod_perl.c (revision 151089)
>>>+++ src/modules/perl/mod_perl.c (working copy)
>>>@@ -544,9 +544,9 @@
>>>{
>>> MP_TRACE_i(MP_FUNC, "mod_perl sys init\n");
>>>
>>>-#if 0 /*XXX*/
>>>- PERL_SYS_INIT(0, NULL);
>>>+ PERL_SYS_INIT3(0, NULL, NULL);
>>>
>>>
>>>
>>>
>>No -- as I said in my last mail (quoted above) that gives an "Illegal
>>indirection" error, which is why I was moved to supply some variables
>>instead.
>>
>>The full error text is this:
>>
>>mod_perl.c(547) : error C2100: illegal indirection
>>mod_perl.c(547) : error C2100: illegal indirection
>>NMAKE : fatal error U1077: 'cl' : return code '0x2'
>>Stop.
>>NMAKE : fatal error U1077: 'cd' : return code '0x2'
>>Stop.
>>
>>The MSDN docs describe compiler error "C2100: illegal indirection" as
>>follows:
>>
>> "The indirection operator (*) was applied to a nonpointer value."
>>
>>The reason is that on Win32 PERL_SYS_INIT3(a,b,c) is
>>
>> MALLOC_CHECK_TAINT2(*a,*b);
>> Perl_win32_init(a,b);
>>
>>so it's the *a and *b in the MALLOC_CHECK_TAINT2() call which it's
>>whining about in the case where a and b were non-pointers. So the
>>obvious fix seemed to be:
>>
>> PERL_SYS_INIT3((int *)NULL, (char ***)NULL, (char ***)NULL);
>>
>>This compiles cleanly, but then crashes on startup because now it's
>>trying to resolve the NULL pointer values!
>>
>>Explicitly calling
>>
>> MALLOC_CHECK_TAINT2(0, (char **)NULL);
>> Perl_win32_init((int *)0, (char ***)NULL);
>>
>>works (both compiling and running), but that's cheating (and also won't
>>work on Linux ;)
>>
>>Any other ideas? If not then can you live with the warnings about
>>unused variables? That's at least better than the situation for me
>>without a PERL_SYS_INIT3() call at all ;)
>>
>>
>
>sure, just add to your patch:
>
> /* not every OS uses those vars in PERL_SYS_INIT3 macro */
> argc = argc; argv = argv; env = env;
>
>in which case it's fine.
>
OK, new patch attached. This compiles cleanly and fixes the perl-malloc
issues for me. Hope it's OK for you too.
- Steve
------------------------------------------------
Radan Computational Ltd.
The information contained in this message and any files transmitted with it are
confidential and intended for the addressee(s) only. If you have received this
message in error or there are any problems, please notify the sender
immediately. The unauthorized use, disclosure, copying or alteration of this
message is strictly forbidden. Note that any views or opinions presented in
this email are solely those of the author and do not necessarily represent
those of Radan Computational Ltd. The recipient(s) of this message should
check it and any attached files for viruses: Radan Computational will accept no
liability for any damage caused by any virus transmitted by this email.
Index: src/modules/perl/mod_perl.c
===================================================================
--- src/modules/perl/mod_perl.c (revision 151330)
+++ src/modules/perl/mod_perl.c (working copy)
@@ -542,11 +542,17 @@
*/
static apr_status_t modperl_sys_init(void)
{
+ int argc = 0;
+ char **argv = NULL, env = NULL;
+
MP_TRACE_i(MP_FUNC, "mod_perl sys init\n");
+ /* not every OS uses those vars in PERL_SYS_INIT3 macro */
+ argc = argc; argv = argv; env = env;
+
+ PERL_SYS_INIT3(&argc, &argv, &env);
+
#if 0 /*XXX*/
- PERL_SYS_INIT(0, NULL);
-
#ifdef PTHREAD_ATFORK
if (!ap_exists_config_define("PERL_PTHREAD_ATFORK_DONE")) {
PTHREAD_ATFORK(Perl_atfork_lock,
@@ -581,9 +587,8 @@
modperl_perl_pp_unset_all();
-#if 0 /*XXX*/
PERL_SYS_TERM();
-#endif
+
return APR_SUCCESS;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]