diff --git a/.github/workflows/build-cross-platform.yml b/.github/workflows/build-cross-platform.yml index ce7efb6..374323e 100644 --- a/.github/workflows/build-cross-platform.yml +++ b/.github/workflows/build-cross-platform.yml @@ -135,6 +135,7 @@ jobs: --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ --with-pdo-firebird \ + --enable-address-sanitizer \ --enable-async - name: Build PHP @@ -165,7 +166,7 @@ jobs: --no-progress \ --offline \ --show-diff \ - --show-slow 2000 \ + --show-slow 4000 \ --set-timeout 120 \ --repeat 2 @@ -309,6 +310,7 @@ jobs: --enable-inifile \ --with-config-file-path=/usr/local/etc \ --with-config-file-scan-dir=/usr/local/etc/php.d \ + --enable-address-sanitizer \ --enable-async - name: Build PHP (macOS) @@ -342,7 +344,7 @@ jobs: --no-progress ^ --offline ^ --show-diff ^ - --show-slow 2000 ^ + --show-slow 4000 ^ --set-timeout 120 ^ --repeat 2 shell: cmd @@ -364,6 +366,6 @@ jobs: --no-progress \ --offline \ --show-diff \ - --show-slow 2000 \ + --show-slow 4000 \ --set-timeout 120 \ --repeat 2 \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c13dbf..ba5eac7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -134,6 +134,7 @@ jobs: --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ --with-pdo-firebird \ + --enable-address-sanitizer \ --enable-async - name: Build PHP @@ -164,6 +165,6 @@ jobs: --no-progress \ --offline \ --show-diff \ - --show-slow 2000 \ + --show-slow 4000 \ --set-timeout 120 \ --repeat 2 \ No newline at end of file diff --git a/tests/gc/013-gc-fiber-destructors.phpt b/tests/gc/013-gc-fiber-destructors.phpt new file mode 100644 index 0000000..e2c30ed --- /dev/null +++ b/tests/gc/013-gc-fiber-destructors.phpt @@ -0,0 +1,52 @@ +--TEST-- +Fibers in destructors 006: multiple GC runs +--FILE-- +self = $this; + } + public function __destruct() { + $id = self::$counter++; + printf("%d: Start destruct\n", $id); + if ($id === 0) { + global $f2; + $f2 = Fiber::getCurrent(); + Fiber::suspend(new stdClass); + } + printf("%d: End destruct\n", $id); + } +} + +$f = new Fiber(function () { + new Cycle(); + new Cycle(); + gc_collect_cycles(); +}); + +$f->start(); + +new Cycle(); +new Cycle(); +gc_collect_cycles(); + +$f2->resume(); + +?> +--EXPECT-- +0: Start destruct +1: Start destruct +1: End destruct +2: Start destruct +2: End destruct +3: Start destruct +3: End destruct +0: End destruct +Shutdown