You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@apache.org on 2002/05/23 06:03:46 UTC

cvs commit: modperl/src/modules/perl mod_perl.c mod_perl.h

dougm       02/05/22 21:03:46

  Modified:    src/modules/perl mod_perl.c mod_perl.h
  Log:
  better fix for DynaLoader vs XSLoader workaround
  
  Revision  Changes    Path
  1.144     +23 -1     modperl/src/modules/perl/mod_perl.c
  
  Index: mod_perl.c
  ===================================================================
  RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.c,v
  retrieving revision 1.143
  retrieving revision 1.144
  diff -u -r1.143 -r1.144
  --- mod_perl.c	24 Mar 2002 23:01:33 -0000	1.143
  +++ mod_perl.c	23 May 2002 04:03:46 -0000	1.144
  @@ -569,6 +569,28 @@
       perl_startup(s, p);
   }
   
  +static void mod_perl_boot(void *data)
  +{
  +    /* make sure DynaLoader is loaded before XSLoader
  +     * to workaround bug in 5.6.1 that can trigger a segv
  +     * when using modperl as a dso
  +     */
  +    perl_require_module("DynaLoader", NULL);
  +}
  +
  +static void mod_perl_xs_init(void)
  +{
  +    xs_init();
  +
  +    /* XXX: in 5.7.2+ we can call the body of mod_perl_boot here
  +     * but in 5.6.1 the Perl runtime is not properly setup yet
  +     * so we have to pull this stunt to delay
  +     */
  +#ifdef SAVEDESTRUCTOR_X
  +    SAVEDESTRUCTOR_X(mod_perl_boot, 0);
  +#endif
  +}
  +
   void perl_startup (server_rec *s, pool *p)
   {
       char *argv[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL };
  @@ -677,7 +699,7 @@
       MP_TRACE_g(fprintf(stderr, "constructing perl interpreter...ok\n"));
       perl_construct(perl);
   
  -    status = perl_parse(perl, xs_init, argc, argv, NULL);
  +    status = perl_parse(perl, mod_perl_xs_init, argc, argv, NULL);
       if (status != OK) {
   	MP_TRACE_g(fprintf(stderr,"not ok, status=%d\n", status));
   	perror("parse");
  
  
  
  1.115     +0 -1      modperl/src/modules/perl/mod_perl.h
  
  Index: mod_perl.h
  ===================================================================
  RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.h,v
  retrieving revision 1.114
  retrieving revision 1.115
  diff -u -r1.114 -r1.115
  --- mod_perl.h	23 May 2002 03:07:27 -0000	1.114
  +++ mod_perl.h	23 May 2002 04:03:46 -0000	1.115
  @@ -1192,7 +1192,6 @@
   /* perl_config.c */
   
   #define require_Apache(s) \
  -    perl_require_module("DynaLoader", s); \
       perl_require_module("Apache", s)
   
   char *mod_perl_auth_name(request_rec *r, char *val);