Commit graph

200 commits

Author SHA1 Message Date
Tyson Andre
500ba8b2b8 Handle reallocated root buffer during GC destroy phase (v2)
We no longer protect GC during the destroy phase, so we need to
deal with buffer reallocation.

Note that the implementation of spl_SplObjectStorage_free_storage
will call the destructor of SplObjectStorage, and free the instance properties,
which I think is what caused the root buffer to be reallocated.
(`current` is a pointer for an index within the root buffer?)

This fixes bug #78811 for me.

Closes GH-4935
2019-11-23 10:24:48 -05:00
Nikita Popov
9899fdc454 Merge branch 'PHP-7.4'
* PHP-7.4:
  Handle reallocated root buffer during GC destroy phase
  Zend Engine version is no longer in -dev
2019-11-15 15:54:46 +01:00
Nikita Popov
3f4a15113c Handle reallocated root buffer during GC destroy phase
We no longer protect GC during the destroy phase, so we need to
deal with buffer reallocation.

Possible fix for bug #78811.
2019-11-15 15:53:49 +01:00
Nikita Popov
3b52307c86 Merge branch 'PHP-7.4' 2019-09-24 12:19:14 +02:00
Nikita Popov
73115ef873 Fixed bug #78589
Don't protect GC while destroying zvals. We may need to add GC
roots during this phase.
2019-09-24 12:17:21 +02:00
Nikita Popov
38c2230d07 Merge branch 'PHP-7.4' 2019-08-26 17:54:00 +02:00
Nikita Popov
fa8565a0f1 Merge branch 'PHP-7.3' into PHP-7.4 2019-08-26 17:52:56 +02:00
Nikita Popov
461db52400 Merge branch 'PHP-7.2' into PHP-7.3 2019-08-26 17:52:37 +02:00
Nikita Popov
589542f50c Remove properties HT from nested GC data
The properties HT may be a GC root itself, so we need to remove it.
I'm not sure this issue actually applies to PHP 7.2, but committing
it there to be safe. As seen from the test case, the handling here
is rather buggy on 7.2.
2019-08-26 17:49:37 +02:00
Nikita Popov
ded28e2435 Merge branch 'PHP-7.4' 2019-08-14 17:53:38 +02:00
Nikita Popov
c238b5bbef Fix reference printing in GC tracing 2019-08-14 17:51:41 +02:00
Nikita Popov
8c927442b4 Merge branch 'PHP-7.4' 2019-08-13 14:54:57 +02:00
Nikita Popov
60a7e60b61 Fixed bug #72530
For objects with destructors, we will now only call the destructor
in the initial GC run, and remove any nested data. The object is
marked purple so it will be considered a root for the next GC run,
at which point it will be fully destroyed, if possible.

