FS#25008 - [mod_perl] causing apache to segfault

Attached to Project: Arch Linux
Opened by Lukas Sabota (punkrockguy318) - Monday, 04 July 2011, 00:32 GMT
Last edited by Angel Velasquez (angvp) - Sunday, 24 July 2011, 21:52 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Francois Charette (Firmicus)
Angel Velasquez (angvp)
Florian Pritz (bluewind)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:
When mod_perl is loaded, apache2 is failing with a segfault:

:: Starting Apache Web Server
[BUSY] /usr/sbin/apachectl: line 84: 18930 Segmentation fault $HTTPD -k $ARGV
[FAIL]

Additional info:
* package version(s) - tried perl/mod_perl in both extra (2.0.5-6) and testing (2.0.5-7)
* config and/or log files etc.
/var/log/httpd/error_log indicates:
---
[Sun Jul 03 19:54:42 2011] [notice] seg fault or similar nasty error detected in the parent process
---


Steps to reproduce:
Install apache, perl, and mod_perl
Load mod_perl in /etc/httpd/conf/httpd.conf (my setup is as follows:)
LoadModule perl_module /usr/lib/httpd/modules/mod_perl.so
Run apache (/etc/rc.d/apache start)
See the segfault and wince

This task depends upon

Closed by  Angel Velasquez (angvp)
Sunday, 24 July 2011, 21:52 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed on 2.0.5-8, thanks Evangelos
Comment by Lukas Sabota (punkrockguy318) - Monday, 04 July 2011, 00:37 GMT
I've attached an strace of apachectl -k start FWIW: http://pastebin.com/EqTrhyVT
Comment by Igor Slepchin (igors) - Monday, 04 July 2011, 17:52 GMT
Same exact thing happens to me on Arch on arm - on a 100% fresh and updated install, where the only change made to the stock apache config is the line for loading mod_perl. The stack trace from the core file:

(gdb) bt
#0 0x40a3b270 in modperl_env_clear () from /etc/httpd/modules/mod_perl.so
#1 0x40a2bf58 in ?? () from /etc/httpd/modules/mod_perl.so
Cannot access memory at address 0x0
#2 0x40a2bf58 in ?? () from /etc/httpd/modules/mod_perl.so
Cannot access memory at address 0x0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

apache 2.2.19-1 and mod_perl 2.0.5-6
Comment by Jan de Groot (JGC) - Monday, 04 July 2011, 18:06 GMT
Are you using worker or prefork? mod_perl 2.0.5 won't work together with the worker mpm when perl 5.14 is used. In that case this bug is already solved in a development snapshot of mod_perl.
Comment by Igor Slepchin (igors) - Monday, 04 July 2011, 18:22 GMT
It's all default config other than loading mod_perl, so prefork unless I'm missing something here:

$ apachectl -l
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c
Comment by Lukas Sabota (punkrockguy318) - Monday, 04 July 2011, 19:22 GMT
I can also confirm that my apache server is using prefork

I believe that the arch compiles prefork into apache by default

[me@host:~] httpd -l
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c
Comment by Jan de Groot (JGC) - Monday, 04 July 2011, 20:01 GMT
I can't reproduce your crash on x86_64. mod_perl loads fine here. Where did you place the LoadModule exactly?
Comment by Igor Slepchin (igors) - Monday, 04 July 2011, 20:11 GMT
Right after all other LoadModule commands:

diff httpd.conf httpd.conf.orig
121d120
< LoadModule perl_module modules/mod_perl.so

Complete http.conf is at http://pastie.org/2164269 but that was literally the only change.

Note that I'm running this on ARM so 32-bit...
Comment by Lukas Sabota (punkrockguy318) - Monday, 04 July 2011, 20:48 GMT
Just deployed a fresh ArchLinux64 with apache and mod_perl

