Page MenuHomePhabricator

rsvg large stderr cause a PHP memory exhaustion
Closed, ResolvedPublic


I have spotted on the Wikimedia cluster a SVG image that cause RSVG to generate roughly 125MB of stderr output.

In includes/media/SVG.php we log that error using something like:

wfDebugLog( 'thumbnails', trim($stderr) );

trim() thus returns a copy of $stderr (aka roughly 125MB) which can't be allocated by PHP under its max memory constraint. That result in a fatal error and no log at all.

Which should probably substr() the $stderr before handling it. No point in logging the full error IMHO.

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:17 AM
bzimport set Reference to bz57985.
bzimport added a subscriber: Unknown Object (MLST).
hashar created this task.Dec 4 2013, 4:25 PM

Change 99142 had a related patch set uploaded by Hashar:
generalize BitmapHandler::logErrorForExternalProcess

Change 99157 had a related patch set uploaded by Hashar:
media: limit size of stderr being logged

Change 99142 merged by Brian Wolff:
generalize BitmapHandler::logErrorForExternalProcess

Change 99157 merged by jenkins-bot:
media: limit size of stderr being logged

successfully merged

Gilles moved this task from Untriaged to Done on the Multimedia board.Dec 4 2014, 9:33 AM