The situation between running the script from the command line and running it from mod_perl is a fundamentally different one. When running it from the command line, your Perl interpreter is a dedicated process, while with mod_perl, the interpreter has been dynamically loaded into the Apache process (as a shared library), i.e. the Perl interpreter and Apache are one and the same process.

Such close cooperation requires the involved parties to behave as expected. And apparently, Apache does not expect the Perl part to create multiple threads of themselves. In other words, Apache - at least the MPM you're using (prefork?) - doesn't seem to be thread-safe.


In reply to Re: cgi thread creation segfault by Eliya
in thread cgi thread creation segfault by lelotto85

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.