Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Greetings, wise ones -- humbled, as always, in your presence. I have come to seek your blessing on an apache remedy that I concocted.

In my attempts to get my Class::DBI webapp to graze on the plains of Redmond, I have found with grief that it reliably causes Apache2 to crash and burn whenever I try to run Apache2 with more threads than one, brought down by a swarm of flame-arrows, shot by the many threads. The typical dying words of the app include "Free to wrong pool" and "Attempt to free non-existent shared string", finger-written with its own blood, along with the address of Clone::clone in the Class::DBI source.

I replaced Clone::clone in Class/ with Storable::dclone and there is no problem now, though a quick benchmark seems to indicate that the application has slowed down. Using the latest version of Clone or sundry versions of Apache2 had not helped. I believe all the perls that I tried had been built from ActiveState sources--I did not try Strawberry or other gcc-compiled perls.

As a fish out of water in Win32 land (though only a frog out of water elsewhere), I need to call upon Win32-experienced monks here. Is Clone inherently bad with multiple-threads of mod_perl2 on Win32, or could it be amenable to a fix by using this compiler instead of that, or downloading the whole combo from such and such repo etc?

How about Storable::dclone replacing Clone::clone? I have not had a chance to run extensive tests yet, but I hope I wasn't too optimistic when I assumed that the two were interchangeble.

Update: The relevant Apache directive is ThreadsPerChild. Having ThreadsPerChild N in httpd.conf with N greater than unity and stress-testing the app (slight stress, really) with apache ab or even by just quickly click-click-clicking for a few seconds on a link that leads to the Clone::clone line in Class/ getting executed causes a crash. The webapp itself does not try to use threads.

Update: Class::DBI maintainers inform me that Storable::dclone and Clone::clone are not interchangable. As an example, they say that Storable::dclone cannot clone closures, which are created, for example, to implement triggers.

In reply to Class::DBI explodes on mod_perl/Win32 due to Clone by fenLisesi

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (6)
    As of 2017-11-25 00:36 GMT
    Find Nodes?
      Voting Booth?
      In order to be able to say "I know Perl", you must have:

      Results (355 votes). Check out past polls.