On 25/11/15 20:25, Ruslan Osmanov wrote:
I'll try to explain the problem.

I have a function(let's call it `execF`), which is passed to a
library(libeio) as a callback. This function is invoked afterwards by
the library in separate thread.

The function is calling Zend API, particularly ZVAL_STRINGL(). The
Zend API uses TSRMLS_CACHE internally. For instance, ZVAL_STRINGL()
allocates zend_string which implies using AG() macro. The AG() macro
relies on TSRMLS_CACHE.

Since TSRMLS_CACHE becomes invalid in new thread, the AG() macro (as
well as other macros relying on TSRMLS_CACHE) fails with segmentation
fault.
Why are you allocating a string? Are you expecting to later use it on the php request? What's the goal of your extension? I suspect you may have an earlier misstep.

Regards



--
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to