Commit Graph

111 Commits

Author SHA1 Message Date
Jim Zubov
1b1399c95d Added EG(flags) - executor global flags
EG_FLAGS_IN_SHUTDOWN - is set when PHP is in shutdown state
2017-02-09 12:40:33 -05:00
Jim Zubov
f9afc6aabc newly added zend_object_store.no_reuse is redefined as a global zend_object_store_no_reuse,
to avoid alignment issues
2017-02-07 21:13:39 -05:00
Jim Zubov
9a8a1c9da1 Bug Fix:
Corrupted class entries on shutdown when a destructor spawns another object
(C) 2017 CommerceByte Consulting

When zend_objects_store_call_destructors() is called from the shutdown sequence -
it's calling the dtor's for remaining objects one by one in sequence of object handles.
If the dtor spawns one or more objects, and the new objects happen to reuse the old handles -
their dtor's are not called in this cycle.
The dtor's are called later on, when zend_deactivete() kicks in, and the static property lists in the class entries are freed.
This causes "Undefined static property" errors, and/or SIGSEGV.

Solution:
zend_object_store.no_reuse field is added
Set to 0 on initialization, set to 1 on the shutdown sequence.
zend_objects_store_put(zend_object *) checks the no_reuse flag, and never reuses the old handle slots if set.
This way, the dtor's for newly spawned objects are guaranteed to be called in the zend_objects_store_call_destructors() loop.
2017-02-06 18:05:34 -05:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Dmitry Stogov
51f59739b6 Turn function into inline 2016-11-21 13:13:28 +03:00
Xinchen Hui
9564998e49 Fixed Bug #71859 (zend_objects_store_call_destructors operates on realloced memory, crashing) 2016-03-20 04:52:57 -07:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Dmitry Stogov
37f0c6b5cb Add myself into list of authors of the most refactored files. 2015-08-31 11:38:16 +03:00
Nikita Popov
866bd89b1d Always report object leaks
Previously cycles were excluded from leak reports, however the
situation here has improved a lot in the meantime and we can
report all leaks.
2015-07-03 19:33:34 +02:00
Dmitry Stogov
388c2cbdbc Micro optimizations 2015-04-28 19:11:45 +03:00
Nikita Popov
aef96d5169 Partially enable leak reports for objects
Cycle leaks are currently not reported, because this needs further
work.

The last GC run has been moved to run earlier (before the object
store free), so that array cycles that hold references to objects
don't show up as leaks. Fingers crossed that this doesn't adversely
affect anything else.
2015-04-18 17:31:11 +02:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Nikita Popov
116c5ecda1 Remove proxy object implementation 2014-10-09 14:01:08 +02:00
Anatol Belski
6f9f0bf205 master renames phase 2 2014-08-25 19:28:33 +02:00
Dmitry Stogov
2ed8a17045 Refactored run_time_cache usage in object handlers 2014-07-07 20:54:31 +04:00
Xinchen Hui
d85e39cf4a Fixed invalid read in ext/pdo/tests/pdo_025.phpt(pgsql) 2014-05-16 19:11:38 +08:00
Dmitry Stogov
5864ce8a44 Fixed compilation warnings 2014-04-22 17:46:34 +04:00
Dmitry Stogov
e96073b1e4 Moved zend_literal->cache_slot right into zval.
It should be accessed using Z_CACHE_SLOT() macro.
zend_literal structure is removed.
API functions that accepted pointer to zend_literal now accept pointer to zval or cache_slot directly.
Calls of such functiond that now accept cache_slot need to be changed to pass -1 instead of NULL.
2014-04-17 15:40:45 +04:00
Dmitry Stogov
050d7e38ad Cleanup (1-st round) 2014-04-15 15:40:40 +04:00
Dmitry Stogov
d8a0c6c6ab typo 2014-04-10 00:22:13 +04:00
Dmitry Stogov
7402af380b Fixed destruction of objects and iterators on unclean request shutdown and GC (few cases are still unfixed).
Now we destroy objects it two steps. At first - object properties of all objects and only then the objects their selves.
2014-04-09 01:50:15 +04:00
Dmitry Stogov
d8099d0468 Changed data layout to allow more efficient operations 2014-04-02 14:34:44 +04:00
Dmitry Stogov
ea85451b65 Refactored data structures to keep zend_object* instead of a whole zval in some places 2014-03-28 02:11:22 +04:00
Dmitry Stogov
5db78476e3 Mark objects that are going to be deleted 2014-03-19 23:50:50 +04:00
Dmitry Stogov
b7938ab1bd Refactored GC (incomplete) 2014-03-19 17:00:28 +04:00
Dmitry Stogov
1c3ba95bb5 Refactored read_property() and read_dimension() handlers 2014-02-27 15:40:13 +04:00
Dmitry Stogov
51d7c4828a Fixed tests/run-test/test009.phpt 2014-02-21 15:48:56 +04:00
Xinchen Hui
cc15eb500e Fixed segfault in Zend/tests/008.phpt 2014-02-20 16:21:41 +08:00
Xinchen Hui
b917458490 Fixed segfault (Zend/tests/026.phpt now pass) 2014-02-20 15:39:46 +08:00
Dmitry Stogov
110e01a21e Fixed object destruction 2014-02-18 22:35:54 +04:00
Dmitry Stogov
be82a07776 Use better data structures (incomplete) 2014-02-12 18:08:11 +04:00
Dmitry Stogov
f4cfaf36e2 Use better data structures (incomplete) 2014-02-10 10:04:30 +04:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Xinchen Hui
7da6498342 Fixed bug #60598 (cli/apache sapi segfault on objects manipulation) 2013-08-30 11:20:24 +08:00
Dmitry Stogov
f9e8678dd3 Fixed bug #63882 (zend_std_compare_objects crash on recursion) 2013-01-09 11:30:50 +04:00
Xinchen Hui
0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Dmitry Stogov
e8c87c6d21 - Fixed bug #52773 (Proxy objects have an inadequate destroy_object store callback)
- Fixed bug #52774 (Proxy object's store free callback calls zval_ptor_dtor on already freed data)
2010-10-04 07:15:30 +00:00
Dmitry Stogov
94dd83722b Changed the structure of op_array.opcodes. The constant values are moved from opcode operands into a separate literal table 2010-04-20 10:57:45 +00:00
Sebastian Bergmann
d2281d1dff sed -i "s#1998-2009#1998-2010#g" **/*.c **/*.h **/*.php 2010-01-05 20:46:53 +00:00
Antony Dovgal
4e2c0bc905 MFH: fix bug #47353 (crash when creating a lot of objects in object destructor) 2009-02-11 09:58:23 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Marcus Boerger
ce2f9bb0cf - MFH Fix issue with destruction of overloaded objects 2008-08-24 16:49:19 +00:00
Felipe Pena
cf7384aa40 - MFH: Constness (Added const qualifier to several function parameters) 2008-08-12 17:20:25 +00:00
Dmitry Stogov
caee59b856 everted (this part was committed by mistake) 2008-02-19 17:05:41 +00:00
Dmitry Stogov
a4b872a6d8 iFixed memory leak 2008-02-19 12:00:53 +00:00
Dmitry Stogov
71592cec06 Added garbage collector 2008-01-22 09:27:48 +00:00