-
Notifications
You must be signed in to change notification settings - Fork 105
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
gc_possible_root: Assertion `(ref)->gc.u.v.type == 7 || (ref)->gc.u.v.type == 8' failed. #32
Comments
call |
Possibly so, I'll need to delve into this a bit more since the semantics between what gets de-allocated when destroying values and contexts are still unclear to me... The current implementation does a |
I have found a fix for this problem. It is in my branch: https://github.com/taowen/go-php/blob/memory-leak-fix/engine/value.go Problem 1, nested data structure memory leakArray/Map works like a container owning its element. So when add zval to it, and it can keep track of its lifetime. However object property assignment is a copy of value, so after assign it, we need to free the zval created before, https://github.com/taowen/go-php/blob/memory-leak-fix/engine/value.go#L139 Problem 2, context.bind cause gc errorWhen a zval is added to symbol table. We no longer need to call zval_dtor. The zend vm will tear down the symbol table properly after shutdown. So, we just skip the destroying the value. Think context.bind as passing the memory ownership. Problem 3, engine_value itself lifecycleBecause the engine_value itself is heap allocated. value_destroy will destroy the zval and engine_value wrapper heap memory. Sometime, we just want to destroy the wrapper, leaving the zval managed by the zend vm. It is too hard to keep track of two piece of memory (just like why zval instead zval* from php5 to php7). I just dropped the wrapper all together, using zval directly. Now, I think all memory problem goes away. I am heading to create a php7 only version of this. It is just too much work to support both php5 and php7. |
feature/metrickeys - Updating telegraf to send metrics to eventhubs Approved-by: Boran Car <boran.car@antstream.com>
when the values destroyed, then the context destroy will trigger gc_possible_root assertion error. Found in php-7.0.12
Complete error message
The text was updated successfully, but these errors were encountered: