[wp-trac] [WordPress Trac] #39338: class-wp-hook.php - apply_filters() infinite loop

WordPress Trac noreply at wordpress.org
Wed Dec 28 12:38:07 UTC 2016


#39338: class-wp-hook.php - apply_filters() infinite loop
-------------------------------------------+------------------------------
 Reporter:  frettled                       |       Owner:
     Type:  defect (bug)                   |      Status:  new
 Priority:  normal                         |   Milestone:  Awaiting Review
Component:  Plugins                        |     Version:  4.7
 Severity:  normal                         |  Resolution:
 Keywords:  reporter-feedback needs-patch  |     Focuses:
-------------------------------------------+------------------------------

Comment (by frettled):

 Replying to [comment:13 dd32]:
 > Honestly, because it doesn't actually fix the underlying problem.

 On the contrary, this '''is''' the underlying problem.

 > The change suggested simply papers over it, ignores that it ever
 happened. That value should never not be an array, if it is, something has
 broken somewhere, and we need to find it and fix it.

 I agree that this should be fixed, too, but that's a superficial problem.

 Superficial problems shouldn't result in infinite loops.

 > It could mean that filters are not being applied correctly, or in the
 correct order under certain circumstances. Right now we have no idea what
 the actual implications of this issue are - other than an infinite loop,
 so far experienced by only two known people.

 I've seen this dozens of times, for different WP installations. Please
 don't mistake the lack of reports for a lack of a problem.

 I apologize for not reporting this earlier, although please trust me when
 I say that I could have reported this a long time ago, and frequently, and
 kept nagging about it for months and years. :)

 >
 > Multiple people have looked at this and haven't been able to reproduce
 or otherwise determine how or why it's broken.

 But we know that it's broken. Shouldn't that be sufficient?

 > The code I posted in [comment:4 comment#4] duplicated the issues, but
 wasn't a realistic thing that '''any''' plugin would ever have done,
 either deliberately, or accidentally. It also would have never worked
 under 4.6, and more than likely caused WordPress to explode then, so  It's
 much more likely to be a bug in one of our loops in `WP_Hook` somewhere.

 The error message in [comment:7 comment#7] seems relevant: termination of
 a too-long-running execution by PHP itself.

 My guess is that this is reproducible to a much greater extent if you set
 max_execution_time to e.g. 1 second, and run the test code in a VM that
 has an execution cap of say 10% or something like that.

 And this would probably reveal all sorts of interesting problems.

 However, none of this seem to be valid reasons for avoiding an infinite
 loop when possible.

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


More information about the wp-trac mailing list