php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73873 PHP run-away queries falsely report as memory exhausted
Submitted: 2017-01-05 15:28 UTC Modified: 2017-01-06 17:27 UTC
From: f00dl3a at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: Performance problem
PHP Version: 7.0.14 OS: Ubuntu 16.10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
9 + 17 = ?
Subscribe to this entry?

 
 [2017-01-05 15:28 UTC] f00dl3a at gmail dot com
Description:
------------
When you write a run-away or infinite loop in a MySQL PDO query, it falsely reports as a memory exhausted situation. Even when the memory attempted to be allocated is well, well under the allowed memory size.

Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)

Expected result:
----------------
It should say infinite loop in SQL query or something more indicative of the actual problem, not allowed memory size exhausted when the memory attempted to allocate is not even 5% of the allowed size!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-06 17:27 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2017-01-06 17:27 UTC] cmb@php.net
> Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)

That means that already more than 134217728-20480 bytes have
been allocated, so further allocation of 20480 bytes would exceed
the memory limit.

> It should say infinite loop in SQL query or something more
> indicative of the actual problem, […]

No, because infinite loops are considered to be userland bugs in
PHP (for performance reasons), see
<http://php.net/manual/en/functions.user-defined.php>.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 22:01:28 2024 UTC