Marc Gracia wrote:
Hi, I have some problem that makes me mad for some time. We just setted up a web farm to support our application that runs
entirely using mod_perl.
Until now we used a traditional apache+vhosts to serve our customers,
but as it became so unadministrable, we started this new sistem to serve
better.
The basic structure is a reverse proxy as a frontend that redirects
requests to a bunch of different machines, each one with a bunch of
"apaches" on differents ports for each customer.
All this little apaches are running as non-root users on ports > 50000,
to protect better one customer of the other.


Well, once all setted up all seemed to go well. But on one page that
uses the Mail::Sendmail module to send an e-mail, the server crashed
with a segmentation fault.
After tracing all we could into all the perl modules, we found that the
server crashed
when Mail::Sendmail tried to open the network socket. Then we did a little test and setted up a program that just opened a
socket, and once the page are called, the server segfaults... The same test, works perfect outside mod_perl...


The server is an Fully Updated RedHat 9 custom "WOLK" 2.4 kernel ( 2.4.20-wolk4.9s )
perl-5.8 (first tried with stock redhat. Then I recompiled my own rpm
with no threads, with the same results)
apache-1.3.29 (EAPI+no EXPAT options, tested activating and deactivating
those options, with no success)
mod_ssl
mod_perl 1.29 (I've tested 1.27 and 1.28 also, with the same results)


Then I start debugging apache, to see what would be happening...

gdb httpd (gdb) run -X <Click on the fatal page with the Mail::Sendmail>

Program received signal SIGSEGV, Segmentation fault.
0x1555ef8e in do_lookup_versioned () from /lib/ld-linux.so.2
(gdb) where
#0  0x1555ef8e in do_lookup_versioned () from /lib/ld-linux.so.2
#1  0x1555e156 in _dl_lookup_versioned_symbol_internal () from
/lib/ld-linux.so.2
#2  0x15561e03 in fixup () from /lib/ld-linux.so.2
#3  0x15561cc0 in _dl_runtime_resolve () from /lib/ld-linux.so.2
#4  0x156e60a8 in getprotobyname_r@@GLIBC_2.1.2 () from /lib/libc.so.6
#5  0x156e5f5f in getprotobyname () from /lib/libc.so.6
#6  0x15d234eb in Perl_pp_gprotoent () at pp_sys.c:4856
#7  0x15d23299 in Perl_pp_gpbyname () at pp_sys.c:4823
#8  0x15cd08d2 in Perl_runops_debug () at dump.c:1414
#9  0x15c8c54e in S_call_body (myop=0x3fffdc40, is_eval=0) at
perl.c:2069
#10 0x15c8c1fd in Perl_call_sv (sv=0x15d72d54, flags=4) at perl.c:1987
#11 0x157c82ad in perl_call_handler (sv=0x914d048, r=0x985fffc,
args=0x0) at mod_perl.c:1661

As you can see, the segfault doesn't happen in the mod_perl land. So I'm afraid we can't do much about it. I'm not sure why it happens only under mod_perl. Perhaps because it's running under Apache -- as you can see the segfault is happening when it tries to dynamically resolve the symbol to use the thread-safe implementation of getprotobyname (that's the _r suffix). Try a static build of perl, it should have all the symbols resolved at the linking time. You didn't show us your 'perl -V' so I can't tell what kind of perl build you are using.


I've googled a bit, you can see similar reports in other projects:

http://groups.google.ca/groups?selm=bel0bm%241hbe%241%40FreeBSD.csie.NCTU.edu.tw&output=gplain
http://zebra.fh-weingarten.de/~maxi/html/transcode-users/2003-09/msg00030.html


-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to