GC counts change on a number of tests, as the objects now get
destroyed later.
2019-08-13 14:53:53 +02:00
Nikita Popov
1ae0b68404 Merge branch 'PHP-7.4' 2019-08-13 12:17:47 +02:00
Nikita Popov
72b7d99d0d Remove removed nested data from GC count 2019-08-13 12:17:08 +02:00
Nikita Popov
f0f3fe0b6c Don't include non-refcounted structures in GC count 2019-08-13 12:08:59 +02:00
Nikita Popov
9af705e753 Merge branch 'PHP-7.4' 2019-08-13 11:45:16 +02:00
Nikita Popov
7bd2b9d2e6 Generalize delref assertion
The refcount should never become negative, not just during GC.
2019-08-13 11:44:54 +02:00
Dmitry Stogov
172c71980d Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed handling of references in nested data of objects with destructor
2019-08-09 17:47:50 +03:00
Dmitry Stogov
4ebf527136 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed handling of references in nested data of objects with destructor
2019-08-09 17:47:35 +03:00
Dmitry Stogov
722a44d515 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed handling of references in nested data of objects with destructor
2019-08-09 17:47:06 +03:00
Dmitry Stogov
9b43e29d9b Fixed handling of references in nested data of objects with destructor 2019-08-09 17:43:50 +03:00
Dmitry Stogov
a037a5bd33 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed second part of the bug #78379 (Cast to object confuses GC, causes crash)
2019-08-09 15:58:44 +03:00
Dmitry Stogov
1456467cfe Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed second part of the bug #78379 (Cast to object confuses GC, causes crash)
2019-08-09 15:58:33 +03:00
Dmitry Stogov
22d23e08c9 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed second part of the bug #78379 (Cast to object confuses GC, causes crash)
2019-08-09 15:58:16 +03:00
Dmitry Stogov
6b1cc1252e Fixed second part of the bug #78379 (Cast to object confuses GC, causes crash) 2019-08-09 15:42:39 +03:00
Dmitry Stogov
9b973550b9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Added asserts to catch GC errors when refcount goes below zero.
2019-08-09 13:40:56 +03:00
Dmitry Stogov
b2044cd93e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Added asserts to catch GC errors when refcount goes below zero.
2019-08-09 13:40:39 +03:00
Dmitry Stogov
21a0a28fd0 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Added asserts to catch GC errors when refcount goes below zero.
2019-08-09 13:39:59 +03:00
Dmitry Stogov
2e2cd65d73 Added asserts to catch GC errors when refcount goes below zero. 2019-08-09 13:37:23 +03:00
Nikita Popov
e22633c4a7 Merge branch 'PHP-7.4' 2019-08-08 10:55:07 +02:00
Nikita Popov
d9dc942011 Merge branch 'PHP-7.3' into PHP-7.4 2019-08-08 10:55:02 +02:00
Nikita Popov
38f10ff5cf Fix GC tracing
Due to the GC changes in 7.3 we stopped tracing most of the
interesting coloring changes...
2019-08-08 10:54:18 +02:00
Dmitry Stogov
4d9e5ddf7c Merge branch 'PHP-7.4'
* PHP-7.4:
  Don't set GC_HAS_DESTRUCTORS flag if destructors were already called
  Update NEWS for 7.4.0beta3
  Update NEWS for PHP 7.4.0beta2
2019-08-06 11:37:08 +03:00
Dmitry Stogov
170a3f871f Don't set GC_HAS_DESTRUCTORS flag if destructors were already called 2019-08-06 11:35:53 +03:00
Nikita Popov
25985fedcf Merge branch 'PHP-7.4' 2019-07-15 13:49:36 +02:00
Nikita Popov
d60d16bda6 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-15 13:49:29 +02:00
Nikita Popov
193f28c7d5 Fixed bug #78010
Prevent the gc_info from becoming all zero for a registered root
by setting the top bit to one for compressed root addresses.
2019-07-15 12:00:30 +02:00
Nikita Popov
3645292235 Merge branch 'PHP-7.4' 2019-06-19 15:09:39 +02:00
Nikita Popov
3d4298697b Fix shift UB in constants
We were shifting out the top bit of a signed integer.
2019-06-19 15:09:00 +02:00
Peter Kokot
90654aff31 Merge branch 'PHP-7.4'
* PHP-7.4:
  fix a spell mistake
2019-04-10 10:45:31 +02:00
ROVAST
231fecee27 fix a spell mistake
possbile => possible
2019-04-10 10:45:13 +02:00
Dmitry Stogov
2dd2dcaf9c Merge branch 'PHP-7.4'
* PHP-7.4:
  Implemented a faster way to access predefined TSRM resources - CG(), EG(), etc.
2019-03-14 03:02:10 +03:00
Dmitry Stogov
9499484ed2 Implemented a faster way to access predefined TSRM resources - CG(), EG(), etc. 2019-03-14 03:01:01 +03:00
Dmitry Stogov
4111daf2b4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Better data packing
2019-03-12 22:19:36 +03:00
Dmitry Stogov
824a933398 Better data packing 2019-03-12 22:19:11 +03:00
Dmitry Stogov
24378d1809 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #77345 (Stack Overflow caused by circular reference in garbage collection)
  Add support for MemorySanitizer
2019-03-07 13:58:42 +03:00
Dmitry Stogov
2f2d15791a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #77345 (Stack Overflow caused by circular reference in garbage collection)
2019-03-07 13:53:43 +03:00
Dmitry Stogov
5da591c529 Fixed bug #77345 (Stack Overflow caused by circular reference in garbage collection) 2019-03-07 13:33:19 +03:00
Peter Kokot
18295b396f Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix typos in code comments in Zend/ [skip ci]
2019-02-18 17:56:38 +01:00