https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6060

           Summary: Perl5.8.9 crashes while compiling long code from generic
                    rules
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Libraries
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: mark.marti...@ijs.si


After upgrading perl to 5.8.9 (FreeBSD, from ports), the interpreter
crashes when it tries to compile (eval) code autogenerated from rules
as soon as some module with threading like BerkeleyDB is brought in
(which apparently switches from a large normal stack to a smaller
per-thread stack size under FreeBSD).

This can be demonstrated by writing to a file what is intended to
be 'eval'-ed, then compiling such autogenerated code standalone:

perl -MBerkeleyDB body_0.pm
Bus error: 10 (core dumped)

I filed a perl bug report #63054:

  http://rt.perl.org/rt3/Public/Bug/Display.html?id=63054
  Perl_peep recursion exceeds stack in 5.8.9 eval-ing a long program

but I'm not yet sure how to proceed. Looks like I need to
downgrade to 5.8.8 or upgrade to 5.10.0, which is a bit of a
pain when most Perl modules are installed from FreeBSD ports.

A workaround could be if SA produced smaller code sections,
the 83600 lines of code for body rules at prio=0 is a lot
(using some SARE and ZDF rules), perl5.8.9 can survive about
two thirds of that.

Here are line counts (wc -l) of code autogenerated from rules,
when written to a file:

      19 meta_899.pm
      57 full_500.pm
     112 uri_500.pm
     255 head_500.pm
     256 rawbody_500.pm
     343 full_0.pm
    2251 meta_500.pm
    4720 uri_0.pm
    6912 rawbody_0.pm
   24340 head_0.pm
   83600 body_0.pm

Compiling the head_0.pm is still below a stack size, the body_0.pm
is above it and causes a Bus error.

Btw, I experimented with changes based on Bug 5876 (storing code to a
file and letting 'do' deal with it). It is promising, it does indeed
reduce memory footprint, although is does not provide a solution
for this 5.8.9 problem. Perhaps a solution could take both aspects
into considerations (I have available fresh patches along the lines
of Bug 5876, separate for eval and for generic rules, I can make them
available).


-- 
Configure bugmail: 
https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to