Hi,

we're trying to set up a D6 site on FreeBSD 7.0, where the site is supposed to run in an production environement; the site, including theming, has been developed under Linux and Windows. As well under Debian GNU/Linux "Lenny" as under Windows XP/WAMP the site works well; under FreeBSD 7.0, we get an "500 - Internal Server Error" that seems to be quite hard to debug. The development environment on Debian runs under Lighty (lighttpd-1.4.19) with Fast-Cgi without problems; watchdog log is clean, also; the development environment in Windows utilized Apache 2, also without any problems.

On FreeBSD, we're using Lighttpd with Fast-Cgi, similar to the Debian setup. The php error log seems pretty clean; there are a few warnings (e.g. "Module 'mysqli' already loaded in Unknown on line 0"), but no obvious and major problems. Similar in Lighty's access and error logs, no real errors.

The system log reports a core dump of Php-Cgi:

> sudo cat /var/log/messages | grep core
Apr 23 17:24:12 mirror kernel: pid 49890 (php-cgi), uid 80: exited on signal 11 (core dumped)

A core dump is written into ./sites/all/themes/php-cgi.core. When analyzing this dump with gdb, the error appears to point to the PCRE engine; we had no luck debugging at such a low level. When switching from Fast-cgi to the normal Cgi, Lighty's error log reports a core dump, also:

> sudo tail /var/log/lighttpd.error.log
 
2009-04-23 17:55:07: (mod_cgi.c.1268) cleaning up CGI: process died with signal 11 
2009-04-23 17:55:08: (response.c.120) Response-Header: 
HTTP/1.1 200 OK
Content-Length: 0
Date: Thu, 23 Apr 2009 15:55:08 GMT
Server: lighttpd/1.4.22
2009-04-23 17:55:08: (mod_cgi.c.1268) cleaning up CGI: process died with signal 11

Switching back to Fast-cgi and switching from our Zen-based theme to core's Garland, the site shows up fine. Is it even remotely possible that a plain Phptemplate theme without any custom functions in template.php kill PHP?

Runnin with Garland, the watchdog log reports several errors, e.g.:

[...]
Invalid argument supplied for foreach() in /usr/local/www/.../includes/theme.inc in Zeile 1762.
array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in /usr/local/www/.../includes/theme.inc in Zeile 1762.
[...]

That line points to an unaltered core function:

  foreach (array_keys($regions) as $region) {
    // Prevent left and right regions from rendering blocks when 'show_blocks' == FALSE.
    if (!(!$variables['show_blocks'] && ($region == 'left' || $region == 'right'))) {
      $blocks = theme('blocks', $region);
    }
    else {
      $blocks = '';
    }
    // Assign region to a region variable.
    isset($variables[$region]) ? $variables[$region] .= $blocks : $variables[$region] = $blocks;
  }

Again: whatever might be going wrong in the theme, why is it working on Debian and Windows and coredumping PHP on FreeBSD?

Any ideas and suggestions are greatly appreciated!

Thanks & greetings, -asb

Comments

asb’s picture

One of our devs has started to dig deeper into this:

Issue for Drupal base system

(it's the same D6 site)