perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <>
Subject PATCH: Fix SIGSEGV after subprocess_env
Date Mon, 05 Mar 2001 09:01:52 GMT

here is a patch for a problem that has striked me for a long time. It occurs
only if a request has a path_info, an handler other than a content handler
is configured and you call subprocess_env. The subprocess_env call
ap_add_cgi_vars, which starts a subrequest when a path_info is present, to
translate the path_info to the PATH_TRANSLATED env var. If now also for
example an auth handler is configured, the auth handler set the gobal var
mp_request_rec to the request rec of this subrequest and it is never set
back. So any call to Apache -> request will return this subrequest, which
isn't valid anymore in the content handler, so Apache crashs...

The following patch (against the current cvs version) makes sure the
mp_request_rec is reseted correctly


Index: perl_util.c
RCS file: /home/cvs/modperl/src/modules/perl/perl_util.c,v
retrieving revision 1.45
diff -u -r1.45 perl_util.c
--- perl_util.c 2001/02/16 23:30:28 1.45
+++ perl_util.c 2001/03/05 08:52:50
@@ -610,6 +610,8 @@

+    /* resetup global request rec, because it may set to an (invalid)
subrequest by ap_add_cgi_vars */
+    perl_request_rec(r);

     if (!table_get(envtab, "TZ")) {
  if ((tz = getenv("TZ")) != NULL) {

Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:         Voice:    +49 6133 925131
WWW:      Fax:      +49 6133 925152

View raw message