-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #2030: Segmentation fault with autoloaders bailing out
We fix this issue by ensuring that the opline is always connected to its proper execute_data and popping newer entries if they aren't matching. Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
- Loading branch information
Showing
5 changed files
with
96 additions
and
13 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
tests/ext/sandbox-regression/class_resolver_bailout_hook.phpt
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,29 @@ | ||
--TEST-- | ||
Assert bailouts are gracefully handled within class autoloading | ||
--ENV-- | ||
DD_TRACE_DEBUG=1 | ||
--FILE-- | ||
<?php | ||
|
||
ddtrace\trace_function("x", function() { class C extends D {} print "Should not appear...\n"; }); | ||
|
||
function x() {} | ||
|
||
spl_autoload_register(function() use (&$s) { | ||
if ($s) { | ||
trigger_error("No D", E_USER_ERROR); | ||
} else { | ||
$s = true; | ||
x(); | ||
class B {} | ||
print "Leaving Autoloader\n"; | ||
} | ||
}); | ||
|
||
class A extends B {} | ||
|
||
?> | ||
--EXPECTF-- | ||
Error raised in ddtrace's closure defined at %s:%d for x(): No D in %s | ||
Leaving Autoloader | ||
Flushing trace of size 2 to send-queue for %s |
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
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