thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhaakhi <>
Subject [GitHub] thrift pull request #1152: THRIFT-3984 PHP7 extension causes segfault
Date Thu, 05 Jan 2017 14:20:24 GMT
GitHub user zhaakhi opened a pull request:

    THRIFT-3984 PHP7 extension causes segfault 

    Fix a double-free when serializing string map keys or the name of called methods, and
a memory leak when deserializing maps or sets.

You can merge this pull request into a Git repository by running:

    $ git pull THRIFT-3984

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1152
commit d956e2fc998ff4cee463b5ef39758b3cbe4d635e
Author: Håkon Hitland <>
Date:   2016-12-05T17:42:41Z

    THRIFT-3984 PHP7 extension causes segfault
    The PHP 7 extension can sometimes free strings it does not own,
    when serializing string map keys, or the name of called methods.
    The latter case was somewhat migitated since the double-free has no
    effect on interned strings.
    Using ZVAL_STR_COPY instead of ZVAL_STR will increment the reference
    count, making the following destructor call correct.

commit e4b6425086938ab42f7d097324dea9c2136dbcba
Author: Håkon Hitland <>
Date:   2016-12-05T20:08:19Z

    Fix memory leak in PHP 7
    Fix memory leak when deserializing maps or sets.
    zend_hash_update will add its own reference to the key, so we need to
    destruct the key zval to not leak.
    We don't need to destruct the value, the hash table will take ownership
    of it.


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message