| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
In case Apple changes the meaning of the macro in the future.
Closes GH-6687.
|
|
|
|
|
|
|
| |
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.
Of course, zend_bool is retained as an alias.
|
|
|
|
|
| |
Fixes this error:
> Zend/zend_alloc.c:473:73: runtime error: left shift of 250 by 24 places cannot be represented in type 'int'
|
|
|
|
|
|
|
|
|
| |
Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functions which return true/false (1/0)
Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics
Closes GH-6002
|
|
|
|
|
| |
We should only drop the information about the old allocation after
checking the memory limit. This makes the code a bit more awkward...
|
|
|
|
|
|
|
| |
A very basic limit (for single allocations) was already enforced.
This extends it to count the total memory allocations.
This is useful to avoid out of memory conditions while fuzzing.
|
|
|
|
|
|
|
|
|
|
|
| |
The standard says that "A pointer to void may be converted to or from a
pointer to any object type". So the casting is unneeded.
REF:
* c11: http://port70.net/~nsz/c/c11/n1570.html#6.3.2.3p1
* c99: http://port70.net/~nsz/c/c99/n1256.html
Closes GH-5916
|
|
|
|
|
|
|
| |
Check whether the requested allocation size exceeds limit (rather
than the cumulative size).
This is useful to prevent allocations triggering OOM during fuzzing.
|
|\
| |
| |
| |
| | |
* PHP-7.4:
Fixed incorrect behavior of internal memory debugger
|
| |\
| | |
| | |
| | |
| | | |
* PHP-7.3:
Fixed incorrect behavior of internal memory debugger
|
| | | |
|
| | | |
|
| | | |
|
|/ /
| |
| |
| | |
Closes GH-4863.
|
|\ \
| |/
| |
| |
| | |
* PHP-7.3:
Fix #78620: Out of memory error
|
| |\
| | |
| | |
| | |
| | | |
* PHP-7.2:
Fix #78620: Out of memory error
|
| | |
| | |
| | |
| | |
| | | |
The integer addition in `ZEND_MM_ALIGNED_SIZE_EX` can overflow, what we
have to catch early.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.3:
Revert "Fix #78620: Out of memory error"
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.2:
Revert "Fix #78620: Out of memory error"
|
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit 8ce04df7e0108a10f7b782a28204e9384ab1129c.
Cf. <https://github.com/php/php-src/pull/4766#discussion_r330658679>.
|
|\ \ \
| |/ /
| | |
| | |
| | | |
* PHP-7.3:
Fix #78620: Out of memory error
|
| |\ \
| | |/
| | |
| | |
| | | |
* PHP-7.2:
Fix #78620: Out of memory error
|
| | |
| | |
| | |
| | |
| | | |
If the integer addition in `ZEND_MM_ALIGNED_SIZE_EX` overflows, the
macro evaluates to `0`, what we should catch early.
|
| | | |
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Due to overflows in the memory limit checks, we were missing cases
where the allocation size was close to the address space size, and
caused an OOM condition rather than a memory limit error.
|
| | |
| | |
| | |
| | |
| | | |
This seems to be designed around the use-case where the custom
allocator is a wrapper around ZMM.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In this case we will use the system allocator, but still remember
all allocations and free them the same way that Zend MM does. This
allows us to accurately model leak behavior.
Enabled using USE_ZEND_ALLOC=0 USE_TRACKED_ALLOC=1.
|
| | |
| | |
| | |
| | | |
We were shifting out the top bit of a signed integer.
|
| | |
| | |
| | |
| | |
| | | |
The new symbols are shared and don't need to depend on the availability
of __builtin_constant_p.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- zend_mm_bitset_find_zero
- zend_mm_bitset_find_one
- zend_mm_bitset_find_zero_and_set
- zend_is_by_ref_func_arg_fetch
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The `<signal.h>` header file is part of the standard C89 headers [1] and
on current systems can be included unconditionally.
Since file requires at least C89 or greater, the `HAVE_SIGNAL_H` symbol
defined by Autoconf in Zend.m4 [2] can be ommitted and simplifed.
The bundled libmagic (file) also ommits the usage of HAVE_SIGNAL_H since
5.35 however current version in PHP is very modified 5.34 version and
will be refactored separately. Check for HAVE_SIGNAL_H is therefore
still done in the configure.ac.
Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The `<limits.h>` header file is part of the standard C89 headers [1]
and on current systems can be included unconditionally.
Since PHP requires at least C89 or greater, the `HAVE_LIMITS_H` symbol
defined by Autoconf in configure.ac [2] can be ommitted and simplifed
however due to bundled file library (libmagic) and timelib still using
it, the removal there was omitted and done only in Zend.m4 file.
Current bundled libraries libtime, oniguruma, and libmagic still include
partial `HAVE_LIMITS_H` usage and will be more refactored when this is
possible.
Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Signed shift of 31 for int and 63 for long is flagged as undefined
behavior by UBSan (-fsanitize=undefined) and seems to be indeed so
according to the standard.
The patch converts such cases to use unsigned.
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
There have been multiple reports of large slowdowns due to the
use of MADV_HUGEPAGE, so make it conditional on
USE_ZEND_ALLOC_HUGE_PAGES, just like MAP_HUGETLB already is.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
As suggested by https://twitter.com/grsecurity. This saves an
mmap+munmap cycle in case the mapping cannot be extended in-place.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.
A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.
This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.
With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.
Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files. All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
|
| | | |
|
| | | |
|