Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smarty's New Code Not Compatible with Something #1990

Closed
bhsmither opened this issue Apr 30, 2018 · 9 comments
Closed

Smarty's New Code Not Compatible with Something #1990

bhsmither opened this issue Apr 30, 2018 · 9 comments

Comments

@bhsmither
Copy link
Contributor

FYI:
CC620:
See: https://forums.cubecart.com/topic/53926-cc620-crashes-php/

I replaced the Smarty folder and the Foundation skin folder (and commented relevant lines in the controller) with CC6115 versions and the problem did not manifest.

@abrookbanks
Copy link
Member

abrookbanks commented Apr 30, 2018

I'm not a windows man at all. Is there a way to debug 'Unhandled Win32 Exception'?

Please remember that strictly speaking Windows is not a supported platform. Can you install a different version of PHP? Just because MS Server 2003 doesn't support PHP 5.5 and above can't you configure it manually?

https://windows.php.net/download#php-7.2

... as I said I have almost zero PHP, IIS, Windows experience.

@bhsmither
Copy link
Contributor Author

I have eliminated the HTMLMinify filter as the cause of the problem.

That leaves the new {combine} function.

@abrookbanks
Copy link
Member

I wonder if there is a specific function in it that the server doesn't like. For example Solaris will not work with a glob brace flag. I expect the sever is taking exception to something in that file.

@abrookbanks
Copy link
Member

I have a feeling in my bones it's this.

http://php.net/manual/en/function.flock.php

@bhsmither
Copy link
Contributor Author

I have narrowed the problem to be triggered by sending a large file through CSSmin.php.
skins/foundation/css/normalize.css passes
skins/foundation/css/foundation.css crashes

See:
http://john.cuppi.net/phps-pcre-backtrack_limit-and-recursion_limit/
https://bugs.php.net/bug.php?id=62876
https://bugs.php.net/bug.php?id=63829 (mentions a solution)

PCRE limitations being set too high, allowing for an Apache stack overflow and absolutely no errors logged.

@bhsmither
Copy link
Contributor Author

Made the change to give Apache 8MB stack size (default for Windows 1MB, Linux 8MB).

The combined CSS file created successfully.

I think JSmin would not have been a problem, as I do not find any sort of PCRE functions being used there.

@abrookbanks
Copy link
Member

abrookbanks commented May 3, 2018

OK so it sounds like we can close this one and keep it in mind for Windows users. PHP 5.4 is past its end of life now anyway so its seems silly to adapt CubeCart around this.

@bhsmither
Copy link
Contributor Author

bhsmither commented May 3, 2018

Technically, the problem was not with PHP. The specific environment of Apache 2.2 (maybe any version of Apache) on a 32-bit Windows (maybe any bitsize) box using a specific function (apparently with known limitations) on a sufficiently large file.

Overflowing the stack.

Which means, with a sufficiently large file, this will occur on any kit.

@bhsmither
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants