You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by "David E. Wheeler" <da...@kineticode.com> on 2010/04/06 20:01:31 UTC

Re: Build Failure on Perl 5.12 RC3

Sorry, meant to have this thread on dev originally. Reposting.

On Apr 5, 2010, at 6:20 PM, Fred Moyer wrote:

> Builds ok here on OS X 10.6.3 (tests don't start yet though).  Wonder
> what the difference in our setups 

Okay, Fred and I have been hacking on this for a few hours, and thanks to a tip from Stefan O'Rear on #p5p, we've been able to trace the basic problem.

I can get mod_perl2 to build with Perl configured with:

   sh Configure -des -Duseshrplib

Or

   sh Configure -des -Duseshrplib -Dusemultiplicity -Duseithreads

But not

   sh Configure -des -Duseshrplib -Dusemultiplicity

That is, mod_perl will build with both multiplicity and ithreads or with neither, but not with multiplicity only. With multiplicity-only, I get:

   mod_perl.c: In function ‘modperl_shutdown’:
   mod_perl.c:62: error: ‘my_perl’ undeclared (first use in this function)
   mod_perl.c:62: error: (Each undeclared identifier is reported only once
   mod_perl.c:62: error: for each function it appears in.)

Fred says this is the relevant code:

   #ifndef USE_ITHREADS
   static apr_status_t modperl_shutdown(void *data)
   {
       modperl_cleanup_data_t *cdata = (modperl_cleanup_data_t *)data;
       PerlInterpreter *perl = (PerlInterpreter *)cdata->data;
       void **handles;

       handles = modperl_xs_dl_handles_get(aTHX);

And what Stefan says is: “you need to change your function declaration from ...(void *arg) to ...(pTHX_  void *arg)”.

I believe Fred managed to get past some of these errors by doing something like this. Fred, can you confirm?

So there you have it. If you build perl with

   sh Configure -des -Duseshrplib -Dusemultiplicity

and build mod_perl 2 against that, you should be able to replicate this issue.

Anyone familiar with this stuff and able to fix? I'd love to see mod_perl 2.05 drop when Perl 5.12.0 final drops (next week, I believe).

Thanks,

David

PS: I think the apreq stuff needs to be hit with the same multiplicity cluestick -- anyone know that code?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Build Failure on Perl 5.12 RC3

Posted by "David E. Wheeler" <da...@kineticode.com>.
On Apr 6, 2010, at 11:42 AM, Fred Moyer wrote:

> Here's the rest of it [1], but I'm highly skeptical on some of these
> changes.  Is pTHX_ passed as the first argument in all cases, or the
> last?
> 
> I still get some errors with this [2].

Stefan said last night that it should be first.

Best,

David


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Build Failure on Perl 5.12 RC3

Posted by Fred Moyer <fr...@redhotpenguin.com>.
On Tue, Apr 6, 2010 at 11:35 AM, Philip M. Gollucci
<pg...@p6m7g8.com> wrote:
>> Perhaps, but I'm still understanding the implications of the code
>> changes I'm making.  Here's one:
>>
>> Index: src/modules/perl/mod_perl.c
>> ===================================================================
>> --- src/modules/perl/mod_perl.c (revision 930926)
>> +++ src/modules/perl/mod_perl.c (working copy)
>> @@ -53,7 +53,7 @@
>>  }
>>
>>  #ifndef USE_ITHREADS
>> -static apr_status_t modperl_shutdown(void *data)
>> +static apr_status_t modperl_shutdown(pTHX_ void *data)
>
> Thats definitely a correct change.

Here's the rest of it [1], but I'm highly skeptical on some of these
changes.  Is pTHX_ passed as the first argument in all cases, or the
last?

I still get some errors with this [2].

[1]
Index: src/modules/perl/mod_perl.c
===================================================================
--- src/modules/perl/mod_perl.c (revision 930926)
+++ src/modules/perl/mod_perl.c (working copy)
@@ -53,7 +53,7 @@
 }

 #ifndef USE_ITHREADS
