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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: f00dl3a at gmail dot com
New email:
PHP Version: OS:

 

 [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 26 23:01:29 2024 UTC