[wp-trac] [WordPress Trac] #44532: Extreme memory leak related to wp_is_stream in wp-includes/functions.php in WordPress 4.9.7

WordPress Trac noreply at wordpress.org
Sat Jul 14 16:40:27 UTC 2018


#44532: Extreme memory leak related to wp_is_stream in wp-includes/functions.php in
WordPress 4.9.7
-----------------------------------------+---------------------
 Reporter:  timbowesohft                 |       Owner:  (none)
     Type:  defect (bug)                 |      Status:  new
 Priority:  high                         |   Milestone:  4.9.8
Component:  Media                        |     Version:  4.9.7
 Severity:  major                        |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:
-----------------------------------------+---------------------

Comment (by ddenev):

 Dear @pbiron

 thank you very much for the detailed explanation!

 Yes, I understand what the patch does and that the root of the problem
 lies in PHP rather than in WP. I also understand that this patch will
 significantly reduce the number of calls to the problematic PHP function.

 The only thing that I still do not understand (and that was actually my
 initial question but I guess I did not state it well enough) is the
 following (and that is based purely on curiosity as 99% is pretty good
 success rate :)

 Replying to [comment:37 pbiron]:
 > In the vast majority (99% ?) of cases, the `$path` passed to
 `wp_is_stream()` is a file system path and not a URL so there is no need
 to call PHP's `stream_get_wrappers()`, which returns an array of protocols
 or URL "schemes" that PHP supports, to test whether the URL is a stream
 that PHP can handle.
 >
 In what cases (the mentioned 1%) the `$path` variable will NOT be a file
 system path? Any potential scenarios and use cases?

 Thanks again for the help!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44532#comment:38>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list