Not sure what's going on here but as soon as I enable CSS compression using YUI the site stops responding and debugging points the finger at the minifier.

I realize that we're just passing it a bunch of params and it's technically not an AdvAgg error but this is my dev box and I have ridiculous settings like memory_limit 256M and max_execution_time 90 and still no cigar... I can only imagine this will be the same but worse for standard production boxes... any documentation and/or help getting this working please?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Best option would be to test each css file, see which one is causing an issue. Then try to find the section on rules in that file that causes it to fail and submit a bug report to https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port

On the AdvAgg side I could try testing file like I currently do for jsmin; and then do no minification of the CSS for that file if the test fails.

alexweber’s picture

@mikeytown2, thanks man, that seems like a good place to start!

mikeytown2’s picture

If you know what aggregate is taking forever to generate you can lookup what files are inside of it by going to admin/config/development/performance/advagg/info and under "Get detailed info about an aggregate file" Filename: enter something like "css__kXv96AEp_3ZeP6NXQffTTv3N3WpdxMffK0HbAhTBPPY__35s3aaSqQQ7mTwCZyUntfdJ2TpiN8ZFv_ODmGeZygg0__csvKqUfiNXlKVJNsy8AmAM2a38M1Vj14GLfPSRPyi-o.css"

alexweber’s picture

Thanks Mike, that's helpful! I'm gonna investigate this further and I'll post back if I find anything interesting/useful.

mikeytown2’s picture

Any news on this?

alexweber’s picture

I tracked down the culprit file and here's the detailed info about it: http://pastebin.com/42fq1eGr

It doesn't really say much to me...

That said, AdvAgg does manage to create the aggregated file: http://pastebin.com/csFQ72yn

I ran it through CSS Lint and it's actually ok apart from a bunch of warnings, seems like the fail is on YUI's side for sure.

alexweber’s picture

So I actually tracked this down to: https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port/issues/4

That issue got a fix committed specifically for Windows:

// Line 290, CSSMin.inc
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {  ... }

PHP_OS returns "Darwin" for whatever reason on OSX so changing that line to:

$php_os = strtoupper(substr(PHP_OS, 0, 3));
if ($php_os !== 'WIN' && $php_os !== 'DAR') { ... }

Fixes the error and I get a nice compressed file...

I'm going to follow up on GitHub ... thanks for the help!

mikeytown2’s picture

That check never got committed upstream. So tubalmartin would need to checkin the WIN and DAR check. I'll commit the new code in a little bit

mikeytown2’s picture

Status: Active » Fixed
FileSize
787 bytes

Following patch has been committed. Thanks for tracking this down :)

mikeytown2’s picture

Interesting article on how to find & ID issues like this in the future
http://www.metaltoad.com/blog/fix-drupal-segmentation-fault

alexweber’s picture

@mike awesome, thanks for committing it!

ps - i saw that article on planet last week and used it to help out :)

mikeytown2’s picture

Title: YUI Minifier times out and fails » YUI Minifier times out and fails (OSX)

Status: Fixed » Closed (fixed)

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