Everything worked fine; can't seem to reproduce on 64 bit.
Comment by Lukas Sabota (punkrockguy318) - Monday, 04 July 2011, 20:50 GMT
FWIW; all of my tests have been done on a xen-based VPS
Comment by Jan de Groot (JGC) - Monday, 04 July 2011, 21:05 GMT
So what officially supported platform is it that fails? i686 or x86_64? ARM is not supported.
Comment by Igor Slepchin (igors) - Monday, 04 July 2011, 21:14 GMT
Fair point - I meant to file it with archlinuxarm.org but then bumped into this and figured the problem could me more generic. I'll try it out on a 32-bit x86 in a few days and report how it goes.
Comment by Lukas Sabota (punkrockguy318) - Monday, 04 July 2011, 21:59 GMT
I can confirm that this fails on the i686 officially supported platform, but does not fail on x86_64
Comment by Jim Karsten (iiijjjiii) - Tuesday, 05 July 2011, 13:34 GMT
I have mod_perl working fine on x86_64 but apache seg faults on i686.
Comment by IONOFF Joachim (LinLo) - Tuesday, 05 July 2011, 15:22 GMT
I can confirm that this fails on i686.
I tried to remake perl & mod_perl, and latest dev version of mod_perl, with the same segmentation fault at httpd start.
Comment by Igor Slepchin (igors) - Wednesday, 06 July 2011, 19:02 GMT
Yeah, it's segfaulting for me on a freshly installed and fully updated i686 as well. The stack trace:


(gdb) bt
#0 0xb7102cf4 in modperl_env_clear () from /etc/httpd/modules/mod_perl.so
#1 0xb70f0f3a in ?? () from /etc/httpd/modules/mod_perl.so
#2 0xb704b601 in Perl_leave_scope () from /usr/lib/perl5/core_perl/CORE/libperl.so
#3 0xb704c5a3 in Perl_pop_scope () from /usr/lib/perl5/core_perl/CORE/libperl.so
#4 0xb6fab341 in perl_parse () from /usr/lib/perl5/core_perl/CORE/libperl.so
#5 0xb70f12f6 in modperl_startup () from /etc/httpd/modules/mod_perl.so
#6 0xb70f126c in modperl_startup () from /etc/httpd/modules/mod_perl.so
#7 0xb70f17a6 in modperl_init () from /etc/httpd/modules/mod_perl.so
#8 0xb70f195e in modperl_hook_init () from /etc/httpd/modules/mod_perl.so
#9 0x08079689 in ap_run_open_logs ()
#10 0x08064a1a in main ()

Same versions of apache and mod_perl as above: apache 2.2.19-1 and mod_perl 2.0.5-6, perl 5.14.1-1
Comment by Lukas Sabota (punkrockguy318) - Wednesday, 06 July 2011, 19:49 GMT
I just checked out the latest mod_perl subversion (r1143539) and compiled/installed and this bug still exists on i686 with the latest version in svn:

:: Restarting Apache Web Server[BUSY]
/usr/sbin/apachectl: line 84: 678 Segmentation fault $HTTPD -k $ARGV [FAIL]
Comment by Dan McGee (toofishes) - Friday, 15 July 2011, 21:04 GMT
This is probably similar to the issues seen in  FS#24540  and  FS#24577 - I'm guessing CFLAGS are involved somehow, and we only saw those break on i686 as well.
Comment by Arch Man (archieman) - Monday, 18 July 2011, 06:02 GMT
I am experiencing the same issue on i686 as soon as mod_perl is introduced.

/usr/sbin/apachectl: line 84: 13947 Segmentation fault $HTTPD -k $ARGV
Comment by Andrew Fischer (wizzrobe) - Monday, 18 July 2011, 16:29 GMT
I can confirm this issue on i686 as well with apache 2.2.19-1 and mod_perl 2.0.5-7.

/usr/sbin/apachectl: line 84: 1351 Segmentation fault $HTTPD -k $ARGV

dmesg shows:
httpd[1351]: segfault at d ip b720bcf4 sp bf89f2e0 error 4 in mod_perl.so[b71ee000+34000]

Comment by Dan McGee (toofishes) - Monday, 18 July 2011, 16:38 GMT
Guys, this isn't the Ubuntu bugtracker. We don't need or want useless confirmation of an already confirmed bug.
Comment by Evangelos Foutras (foutrelis) - Monday, 18 July 2011, 18:24 GMT
Applied a patch from openSUSE which appears to solve these segfaults.

A couple of confirmations that the issue doesn't exist in mod_perl 2.0.5-8 would be nice. :)
Comment by Lukas Sabota (punkrockguy318) - Monday, 18 July 2011, 22:27 GMT
Works for me in mod_perl 2.0.5-8 with i686 . \o/

Thanks so much !!!
Comment by Andrew Fischer (wizzrobe) - Monday, 18 July 2011, 22:36 GMT
I can also confirm, mod_perl 2.0.5-8 solves this issue. Huge thanks!

Loading...