|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79735 OPcache causes "Call to undefined method" errors in exception_handler etc.
Submitted: 2020-06-25 13:15 UTC Modified: 2020-08-02 04:22 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ca at lsp dot net Assigned: cmb (profile)
Status: No Feedback Package: opcache
PHP Version: 7.3.19 OS: Windows 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 — but make sure to vote on the bug!
Your email address:
Solve the problem:
50 - 26 = ?
Subscribe to this entry?

 [2020-06-25 13:15 UTC] ca at lsp dot net
(I mentioned this issue in bug 79729.)

OPcache seems to cause "Call to undefined method" errors in the context of `set_exception_handler` and `header_register_callback` callbacks.

I first observed this issue in 7.3.19 on 2020-06-12, two days after enabling OPcache and one day after upgrading from 7.3.18 to 7.3.19.

It looks like this specific behaviour first appeared in 7.3.10.

In 7.3.9 and earlier, PHP exits with "zend_mm_heap corrupted" according to Apache's error log.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-06-25 13:29 UTC] ca at lsp dot net
In 7.3.9, PHP exits in that case with status 3221225477 right after an `opcache_reset()` call, and with status 1 if the cache is populated (according to the Apache 2.4.43 error log).

(In 7.3.10 and later, PHP doesn't exit, see above.)
 [2020-06-25 14:01 UTC] ca at lsp dot net
-PHP Version: 7.3.20RC1 +PHP Version: 7.3.19
 [2020-06-25 14:01 UTC] ca at lsp dot net
I'm able to reproduce the issue consistently with two (specific) concurrent Ajax requests (handled by PHP via Apache's mod_php):

* Those Ajax requests always happen in the same order.
* The error always occurs in the same (second) request.
* The error does not occur, if the first request is blocked via the Firefox DevTools.

Both Ajax requests call PHP Debug Bar's [1] `sendDataInHeaders()` method inside a `header_register_callback()`, but only the second Ajax request causes the error:

Error thrown with message "Call to undefined method DebugBar\DataCollector\TimeDataCollector::getDataFormatter()"

#7 Error in C:\***\vendor\maximebf\debugbar\src\DebugBar\DataCollector\TimeDataCollector.php:214
#6 DebugBar\DataCollector\TimeDataCollector:collect in C:\***\vendor\maximebf\debugbar\src\DebugBar\DebugBar.php:238
#5 DebugBar\DebugBar:collect in C:\***\vendor\maximebf\debugbar\src\DebugBar\DebugBar.php:265
#4 DebugBar\DebugBar:getData in C:\***\vendor\maximebf\debugbar\src\DebugBar\DebugBar.php:321
#3 DebugBar\DebugBar:sendDataInHeaders in C:\***\src\***\DebugBar.php:353
#2 ***\DebugBar:***\Bar\{closure} in C:\***\src\***\AjaxResponse.php:29
#1 ***\Ajax:sendResponse in C:\***\src\***\***.php:2958
#0 ***\***:*** in C:\***\***.php:20

(Disabling OPcache also fixes the issue, of course.)

[1] <>
 [2020-06-25 14:27 UTC] ca at lsp dot net
I'm unable to reproduce this issue with PHP 7.4.0 - 7.4.7.
 [2020-06-25 14:56 UTC] ca at lsp dot net
To give more context:

The failing method call happens in `TimeDataCollector::collect()`:

The called method is `DataCollector::getDataFormatter()`:

(Note that `TimeDataCollector extends DataCollector`.)
 [2020-07-20 13:30 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-07-20 13:30 UTC]
> Those Ajax requests always happen in the same order.

Can you please specify which Ajax requests exactly?
 [2020-08-02 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Sep 16 19:03:38 2021 UTC