Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://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/DBI.pm 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/DBI.pm 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

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-19 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found