-static apr_status_t modperl_shutdown(void *data)
+static apr_status_t modperl_shutdown(pTHX_ void *data)
 {
     modperl_cleanup_data_t *cdata = (modperl_cleanup_data_t *)data;
     PerlInterpreter *perl = (PerlInterpreter *)cdata->data;
@@ -669,7 +669,7 @@
 }

 static int modperl_hook_post_config_last(apr_pool_t *pconf, apr_pool_t *plog,
-                                         apr_pool_t *ptemp, server_rec *s)
+                                         apr_pool_t *ptemp,
server_rec *s,pTHX_ void *data )
 {
     /* in the threaded environment, no server_rec/process_rec
      * modifications should be done beyond this point */
@@ -784,7 +784,7 @@

 #endif /* USE_ITHREADS */

-static apr_status_t modperl_child_exit(void *data)
+static apr_status_t modperl_child_exit(pTHX_ void *data)
 {
     char *level = NULL;
     server_rec *s = (server_rec *)data;
@@ -1006,7 +1006,7 @@
     return retval;
 }

-int modperl_response_handler(request_rec *r)
+int modperl_response_handler(request_rec *r, pTHX_ void *data)
 {
     MP_dDCFG;
 #ifdef USE_ITHREADS
@@ -1053,7 +1053,7 @@
     return retval;
 }

-int modperl_response_handler_cgi(request_rec *r)
+int modperl_response_handler_cgi(request_rec *r, pTHX_ void *data)
 {
     MP_dDCFG;
     GV *h_stdin, *h_stdout;


[2]
/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/stdbool.h:36:1:
warning: this is the location of the previous definition
mod_perl.c: In function 'modperl_startup':
mod_perl.c:338: warning: passing argument 3 of
'apr_pool_cleanup_register' from incompatible pointer type
mod_perl.c: In function 'modperl_hook_child_init':
mod_perl.c:828: warning: passing argument 3 of
'apr_pool_cleanup_register' from incompatible pointer type
mod_perl.c: In function 'modperl_register_hooks':
mod_perl.c:852: warning: passing argument 1 of 'ap_hook_post_config'
from incompatible pointer type
mod_perl.c: At top level:
mod_perl.c:1010: error: conflicting types for 'modperl_response_handler'
mod_perl.h:138: error: previous declaration of
'modperl_response_handler' was here
mod_perl.c:1057: error: conflicting types for 'modperl_response_handler_cgi'
mod_perl.h:139: error: previous declaration of
'modperl_response_handler_cgi' was here
make[1]: *** [mod_perl.lo] Error 1
make: *** [modperl_lib] Error 2

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Build Failure on Perl 5.12 RC3

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
> Perhaps, but I'm still understanding the implications of the code
> changes I'm making.  Here's one:
>
> Index: src/modules/perl/mod_perl.c
> ===================================================================
> --- src/modules/perl/mod_perl.c (revision 930926)
> +++ src/modules/perl/mod_perl.c (working copy)
> @@ -53,7 +53,7 @@
>   }
>
>   #ifndef USE_ITHREADS
> -static apr_status_t modperl_shutdown(void *data)
> +static apr_status_t modperl_shutdown(pTHX_ void *data)

Thats definitely a correct change.

I'm about to build a bunch of stuff and see if I can chip in.

-- 
------------------------------------------------------------------------
1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70  3F8C 75B8 8FFB DB9B 8C1C
Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354
VP Apache Infrastructure; Member, Apache Software Foundation
Committer,                        FreeBSD Foundation
Consultant,                       P6M7G8 Inc.
Sr. System Admin,                 Ridecharge Inc.

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: Build Failure on Perl 5.12 RC3

Posted by Fred Moyer <fr...@redhotpenguin.com>.
On Tue, Apr 6, 2010 at 11:01 AM, David E. Wheeler <da...@kineticode.com> wrote:
> Sorry, meant to have this thread on dev originally. Reposting.
>
> On Apr 5, 2010, at 6:20 PM, Fred Moyer wrote:
>
>> Builds ok here on OS X 10.6.3 (tests don't start yet though).  Wonder
>> what the difference in our setups
>
> Okay, Fred and I have been hacking on this for a few hours, and thanks to a tip from Stefan O'Rear on #p5p, we've been able to trace the basic problem.
>
> I can get mod_perl2 to build with Perl configured with:
>
>   sh Configure -des -Duseshrplib
>
> Or
>
>   sh Configure -des -Duseshrplib -Dusemultiplicity -Duseithreads
>
> But not
>
>   sh Configure -des -Duseshrplib -Dusemultiplicity
>
> That is, mod_perl will build with both multiplicity and ithreads or with neither, but not with multiplicity only. With multiplicity-only, I get:
>
>   mod_perl.c: In function ‘modperl_shutdown’:
>   mod_perl.c:62: error: ‘my_perl’ undeclared (first use in this function)
>   mod_perl.c:62: error: (Each undeclared identifier is reported only once
>   mod_perl.c:62: error: for each function it appears in.)
>
> Fred says this is the relevant code:
>
>   #ifndef USE_ITHREADS
>   static apr_status_t modperl_shutdown(void *data)
>   {
>       modperl_cleanup_data_t *cdata = (modperl_cleanup_data_t *)data;
>       PerlInterpreter *perl = (PerlInterpreter *)cdata->data;
>       void **handles;
>
>       handles = modperl_xs_dl_handles_get(aTHX);
>
> And what Stefan says is: “you need to change your function declaration from ...(void *arg) to ...(pTHX_  void *arg)”.
>
> I believe Fred managed to get past some of these errors by doing something like this. Fred, can you confirm?

Perhaps, but I'm still understanding the implications of the code
changes I'm making.  Here's one:

Index: src/modules/perl/mod_perl.c
===================================================================
--- src/modules/perl/mod_perl.c (revision 930926)
+++ src/modules/perl/mod_perl.c (working copy)
@@ -53,7 +53,7 @@
 }

 #ifndef USE_ITHREADS
-static apr_status_t modperl_shutdown(void *data)
+static apr_status_t modperl_shutdown(pTHX_ void *data)


>
> So there you have it. If you build perl with
>
>   sh Configure -des -Duseshrplib -Dusemultiplicity
>
> and build mod_perl 2 against that, you should be able to replicate this issue.
>
> Anyone familiar with this stuff and able to fix? I'd love to see mod_perl 2.05 drop when Perl 5.12.0 final drops (next week, I believe).
>
> Thanks,
>
> David
>
> PS: I think the apreq stuff needs to be hit with the same multiplicity cluestick -- anyone know that code?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
> For additional commands, e-mail: dev-help@perl.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org