Posted on 2008-09-04 20:44:15-07 by bergbrains
Test::Builder causes segfaults under mod_perl2

Recently, during the process of porting all my apache 1.3/mod_perl 1.x CGI's running under ModPerl::RegistryPrefork, I started running into regular segfaults. After a whole bunch of head scratching and testing, we narrowed down the problem to our use'ing Test::Builder.

It appears to be some kind of conflict that might have to do with the BEGIN code block that contains these lines for non-threaded Perl:

*share = sub { return $_[0] }; *lock = sub { 0 };

I don't completely understand what these do in the context of non-threaded apps, though they appear to be fairly innocuous at first glance.

In any case, it's just using Test::Builder that causes Apache 2.2/mp2 to segfault.

Many of our core modules contain test methods that are executed during our CVS checkin process as regression tests, so we'd have to completely redo our regression testing architecture to decouple Test::Builder from our code.

Has anybody had any similar experience with this problem, or can you help shed some light on the problem to help get us to a solution?

Thanks. Any help will, of course, be much appreciated.

Eric

Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.