ModPerl does not work

Bug #2073536 reported by Magnus Johansson

This bug report will be marked for expiration in 40 days if no further activity occurs. (find out why)

6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libapache2-mod-perl2 (Ubuntu)
Incomplete
Undecided
Unassigned

Bug Description

After upgrading from Ubunto 23.10 to 24.04 (using the release-upgrade tool), my modperl application no longer works.

Gets "500 Internal Server Error" in browser and the following error in /var/log/apache2/error.log:

[Thu Jul 18 20:56:25.073817 2024] [perl:error] [pid 75835:tid 126932297451200] [client ::1:34036] failed to resolve handler `ModPerl::Registry': Constants from lexical variables potentially modified elsewhere are no longer permitted at /usr/share/perl/5.38/constant.pm line 41.\nBEGIN failed--compilation aborted at /usr/share/perl/5.38/constant.pm line 45.\nCompilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.38/APR.pm line 27.\nBEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.38/APR.pm line 27.\nCompilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.38/APR/Table.pm line 23.\nBEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.38/APR/Table.pm line 23.\nCompilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.38/ModPerl/RegistryCooker.pm line 39.\nBEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.38/ModPerl/RegistryCooker.pm line 39.\nCompilation failed in require at /usr/share/perl/5.38/base.pm line 137.\n\t...propagated at /usr/share/perl/5.38/base.pm line 159.\nBEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.38/ModPerl/Registry.pm line 27.\nCompilation failed in require at (eval 2) line 1.\n

Have tried reinstalling apache2-server and the modperl package but the problem remains.

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: libapache2-mod-perl2 2.0.13-1build5
ProcVersionSignature: Ubuntu 6.8.0-38.38-generic 6.8.8
Uname: Linux 6.8.0-38-generic x86_64
ApportVersion: 2.28.1-0ubuntu3
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Thu Jul 18 21:00:58 2024
EcryptfsInUse: Yes
InstallationDate: Installed on 2021-09-07 (1045 days ago)
InstallationMedia: Ubuntu 18.04.5 LTS "Bionic Beaver" - Release amd64 (20200806.1)
SourcePackage: libapache2-mod-perl2
UpgradeStatus: Upgraded to noble on 2024-05-23 (56 days ago)

Revision history for this message
Magnus Johansson (magnus-j) wrote :
Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Hello Magnus, thank you for making this bug report and making Ubuntu better!

Could you please share a quick reproducer for this failure in your environment?

Changed in libapache2-mod-perl2 (Ubuntu):
status: New → Incomplete
Revision history for this message
Magnus Johansson (magnus-j) wrote :

Hi Mitchell,

I'm not sure I understand what you mean by "quick reproducer".

I added a perltest.conf to my apache2 and created a test-mod_perl.cgi to run (attached a tar-file with those). Get the following error in /var/log/apache2/error.log:

[Tue Jul 23 10:25:41.146682 2024] [perl:error] [pid 7157:tid 139571046123200] [client ::1:60908] failed to resolve handler `ModPerl::Registry': Constants from lexical variables potentially modified elsewhere are no longer permitted at /usr/share/perl/5.38/constant.pm line 41.\nBEGIN failed--compilation aborted at /usr/share/perl/5.38/constant.pm line 45.\nCompilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.38/APR.pm line 27.\nBEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.38/APR.pm line 27.\nCompilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.38/APR/Table.pm line 23.\nBEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.38/APR/Table.pm line 23.\nCompilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.38/ModPerl/RegistryCooker.pm line 39.\nBEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.38/ModPerl/RegistryCooker.pm line 39.\nCompilation failed in require at /usr/share/perl/5.38/base.pm line 137.\n\t...propagated at /usr/share/perl/5.38/base.pm line 159.\nBEGIN failed--compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.38/ModPerl/Registry.pm line 27.\nCompilation failed in require at (eval 2) line 1.\n

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Hi Magnus,

Thank you for providing a reproducer.

Unfortunately, I have not been able to reproduce the issue locally. Here are the steps I did (inside a Noble LXD container):

# apt install -y apache2 libapache2-mod-perl2
# cp magnus/etc/apache2/conf-available/perltest.conf /etc/apache2/conf-available/
# cp -a magnus/var/www/perl/ /var/www/
# a2enconf perltest
# systemctl restart apache2
# curl http://localhost/perl/test-mod_perl.cgi
number $a = 2

Nothing problematic shows up on apache2's error.log either:

# tail /var/log/apache2/error.log
[Wed Jul 24 14:42:07.607343 2024] [mpm_event:notice] [pid 2015:tid 140456469927808] AH00489: Apache/2.4.58 (Ubuntu) mod_perl/2.0.13 Perl/v5.38.2 configured -- resuming normal operations
[Wed Jul 24 14:42:07.607402 2024] [core:notice] [pid 2015:tid 140456469927808] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jul 24 14:44:14.571767 2024] [mpm_event:notice] [pid 2015:tid 140456469927808] AH00492: caught SIGWINCH, shutting down gracefully
[Wed Jul 24 14:44:14.630236 2024] [mpm_event:notice] [pid 2254:tid 140205802215296] AH00489: Apache/2.4.58 (Ubuntu) mod_perl/2.0.13 Perl/v5.38.2 configured -- resuming normal operations
[Wed Jul 24 14:44:14.630330 2024] [core:notice] [pid 2254:tid 140205802215296] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jul 24 14:44:20.923423 2024] [mpm_event:notice] [pid 2254:tid 140205802215296] AH00492: caught SIGWINCH, shutting down gracefully
[Wed Jul 24 14:44:20.985419 2024] [mpm_event:notice] [pid 2346:tid 139803706013568] AH00489: Apache/2.4.58 (Ubuntu) mod_perl/2.0.13 Perl/v5.38.2 configured -- resuming normal operations
[Wed Jul 24 14:44:20.985488 2024] [core:notice] [pid 2346:tid 139803706013568] AH00094: Command line: '/usr/sbin/apache2'
Variable "$a" will not stay shared at /var/www/perl/test-mod_perl.cgi line 12.
Variable "$a" will not stay shared at /var/www/perl/test-mod_perl.cgi line 12.

Could you please provide more details about your environment? What are the versions of apache2 and perl that you have installed? Are you able to reproduce the issue using the reproducer you posted above?

Thanks.

Revision history for this message
Magnus Johansson (magnus-j) wrote :

Hi,

My apache and perl versions:
$ apache2 -v
Server version: Apache/2.4.58 (Ubuntu)
Server built: 2024-07-17T18:55:23

$ perl -v

This is perl 5, version 38, subversion 2 (v5.38.2) built for x86_64-linux-gnu-thread-multi
(with 44 registered patches, see perl -V for more detail)

Copyright 1987-2023, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at https://www.perl.org/, the Perl Home Page.

---

If running "curl http://localhost/perl/test-mod_perl.cgi" I get:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at
 webmaster@localhost to inform them of the time this error occurred,
 and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.4.58 (Ubuntu) Server at localhost Port 80</address>
</body></html>

As I mentioned, this machine is updated from Ubuntu 23.10 to 24.04 using "do-release-upgrade" if that might cause any problems...

/Magnus

Revision history for this message
Paride Legovini (paride) wrote :

I also tried to reproduce the issue, along the lines of what Sergio did, but I was not able to.

I believe that what we need here is a more complete reproducer, that is a set of steps that from a clean Ubuntu system lead to the problem (this is what Mitchell meant with "quick reproducer"). As an example, see Sergio's comment. You can use LXD to quickly get an Ubuntu system to experiment with (lxc launch ubuntu:noble repro-container ; lxc exec repro-container bash ; ...).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.