Niko Tyni wrote:
[Resending, as my first try on March 1st apparently got lost somewhere.
 Apologies if this ends up as a duplicate.]

1. Problem Description:

We're switching to Perl 5.10 in Debian soon, and I'm trying to update the
mod_perl2 package to keep it working. Unfortunately the ModPerl-Registry
test suite is failing on the Sparc architecture because apache2 is killed
by a bus error (SIGBUS).

I can reproduce this with a "clean" current SVN trunk (r631932)
without any Debian-specific changes, and bisecting shows it broke with
r620440. This is still with Perl 5.8.8 (from Debian unstable, package
version 5.8.8-12).

The kernel messages show the SIGBUS is an unaligned access (as usual on
Sparc). I assume the U32->U16 changes in r615751 are related.

Good old Sparc!

Does this patch make the problem go away? (untested)

Index: src/modules/perl/modperl_mgv.c
===================================================================
--- src/modules/perl/modperl_mgv.c      (revision 635455)
+++ src/modules/perl/modperl_mgv.c      (working copy)
@@ -271,7 +271,7 @@
     }
     else {
         if ((cv = get_cv(name, FALSE))) {
-            handler->attrs = *modperl_code_attrs(aTHX_ cv);
+            memcpy(&(handler->attrs),modperl_code_attrs(aTHX_ cv), 
sizeof(handler->attrs));
             handler->mgv_cv =
                 modperl_mgv_compile(aTHX_ p, HvNAME(GvSTASH(CvGV(cv))));
             modperl_mgv_append(aTHX_ p, handler->mgv_cv, GvNAME(CvGV(cv)));
@@ -334,7 +334,7 @@
             modperl_mgv_new_name(handler->mgv_obj, p, name);
         }

-        handler->attrs = *modperl_code_attrs(aTHX_ cv);
+        memcpy(&(handler->attrs),modperl_code_attrs(aTHX_ cv), 
sizeof(handler->attrs));
         /* note: this is the real function after @ISA lookup */
         handler->mgv_cv = modperl_mgv_compile(aTHX_ p, HvNAME(GvSTASH(gv)));
         modperl_mgv_append(aTHX_ p, handler->mgv_cv, handler_name);

--
Philippe M. Chiasson     GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/       m/gozer\@(apache|cpan|ectoplasm)\.org/

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to