#!/usr/bin/perl use strict; use CGI; use Authen::Captcha; my $query = new CGI; # # Generate captcha # # Note: in a real script, the data_folder should be placed # outside the www document root # my $captcha = Authen::Captcha->new( data_folder => '/var/www/html/captcha', output_folder => '/var/www/html/captcha', ); my $captcha_characters = 4; my $MD5 = $captcha->generate_code($captcha_characters); # # Print report # print $query->header(); print "<html><body><img src=\"/captcha/$MD5.png\"></body></html>";

Under mod_perl (1.3.x), this code causes a segmentation fault when it tries to run $captcha->generate_code(4). When not under mod_perl, it runs fine. In the same server I've run thousands of lines of perl code using DBI, CGI, and other assorted modules, so I don't think my mod_perl installation is mis-configured. I believe it was setup with DO_EVERYTHING=1 (or similar), the lack of which seemed to be the source of many of my early mod_perl woes a year ago.

There's some really big brains here, so I'm hoping that someone can point me to the instruction I need to fix this problem, and hopefully learn a little along the way.

Thanks for the responses in advance, and thanks for all the other great posts that keep me lurking here daily for months on end.


In reply to Authen::Captcha Segmentation Fault Under mod_perl by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.