-
Notifications
You must be signed in to change notification settings - Fork 7.9k
There are no files selected for viewing
This file contains hidden or 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,37 @@ | ||
--TEST-- | ||
Bug GH-9735 001 (Fiber stack variables do not participate in cycle collector) | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public function __destruct() { | ||
echo __METHOD__, "\n"; | ||
} | ||
} | ||
|
||
$fiber = new Fiber(function () { | ||
$c = new C(); | ||
|
||
$fiber = Fiber::getCurrent(); | ||
|
||
Fiber::suspend(); | ||
}); | ||
|
||
print "1\n"; | ||
|
||
$fiber->start(); | ||
gc_collect_cycles(); | ||
|
||
print "2\n"; | ||
|
||
$fiber = null; | ||
gc_collect_cycles(); | ||
|
||
print "3\n"; | ||
|
||
?> | ||
--EXPECT-- | ||
1 | ||
2 | ||
C::__destruct | ||
3 |
This file contains hidden or 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,41 @@ | ||
--TEST-- | ||
Bug GH-9735 002 (Fiber stack variables do not participate in cycle collector) | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public function __destruct() { | ||
echo __METHOD__, "\n"; | ||
} | ||
} | ||
|
||
function f() { | ||
Fiber::suspend(); | ||
} | ||
|
||
$fiber = new Fiber(function () { | ||
$c = new C(); | ||
|
||
$fiber = Fiber::getCurrent(); | ||
|
||
f(); | ||
}); | ||
|
||
print "1\n"; | ||
|
||
$fiber->start(); | ||
gc_collect_cycles(); | ||
|
||
print "2\n"; | ||
|
||
$fiber = null; | ||
gc_collect_cycles(); | ||
|
||
print "3\n"; | ||
|
||
?> | ||
--EXPECT-- | ||
1 | ||
2 | ||
C::__destruct | ||
3 |
This file contains hidden or 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,40 @@ | ||
--TEST-- | ||
Bug GH-9735 003 (Fiber stack variables do not participate in cycle collector) | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public function __destruct() { | ||
echo __METHOD__, "\n"; | ||
} | ||
} | ||
|
||
function f() { | ||
$fiber = Fiber::getCurrent(); | ||
Fiber::suspend(); | ||
} | ||
|
||
$fiber = new Fiber(function () { | ||
$c = new C(); | ||
|
||
f(); | ||
}); | ||
|
||
print "1\n"; | ||
|
||
$fiber->start(); | ||
gc_collect_cycles(); | ||
|
||
print "2\n"; | ||
|
||
$fiber = null; | ||
gc_collect_cycles(); | ||
|
||
print "3\n"; | ||
|
||
?> | ||
--EXPECT-- | ||
1 | ||
2 | ||
C::__destruct | ||
3 |
This file contains hidden or 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,40 @@ | ||
--TEST-- | ||
Bug GH-9735 004 (Fiber stack variables do not participate in cycle collector) | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public function __destruct() { | ||
echo __METHOD__, "\n"; | ||
} | ||
} | ||
|
||
function f() { | ||
$fiber = Fiber::getCurrent(); | ||
Fiber::suspend(); | ||
} | ||
|
||
$fiber = new Fiber(function () { | ||
$c = new C(); | ||
|
||
preg_replace_callback('#.#', f(...), '.'); | ||
}); | ||
|
||
print "1\n"; | ||
|
||
$fiber->start(); | ||
gc_collect_cycles(); | ||
|
||
print "2\n"; | ||
|
||
$fiber = null; | ||
gc_collect_cycles(); | ||
|
||
print "3\n"; | ||
|
||
?> | ||
--EXPECT-- | ||
1 | ||
2 | ||
C::__destruct | ||
3 |
This file contains hidden or 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,44 @@ | ||
--TEST-- | ||
Bug GH-9735 005 (Fiber stack variables do not participate in cycle collector) | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public function __destruct() { | ||
echo __METHOD__, "\n"; | ||
} | ||
} | ||
|
||
function f() { | ||
Fiber::suspend(); | ||
} | ||
|
||
$fiber = new Fiber(function () { | ||
$c = new C(); | ||
|
||
$fiber = Fiber::getCurrent(); | ||
|
||
// Force symbol table | ||
get_defined_vars(); | ||
|
||
f(); | ||
}); | ||
|
||
print "1\n"; | ||
|
||
$fiber->start(); | ||
gc_collect_cycles(); | ||
|
||
print "2\n"; | ||
|
||
$fiber = null; | ||
gc_collect_cycles(); | ||
|
||
print "3\n"; | ||
|
||
?> | ||
--EXPECTF-- | ||
1 | ||
2 | ||
C::__destruct | ||
3 |
This file contains hidden or 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,47 @@ | ||
--TEST-- | ||
Bug GH-9735 006 (Fiber stack variables do not participate in cycle collector) | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public function __destruct() { | ||
echo __METHOD__, "\n"; | ||
} | ||
} | ||
|
||
function f() { | ||
// Force symbol table | ||
get_defined_vars(); | ||
|
||
Fiber::suspend(); | ||
} | ||
|
||
$fiber = new Fiber(function () { | ||
$c = new C(); | ||
|
||
$fiber = Fiber::getCurrent(); | ||
|
||
// Force symbol table | ||
get_defined_vars(); | ||
|
||
f(); | ||
}); | ||
|
||
print "1\n"; | ||
|
||
$fiber->start(); | ||
gc_collect_cycles(); | ||
|
||
print "2\n"; | ||
|
||
$fiber = null; | ||
gc_collect_cycles(); | ||
|
||
print "3\n"; | ||
|
||
?> | ||
--EXPECTF-- | ||
1 | ||
2 | ||
C::__destruct | ||
3 |
This file contains hidden or 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,47 @@ | ||
--TEST-- | ||
Bug GH-9735 007 (Fiber stack variables do not participate in cycle collector) | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public function __destruct() { | ||
echo __METHOD__, "\n"; | ||
} | ||
} | ||
|
||
function f() { | ||
$fiber = Fiber::getCurrent(); | ||
|
||
// Force symbol table | ||
get_defined_vars(); | ||
|
||
Fiber::suspend(); | ||
} | ||
|
||
$fiber = new Fiber(function () { | ||
$c = new C(); | ||
|
||
// Force symbol table | ||
get_defined_vars(); | ||
|
||
f(); | ||
}); | ||
|
||
print "1\n"; | ||
|
||
$fiber->start(); | ||
gc_collect_cycles(); | ||
|
||
print "2\n"; | ||
|
||
$fiber = null; | ||
gc_collect_cycles(); | ||
|
||
print "3\n"; | ||
|
||
?> | ||
--EXPECTF-- | ||
1 | ||
2 | ||
C::__destruct | ||
3 |
This file contains hidden or 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,42 @@ | ||
--TEST-- | ||
Bug GH-9735 008 (Fiber stack variables do not participate in cycle collector) | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public function __destruct() { | ||
echo __METHOD__, "\n"; | ||
} | ||
} | ||
|
||
function f($a, $b) { | ||
} | ||
|
||
function g() { | ||
Fiber::suspend(); | ||
} | ||
|
||
$fiber = new Fiber(function () { | ||
$c = new C(); | ||
|
||
f(Fiber::getCurrent(), g()); | ||
}); | ||
|
||
print "1\n"; | ||
|
||
$fiber->start(); | ||
gc_collect_cycles(); | ||
|
||
print "2\n"; | ||
|
||
$fiber = null; | ||
gc_collect_cycles(); | ||
|
||
print "3\n"; | ||
|
||
?> | ||
--EXPECTF-- | ||
1 | ||
2 | ||
C::__destruct | ||
3 |
This file contains hidden or 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,42 @@ | ||
--TEST-- | ||
Bug GH-9735 009 (Fiber stack variables do not participate in cycle collector) | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public function __destruct() { | ||
echo __METHOD__, "\n"; | ||
} | ||
} | ||
|
||
function f($a, $b) { | ||
} | ||
|
||
function g() { | ||
g(Fiber::suspend()); | ||
} | ||
|
||
$fiber = new Fiber(function () { | ||
$c = new C(); | ||
|
||
f(Fiber::getCurrent(), g()); | ||
}); | ||
|
||
print "1\n"; | ||
|
||
$fiber->start(); | ||
gc_collect_cycles(); | ||
|
||
print "2\n"; | ||
|
||
$fiber = null; | ||
gc_collect_cycles(); | ||
|
||
print "3\n"; | ||
|
||
?> | ||
--EXPECTF-- | ||
1 | ||
2 | ||
C::__destruct | ||
3 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GC fiber unfinished executions #9810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
GC fiber unfinished executions #9810
Changes from all commits
2854418
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.