|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72760 Built-in server leaks tzcache
Submitted: 2016-08-05 09:55 UTC Modified: 2016-08-10 17:54 UTC
Avg. Score:2.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: Assigned:
Status: Open Package: Built-in web server
PHP Version: 7.1.0beta1 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-08-05 09:55 UTC]
Since the built-in server will leak the ext/date tzcache once per request.

Reason: The built-in server sends the response during output deactivate, which happens after deactivate modules. As ext/date releases the tzcache in RSHUTDOWN, this means that the tzcache is never released.

Possible resolution: Move tzcache destruction into post-deactivate. Or, if that is possible, make the emission of the Date header independent of ext/date.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-05 10:45 UTC]
What about creating the date string earlier during the request,
what would be permissible according to RFC 7231, section[1]:

| In practice, the date can be generated at any time during
| message origination.

[1] <>
 [2016-08-10 16:43 UTC]
I was debugging this through, but the behavior i see is different. When I request a simple phpinfo() script under "php -S -t.", php_output_end() and consequently append_essential_headers() runs before RSHUTDOWN. When a non existent script is requested, neither RINIT nor RSHUTDOWN is run, is this the case we're talking about? Same i see in CLI and Apache. 

A solution independent from ext/date is not that easy. Of course, it's possible to use the pure C runtime, but the timezone handling is still the point.

 [2016-08-10 17:54 UTC]
@ab: I'm seeing the leak if I run an "<?php\n" file (doing nothing). I just tried a phpinfo() and indeed, in that case it does not occur. So this might be an issue specific to the case where the script itself has no output.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 07:01:31 2024 UTC