perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Schöning <>
Subject Syntax errors in case of threaded MPM and lots of concurrent requests.
Date Wed, 31 Jul 2019 17:33:13 GMT
Hi all,

I'm struggling for 2+ years[1][2] with a problem using mod_perl on
Linux which I was finally able to reproduce on Windows as well. If the
problem occurs, mod_perl is unable to compile my app with all kinds of
weird syntax errors, most likely in the core-libs already. The
following is one example:

> [Mon Jun 05 06:25:23.818862 2017] [core:notice] [pid 21652:tid 139994496042880] AH00094:
Command line: '/usr/sbin/apache2'
> String found where operator expected at /usr/share/perl/5.22/Tie/ line 25, near
"croak "$pkg must define either a TIEHASH() or a new() method""
>   (Do you need to predeclare croak?)
> String found where operator expected at /usr/share/perl/5.22/Tie/ line 33, near
"croak "$pkg doesn't define a TIEHASH method""
>   (Do you need to predeclare croak?)
> String found where operator expected at /usr/share/perl/5.22/Tie/ line 39, near
"croak "$pkg doesn't define an EXISTS method""
>   (Do you need to predeclare croak?)
> [Mon Jun 05 16:14:21.233643 2017] [mpm_event:notice] [pid 21652:tid 139994496042880]
AH00491: caught SIGTERM, shutting down

Disabling mod_perl makes the problem go away, so syntax errors itself
are pretty unlikely anyway. Additionally even with enabled mod_perl
the error doesn't occur always, only pretty often, but if it occurs
once and some time later not anymore or the other way around it can't
be syntax errors as well from my understanding.

I was able to reproduce the problem on Linux and Windows simply by
using a command like the folllowing:

> ab -n 1000 -c 10 http://localhost/cgi-bin/mandkomm/referenz/

I have some authentication handler implemented only consisting of one
package in one file and the same problem happens to that as well.
Whenever too many concurrent requests arrive and a new Perl interpreter
needs to be spawned, things break most likely. If such an interpreter
is already available and reused or it's only one request to be
spawned, things seem to succeed mostly.

What fixes the problem entirely is using "PerlPostConfigRequire" to
load my app during server startup. This solves requesting the above
entry point as well as using my authentication handler.

This leads to the following questions:

1. Does that make sense to anyone at all? :-)
2. Is there some race condition within mod_perl or Perl? Looking at
   the code of mod_perl I saw handling with mutexes and stuff.
3. Any other idea what might cause this issue? My setup doesn't seem
   too unusal, Apache 2.4, threaded MPM, perl-script handler. If that
   wouldn't work I would expect many more problem reports.

Thanks for your time!


Mit freundlichen Grüßen,

Thorsten Schöning

Thorsten Schöning       E-Mail:
AM-SoFT IT-Systeme

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

View raw message