When I activate "Aggregate and compress CSS files" (admin/settings/performance) The result is a "blank screen"

In Apache log I have: "exit signal Illegal instruction (4)"
The problem occurs in the preg_replace that strip the comment in all CSS. In /includes/common.inc function drupal_build_css_cache. If the css contain a certain string (see below, this string is present in stsytem.css, cck date.css ...) I think this is perhaps related to my server config (Mac OS), and regex libray. I submitted the bug in php too:
http://bugs.php.net/bug.php?id=43185

My Config:
Mac OS Darwin Kernel Version 8.9.0
Apache/2.0.61 (same error with Apache 2.2)
PHP Version 5.2.4
phpinfo related to regex:
mbstring:
- Multibyte regex (oniguruma) version 4.4.4
- Multibyte regex (oniguruma) backtrack check On

The bug come from Drupal 5.2 /includes/common.inc function drupal_build_css_cache

Reproduce code to put in a php file
---------------

<?
$data=
"
/*
** Details: http://www.positioniseverything.net/easyclearing.html
*/
";
$data = preg_replace('<
   \s*([@{}:;,]|\)\s|\s\()\s* |
   /\*([^*\\\\]|\*(?!/))+\*/ |
   [\n\r]
   >x', '\1', $data);
echo $data;
?>

Regards,
PS: congratutaltion for your good work Drupal Folks ! I hope I could contribute in the near futur too, when my learning curve will be absorbe ;-)

Comments

hass’s picture

subscribe

millions’s picture

subscribe

nico059’s picture

This problem is not present in Drupal 6.4

The function drupal_build_css_cache as been reworked, and do not perform this kind of optimisation anymore
Regards!

hass’s picture

Category: bug » support
Status: Active » Fixed

Should be the server config, not the regex. I would expect the PHP memory limit...

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

millions’s picture

Version: 5.2 » 5.10
Status: Closed (fixed) » Active

It's great that this is fixed in 6.4, but the post was originally for 5.2, and still present in 5.10.

hass’s picture

I'm sure the "white screen of death" is a PHP memory issue... every time I have had such issues it was PHP memory limit or PHP timout. Please check your logs. The compression works well for me on many many sites in D5.

nico059’s picture

Thx hass for your response,

I have used the compression me too on D5 without problem on other plateform. This issue should be related to a config on this particular host (Mac OS X, apache, php ....) I don't know where exactly .... my host had recompile apache / php stuff perhaps something wrong in the build ... ?
I haven't this issue in D6.5, so I move to another challenge (perhaps learn more about YAML !)
My memory limit is 128 Mo.

Regards.

millions’s picture

my memory is set at 64, and it works fine in other browsers.

hass’s picture

Whatever the issue is - it's a server issue - not a browser issue.

nico059’s picture

Yes it's a server issue

in drupal 5, I know it's not the best way to do: patch the core, but I just remove in
includes/common.inc the infriging line:

// Perform some safe CSS optimizations.
$data = preg_replace('<
\s*([@{}:;,]|\)\s|\s\()\s* | # Remove whitespace around separators, but keep space around parentheses.
/\*([^*\\\\]|\*(?!/))+\*/ | # Remove comments that are not CSS hacks.
[\n\r] # Remove line breaks.
>x', '\1', $data);

ainigma32’s picture

Status: Active » Fixed

As this appears to be server issue and a workaround is given I'm setting this to fixed.

Feel free to reopen if you think that is wrong.

- Arie

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.