thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James E. King, III (JIRA)" <>
Subject [jira] [Assigned] (THRIFT-3984) PHP7 extension causes segfault
Date Thu, 23 Feb 2017 16:45:45 GMT


James E. King, III reassigned THRIFT-3984:

    Assignee: James E. King, III

> PHP7 extension causes segfault
> ------------------------------
>                 Key: THRIFT-3984
>                 URL:
>             Project: Thrift
>          Issue Type: Bug
>          Components: PHP - Library
>    Affects Versions: 0.10.0
>            Reporter: Fei Dong
>            Assignee: James E. King, III
>            Priority: Critical
>             Fix For: 0.11.0
> I cant offer a script to reproduce segfault because it  not happens everytime. 
> PHP7 extension use ZVAL_STR to wrap zend_string to zval struct´╝îand later use zval_dtor
try to free it.
> The method_name parameter is pass from PHP script,  and zval_dtor decrement the gc reference
count, thus would free the zend_string object but it is still referenced in the script.
> I  changed  ZVAL_STR to ZVAL_STR_COPY, which will add reference count by 1 to the zend_string
object ,  apply this patch in our production environment and segfault never happen again
> Another place use ZVAL_STR is [here|].
Both this two place need to be fixed 

This message was sent by Atlassian JIRA

View raw message