colder / php-weakref

PECL extension that implements weak references and weak maps in PHP
http://pecl.php.net/weakref
Other
36 stars 13 forks source link

fix segfault in wr_store_tracked_object_dtor #22

Closed remicollet closed 8 years ago

remicollet commented 8 years ago

With this fix, build and test suite OK (except weakref_007.phpt which seems outdated, see 3rd commit)

I think it make sense, when no more track, to restore the old dtor (which was altered on first track), thus wr_store_tracked_object_dtor is no more called.

But perhaps I have not enough knowledge of this extension internals ;)

remicollet commented 8 years ago

In fact, another try,, without restoring the dtor.

remicollet commented 8 years ago

Tested on Fedora 20 to 23, RHEL 6 to 7, i386 and x86_64, NTS and ZTS. gcc 4.4.7, 4.8.5, 4.8.3, 4.9.2, 5.3.1

 =====================================================================
 PHP         : /opt/remi/php70/root/usr/bin/php 
 PHP_SAPI    : cli
 PHP_VERSION : 7.0.2
 ZEND_VERSION: 3.0.0
 PHP_OS      : Linux - Linux builder.remirepo.net 4.2.8-300.fc23.x86_64 #1 SMP Tue Dec 15 16:49:06 UTC 2015 x86_64
 INI actual  : /work/GIT/php-weakref/tmp-php.ini
 More .INIs  :   
 CWD         : /work/GIT/php-weakref
 Extra dirs  : 
 VALGRIND    : Not used
 =====================================================================
 TIME START 2016-01-13 08:07:31
 =====================================================================
 PASS WeakMap: usage [tests/weakmap_001.phpt] 
 PASS WeakMap: unsetting [tests/weakmap_002.phpt] 
 PASS WeakMap: test detach on unset [tests/weakmap_003.phpt] 
 PASS WeakMap: test detach on unset [tests/weakmap_004.phpt] 
 PASS WeakMap: cloning [tests/weakmap_005.phpt] 
 PASS Weakref: usage [tests/weakref_001.phpt] 
 PASS Weakref: acquire/release usage [tests/weakref_002.phpt] 
 PASS Weakref: usage [tests/weakref_003.phpt] 
 PASS Weakref: cloning acquired weakref [tests/weakref_004.phpt] 
 PASS Weakref: cloning acquired weakref [tests/weakref_005.phpt] 
 PASS Weakref: Destroying the weakref within the std dtor of the object [tests/weakref_006.phpt] 
 PASS Weakref: Destroying the weakref and its object after a fatal error [tests/weakref_007.phpt] 
 PASS Weakref: zval splitting causes crash [tests/weakref_008.phpt] 
 PASS Weakref: zval splitting causes crash [tests/weakref_009.phpt] 
 PASS Weakref: Crash [tests/weakref_010.phpt] 
 PASS Weakref: cloning [tests/weakref_011.phpt] 
 PASS Weakref: cloning with acquire [tests/weakref_012.phpt] 
 PASS Weakref: usage [tests/weakref_013.phpt] 
 =====================================================================
 TIME END 2016-01-13 08:07:31

 =====================================================================
 TEST RESULT SUMMARY
 ---------------------------------------------------------------------
 Exts skipped    :    0
 Exts tested     :   15
 ---------------------------------------------------------------------

 Number of tests :   18                18
 Tests skipped   :    0 (  0.0%) --------
 Tests warned    :    0 (  0.0%) (  0.0%)
 Tests failed    :    0 (  0.0%) (  0.0%)
 Expected fail   :    0 (  0.0%) (  0.0%)
 Tests passed    :   18 (100.0%) (100.0%)
 ---------------------------------------------------------------------
 Time taken      :    0 seconds
 =====================================================================