Bug #79735 [Opn]: OPcache causes "Call to undefined method" errors in exception_handler etc.

From: Date: Thu, 25 Jun 2020 14:01:01 +0000
Subject: Bug #79735 [Opn]: OPcache causes "Call to undefined method" errors in exception_handler etc.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227663@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79735&edit=1

 ID:                 79735
 User updated by:    ca at lsp dot net
 Reported by:        ca at lsp dot net
 Summary:            OPcache causes "Call to undefined method" errors in
                     exception_handler etc.
 Status:             Open
 Type:               Bug
 Package:            opcache
 Operating System:   Windows 10
-PHP Version:        7.3.20RC1
+PHP Version:        7.3.19
 Block user comment: N
 Private report:     N

 New Comment:

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()"

Stacktrace:
#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] <https://github.com/maximebf/php-debugbar>


Previous Comments:
------------------------------------------------------------------------
[2020-06-25 13:41:49] ca at lsp dot net

Related To: Bug #79729

------------------------------------------------------------------------
[2020-06-25 13:29:15] 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 13:15:43] ca at lsp dot net

Description:
------------
(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.



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=79735&edit=1


Thread (7 messages)

« previous php.bugs (#227663) next »