php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61768 YAML: bug in memory usage: trying to allocate 1+GB
Submitted: 2012-04-18 20:05 UTC Modified: 2013-02-18 00:35 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:3 (75.0%)
From: apinstein at mac dot com Assigned:
Status: No Feedback Package: yaml (PECL)
PHP Version: Irrelevant OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: apinstein at mac dot com
New email:
PHP Version: OS:

 

 [2012-04-18 20:05 UTC] apinstein at mac dot com
Description:
------------
We just upgraded to 1.10.0 (by accident) on production.

We immediately started getting a ton of OOM's like so:


Exception: ErrorException
Error: E_ERROR: Allowed memory size of 33554432 bytes exhausted (tried to 
allocate 1812794404 bytes)

Yes, that's 1.8GB for a variety of small YAML files.

It's not repeatable; it doesn't always happen on the same YAML file it seems. I 
am not sure why I know that sounds weird.

Test script:
---------------
Don't have a repeatable test case.

Expected result:
----------------
Shouldn't request ungodly amounts of memory. 1.0.1 worked great.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-30 05:51 UTC] bd808@php.net
-Status: Open +Status: Feedback
 [2012-04-30 05:51 UTC] bd808@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2012-07-31 13:03 UTC] gregor at welters dot de
I have the same problem, althoug it crashes most of time in the same line, complaining to try to allocate several Gigabytes of memory where just 1 Byte is beeing inserted into a string. 
The problem occurs in a long running script which parses big xml-files (ca. 200-500 MB) after having processed 5-6 MB while the memory usage is about 2-3 MB (memory limit=256MB). Problem is not limited to cli.
 [2012-07-31 13:12 UTC] gregor at welters dot de
the script was working for about 8 years without any problems.

Problem occurs since I upgraded the server to php 5.3.3 (debian packet version 5.3.3-7+squeeze13), while this upgrade was from debian lenny to squeeze, so i can't say if its only related to this exact version.
 [2012-08-03 15:43 UTC] bd808@php.net
@gregor Just to clarify, you are experiencing an OOM error due to the yaml extension in a process that is processing XML files? And you have been using the yaml extension to do this for 8 years?
 [2012-08-03 15:43 UTC] bd808@php.net
-Summary: Bug in memory usage: trying to allocate 1+GB +Summary: YAML: bug in memory usage: trying to allocate 1+GB
 [2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC