gorazdr
gorazdr
Yes that is exactly what I want. Basicly a would like to rewrite php-amf3 (AMF serializator) extension so that it keeps proper stringReferences. I tried writing to strings inside modify...
This is original unmodified function PHP_FUNCTION(amf3_encode) { smart_str ss = { 0 }; zval *val; long opts = 0; HashTable sht, oht, tht; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &val, &opts) ==...
So change to: ZEND_BEGIN_ARG_INFO_EX(arginfo_amf3_encode, 0, 0, 1) ZEND_ARG_INFO(0, value) ZEND_ARG_INFO(1, sht) ZEND_ARG_INFO(1, oht) ZEND_ARG_INFO(1, tht) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() and PHP_FUNCTION(amf3_encode) { smart_str ss = { 0 }; zval *val, *sht,...
Changed ZEND_BEGIN_ARG_INFO_EX to 4 and it compiled without problems. When I test it I get in kern.log php5-fpm[6403]: segfault at 10 ip 00000000006db764 sp 00007fff75b5cd90 error 4 in php5-fpm[400000+7fd000] php...
if I comment out //encodeValue(&ss, val, opts, HASH_OF(sht), HASH_OF(oht), HASH_OF(tht) TSRMLS_CC); There is no segfault but of course it does nothing
Definition of encodeValue static void encodeValue(smart_str *ss, zval *val, int opts, HashTable *sht, HashTable *oht, HashTable *tht TSRMLS_DC) {
Full: static void encodeValue(smart_str _ss, zval *val, int opts, HashTable *sht, HashTable *oht, HashTable *tht TSRMLS_DC) { switch (Z_TYPE_P(val)) { default: smart_str_appendc(ss, AMF3_UNDEFINED); break; case IS_NULL: smart_str_appendc(ss, AMF3_NULL); break; case...
One function that changes sht value static void encodeStr(smart_str _ss, const char *str, int len, HashTable *ht TSRMLS_DC) { if (len > AMF3_MAX_INT) len = AMF3_MAX_INT; if (len) { /_...
GDB [New Thread 0x7ffff101e700 (LWP 11493)] [Thread 0x7ffff101e700 (LWP 11493) exited] string(12) " test" Program received signal SIGSEGV, Segmentation fault. _zval_ptr_dtor (zval_ptr=0x7ffff7fcc330) at /build/buildd/php5-5.5.3+dfsg/Zend/zend_execute_API.c:426 426 /build/buildd/php5-5.5.3+dfsg/Zend/zend_execute_API.c: No such...
now I get Program received signal SIGSEGV, Segmentation fault. _zval_ptr_dtor (zval_ptr=0x7ffff7fcfd00) at /home/gorazd/Prejemi/php-5.5.5/Zend/zend_execute_API.c:426 426 i_zval_ptr_dtor(*zval_ptr ZEND_FILE_LINE_RELAY_CC);