Hi!

I've tried to fix <https://bugs.php.net/72793>, and it looks like
there's a general GC issue wrt. to resources referencing objects and
vice versa.  Aren't resource ZVALS put in the root buffer?

See <https://3v4l.org/JYIQs>, which demonstrates the issue better than
the test script in the bug report.  A steady increase of allocated
memory can be seen, even though gc_collect_cycles() is called.  When
uncommenting `unset($this->parser);`, everything is fine (the GC
wouldn't be involved at all in this case).

Wrt. to the PHP 5.6 behavior: this appears fine, but actually it's in
error, because of <https://github.com/php/php-src/commit/72ec2e8f>.  Not
increasing the refcount of `parser->object` might theoretically lead to
use-after-free scenarios.

-- 
Christoph M. Becker

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to