Jump to content

CC620 Crashes PHP


bsmither
 Share

Recommended Posts

Manually updated a CC6114 existing installation:
Windows Server 2003 Dev Machine
Apache 2.2
PHP 5.4.44

Yes, I know its old, but hasn't been a problem - until now.

Specifically, the problem is related to the new function and filter added to Smarty. That function and filter minimizes the page's resource files, then combines them all into one large CSS file and one large javascript file. The CC620 Foundation skin makes use of this new Smarty code.

That crash manifests itself as an Unhandled Win32 Exception, and you may or may not be able to escape out of it via RDP. (A server restart was the way out for me.)

A second occurrence, I dismissed the JITDebugger at the console, but the Apache httpd kept re-throwing it. (PHP is an Apache CGI module.) I restarted the Apache service to get out of that one.

This will be interesting to suss out.

HOWEVER, a fresh install of CC620B1 on Windows Server 2008R2x64, PHP 7.1 worked flawlessly.

 

Link to comment
Share on other sites

"Is there a good reason you are having to use such old software?"

It's a 'reason', not a "good reason" -- the cost of acquiring Windows Server (both financial and psychological). PHP 5.4.44 is the last version to run on Server 2003 (although there are stories of someone successfully compiling PHP 5.6 to run on it).

Last year, I built a Linux Mint box. I chucked it in the closet after three weeks.

"until you can upgrade the environment"

I would rather re-work the CubeCart code to work with this environment.

Edited by bsmither
Link to comment
Share on other sites

The exact trigger is attempting to minify an overly large CSS file (foundation.css).
CubeCart6.2.0/includes/lib/smarty/plugins/minify/CSSmin.php

The problem is setup by PCRE Regex (preg_replace(), etc) processing this large file. The minifier sets, via ini_set(), a higher limit for pcre.recursion_limit (default 100,000) to 500,000.

The problem happens when this recursion limit allows for a stack overflow within Apache when running PHP as a CGI module.

Apache Windows has a default 1MB stack size, Linux has 8MB.

The solution is to configure Apache to run with an 8MB ThreadStackSize.

However, even this is a fail waiting to happen. The fault is triggered when working with a sufficiently large file size no matter the stack size, and the recursion_limit is set high enough.

The CSSmin module chunks the file into 25000 character parts. Perhaps having the module use smaller chunk sizes will avoid the stack overflows.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...