[PHP-BUG] Bug #71179 [NEW]: memory limit exhausted when running scss parser from richthegeek

[email protected] ("am05mhz at live dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
From:             am05mhz at live dot com
Operating system: windows
PHP version:      7.0.1
Package:          *General Issues
Bug Type:         Bug
Bug description:memory limit exhausted when running scss parser from richthegeek

Description:
------------
memory limit exhausted when using win 10 with PHP 7.0.1 VC14 x64 Thread
Safe (2015-Dec-17 00:17:17)

no matter how high I set my memory limit, it will get exhausted, and it
only happen when running the php scss parser from richthegeek, sample
code provided below.

memory limit I have tried: 128MB, 256MB, 512MB

this does not happen in PHP 5.6 VC11 x64 Thread Safe (2015-Nov-26
04:33:59)
with memory limit 128MB and other supported settings the same (obviously
excluding mysql extension)

changes to php.ini:
include_path = ".;S:\php\PEAR"
memory_limit = 512MB

Test script:
---------------
this error only happen when using scss parser from richthegeek
https://github.com/richthegeek/phpsass

require 'SassParser.php';

$options = array(
	'style' => 'nested',
	'cache' => false,
	'syntax' => 'scss',
	'debug' => false,
);

$parser = new SassParser($options);
$css = $parser->toCss($some_big_scss_file);
//note my scss file have around 1000 lines

Expected result:
----------------
scss code should be successfully parsed regardless if there is error in
the scss (as like the behavior in php 5.6)

Actual result:
--------------
php stopped the execution with memory limit exhausted

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to
allocate 134217736 bytes) in
some_path\libraries\script\SassScriptLexer.php on line 118
A PHP Error was encountered

Severity: Error

Message: Allowed memory size of 536870912 bytes exhausted (tried to
allocate 134217736 bytes)

Filename: script/SassScriptLexer.php

Line Number: 118

Backtrace:

-- 
Edit bug report at https://bugs.php.net/bug.php?id=71179&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=71179&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=71179&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=71179&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=71179&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=71179&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=71179&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=71179&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=71179&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=71179&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=71179&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=71179&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=71179&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=71179&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71179&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=71179&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=71179&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=71179&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71179&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=71179&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=71179&r=mysqlcfg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.