-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PHP-8.4: Fix GH-17246: GC during SCCP causes segfault
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
// Need to cause a trace exit, so extend non existent class | ||
class MyXSLTProcessor extends NonExistentClass { | ||
public function registerCycle() { | ||
[[$this]]; // Non trivial array | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--TEST-- | ||
GH-17246 (Nested shm protections cause segfault) | ||
--EXTENSIONS-- | ||
opcache | ||
--INI-- | ||
opcache.protect_memory=1 | ||
opcache.jit_buffer_size=32M | ||
opcache.jit=1254 | ||
--FILE-- | ||
<?php | ||
|
||
class Test | ||
{ | ||
private $field; | ||
|
||
public function __construct() | ||
{ | ||
$this->field = function() {}; | ||
} | ||
|
||
public function __destruct() | ||
{ | ||
// Necessary because we need to invoke tracing JIT during destruction | ||
} | ||
} | ||
|
||
for ($i = 0; $i < 10000; ++$i) { | ||
$obj = new Test(); | ||
} | ||
|
||
require __DIR__.'/gh17246.inc'; | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught Error: Class "NonExistentClass" not found in %s:%d | ||
Stack trace: | ||
#0 %s(%d): require() | ||
#1 {main} | ||
thrown in %s on line %d |