Bug 4567

Summary: apache dies every time a script contains "exit" when mod_perl is enabled
Product: Mageia Reporter: Frédéric "LpSolit" Buclin <LpSolit>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED OLD QA Contact:
Severity: major    
Priority: Normal CC: djmarian4u, dmorganec, guillomovitch, jquelin, luigiwalser, mageia, pterjan, shlomif, stormi-mageia, thierry.vignaud
Version: 2Keywords: Triaged
Target Milestone: ---   
Hardware: i586   
OS: Linux   
Whiteboard:
Source RPM: apache-mod_perl CVE:
Status comment:

Description Frédéric "LpSolit" Buclin 2012-02-17 23:50:39 CET
To make Bugzilla faster, I want to enable mod_perl in Apache. To do that, I simply have to add

  PerlSwitches -w -T
  PerlConfigRequire /var/www/html/bugzilla/mod_perl.pl

in httpd.conf. But it fails miserably: every time a script has "exit" in it, the script fails with e.g.:

  (null) at /var/www/html/bugzilla/testagent.cgi line 23.

I tried the same steps with Fedora 16, and it works like a charm. Both Mageia 1 and Fedora 16 have mod_perl 2.0.5. Also, I see that Fedora has mod_perl.so under /etc/httpd/modules/mod_perl.so, while Mageia has it under /usr/lib/apache-extramodules/mod_perl.so. I don't know if this matters, but adding

  LoadModule perl_module modules/mod_perl.so

in httpd.conf doesn't work if mod_perl.so is not in /etc/httpd/modules/. I tried to copy it to this location, but this didn't help to fix the die on "exit".
Comment 1 Frédéric "LpSolit" Buclin 2012-02-17 23:56:11 CET
May be related to http://perl.apache.org/docs/2.0/api/ModPerl/Util.html#C_exit_
Comment 2 Frédéric "LpSolit" Buclin 2012-02-18 14:20:42 CET
I tried with both Apache 2.2.17 and 2.2.22, and the same error occurs. It fails on each "exit".

CC: (none) => shlomif

Comment 3 Frédéric "LpSolit" Buclin 2012-02-18 15:02:47 CET
Same error in Cauldron.
Comment 4 Manuel Hiebel 2012-02-19 09:08:35 CET
Hi, thanks for reporting this bug.
As there is no maintainer for this package I added the committers in CC.
Any ideas ?

(Please set the status to 'assigned' if you are working on it)

CC: (none) => dmorganec, guillomovitch, luigiwalser, pterjan
Source RPM: (none) => apache

Comment 5 David Walser 2012-02-19 09:10:52 CET
As far as I know, apache-mod_perl has been broken since Mageia 1 came out.  Hopefully we can fix it.
Comment 6 Pascal Terjan 2012-02-19 09:27:34 CET
I don't know anything about mod_perl but we will probably want  https://github.com/apache/mod_perl/commit/1bafd3d1decf0a3b770b55f3d2f1ac5876a5864f in cauldron (fixes a segfault with perl 5.14) and https://github.com/apache/mod_perl/commit/71861f07e0d6c2f1b752679383066c1aac5e9b43

I didn't find anything about the problem reported in this bug.
Comment 7 David Walser 2012-03-04 23:25:55 CET
I just uploaded apache-mod_perl-2.0.5-14.mga2 with the patches Pascal suggested.
Comment 8 Frédéric "LpSolit" Buclin 2012-03-05 01:49:24 CET
(In reply to comment #7)
> I just uploaded apache-mod_perl-2.0.5-14.mga2 with the patches Pascal
> suggested.

This doesn't help about this bug at all. Still the same error message.
Dan Joita 2012-03-07 11:21:24 CET

CC: (none) => djmarian4u
Summary: Apache dies every time a script contains "exit" when mod_perl is enabled => apache dies every time a script contains "exit" when mod_perl is enabled

David Walser 2012-05-31 02:32:10 CEST

CC: (none) => jquelin

David Walser 2012-05-31 02:32:26 CEST

CC: (none) => mageia

Comment 9 Manuel Hiebel 2012-11-05 16:51:59 CET
This message is a reminder that Mageia 1 is nearing its end of life. 
In approximately 25 days from now, Mageia will stop maintaining and issuing 
updates for Mageia 1. At that time this bug will be closed as WONTFIX (EOL) if it 
remains open with a Mageia 'version' of '1'.

Package Maintainer: If you wish for this bug to remain open because you plan to 
fix it in a currently maintained version, simply change the 'version' to a later 
Mageia version prior to Mageia 1's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not 
be able to fix it before Mageia 1 is end of life.  If you would still like to see 
this bug fixed and are able to reproduce it against a later version of Mageia, 
you are encouraged to click on "Version" and change it against that version 
of Mageia.

Although we aim to fix as many bugs as possible during every release's lifetime, 
sometimes those efforts are overtaken by events. Often a more recent Mageia 
release includes newer upstream software that fixes bugs or makes them obsolete.

--
Mageia Bugsquad
Frédéric "LpSolit" Buclin 2012-11-05 17:25:41 CET

Version: 1 => 2

Comment 10 Guillaume Rousse 2012-11-06 14:32:20 CET
AFAIK, this behaviour is expected, meaning you should not call exit() withing mod_perl:

http://perl.apache.org/docs/1.0/guide/porting.html#Terminating_requests_and_processes__the_exit___and_child_terminate___functions

I'm curious about the difference with fedora, tough. They do use a different spec file, and a different patch to fix the apache 2.4 issue (see bug #7360).
Comment 11 Pascal Terjan 2012-11-06 14:36:36 CET
The doc says:

Starting from Perl version 5.6 mod_perl will override exit() behind the scenes, using CORE::GLOBAL::, a new magical package.

Which is the part which does not seem to work for us
Samuel Verschelde 2013-08-28 14:51:25 CEST

Keywords: (none) => Triaged
CC: (none) => stormi
Source RPM: apache => apache-mod_perl

Comment 12 Manuel Hiebel 2013-10-22 12:10:37 CEST
This message is a reminder that Mageia 2 is nearing its end of life.
Approximately one month from now Mageia will stop maintaining and issuing updates for Mageia 2. At that time this bug will be closed as WONTFIX (EOL) if it remains open with a Mageia 'version' of '2'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Mageia version prior to Mageia 2's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Mageia 2 is end of life.  If you would still like to see this bug fixed and are able to reproduce it against a later version of Mageia, you are encouraged to click on "Version" and change it against that version of Mageia.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Mageia release includes newer upstream software that fixes bugs or makes them obsolete.

-- 
The Mageia Bugsquad
Frédéric "LpSolit" Buclin 2013-10-24 23:45:20 CEST

Version: 2 => 3

Comment 13 Thierry Vignaud 2013-10-30 20:43:24 CET
Is it still valid as of Mageia 3 ?

CC: (none) => thierry.vignaud

Comment 14 Frédéric "LpSolit" Buclin 2013-10-30 20:58:31 CET
(In reply to Thierry Vignaud from comment #13)
> Is it still valid as of Mageia 3 ?

Seems to work fine with apache-2.4.4-7.4.mga3 and apache-mod_perl-2.0.7-12.20130221svn1448242.mga3
Comment 15 David Walser 2013-10-30 21:07:14 CET
Thanks.  Version assignment set back to 2 so it will be closed as OLD if not fixed by EOL.

Version: 3 => 2

Comment 16 Thierry Vignaud 2013-10-30 21:09:56 CET
Let's close it now then

Status: NEW => RESOLVED
Resolution: (none) => OLD