https://bz.apache.org/bugzilla/show_bug.cgi?id=63649

            Bug ID: 63649
           Summary: Graceful reload causes incorrect evaluation of
                    IfDefine blocks
           Product: Apache httpd-2
           Version: 2.4.38
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Hello,

we are encountering a strange error on some of our LAMP servers. After some
number of graceful (SIGUSR1) reloads the server stops processing PHP code and
complains about ExecCGI not being enabled:

[mpm_worker:notice] [pid 2717:tid 140275019682944] AH00297: SIGUSR1 received. 
Doing graceful restart
[fcgid:error] [pid 18065:tid 140274823059200] [client ip] [server.name]
mod_fcgid: location of script /path/file.php does not have ExecCGI enabled

Shortened configuration is as follows:

<IfModule mod_fcgid.c>
  <FilesMatch \.php$>
    SetHandler fcgid-script
  </FilesMatch>
</IfModule>

# Crash-me debugging block
<IfDefine FPM_VAR>
  Intentional config error this should not be set
</IfDefine>

<VirtualHost ip>
  ServerName server.name
  <IfDefine !FPM_VAR>
    SuexecUserGroup user group
  </IfDefine>
  DocumentRoot /path
  <Directory "/path">
    <IfDefine !FPM_VAR>
      FCGIWrapper /wrapper .php
      Options +ExecCGI
    </IfDefine>
  </Directory>
</VirtualHost>

The FPM_VAR variable's purpose is to allow seamless transition to FPM via
mod_proxy_fcgi - we don't have that in production use yet anywhere though, so I
was able to add the "crash-me" configuration for debugging purposes. This
configuration (without the crash-me part) works without issues on servers based
od Debian Stretch which ships Apache 2.4.25. The problem only occurs on servers
based on Debian Buster (Apache 2.4.38). At the moment we have hundreds of
2.4.25 servers and below twenty of 2.4.38 servers so I guess the bug was
introduced somewhere in between of those two.

Considering the configuration above it seems to me that the value (or
evaluation) of FPM_VAR changes in the middle of config reload - it is evaluated
as not defined when processing the crash-me block, so the webserver does not
crash, but it is evaluated as defined in virtualhosts, so PHP stops working.
The change seems permanent though - this happens on next SIGUSR1 reload:

[mpm_worker:notice] [pid 2717:tid 140275019682944] AH00297: SIGUSR1 received. 
Doing graceful restart
AH00526: Syntax error on line 11 of /etc/apache2/conf.d/debug.conf:
Invalid command 'Intentional', perhaps misspelled or defined by a module not
included in the server configuration

After that the server crashes, is restarted by supervisor and works correctly
for some time.

I found similar issue here -
https://bz.apache.org/bugzilla/show_bug.cgi?id=56008 , which is marked as
duplicate of https://bz.apache.org/bugzilla/show_bug.cgi?id=57328 . Attached
one-line patch to server/core.c is applied to Debian source though.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to