Commit Graph

2085 Commits

Author SHA1 Message Date
Peter Kokot
6c1c66befe Remove HAVE_LIMITS_H check
The limits.h header is part of the C89 and is today available
everywhere. There is no need to check for presence of this header
anymore.

The timelib has already been patched upstream via
aae5907cb7

PHP extensions out there shouldn't rely on symbols defined during the
build anyway and neither they do on this particular symbol anymore.
2019-06-30 23:44:45 +02:00
Peter Kokot
638c21765c Remove HAVE_STRCOLL check
The strcoll function is defined in the C89 standard and should be
on today's systems always available via the <string.h> header.

https://port70.net/~nsz/c/c89/c89-draft.html#4.11.4.3

- Remove also SKIPIF strcoll check in test
2019-06-28 00:05:55 +02:00
Anatol Belski
5a83bfb37d Set correct default version 2019-06-15 17:39:13 +02:00
Christoph M. Becker
f5b44c7e8a Fix bug #78094: File Search Problem Excessive Time
Instead of checking GetBinaryType() for each file, we do a much cheaper
pre-check whether the filename extension matches .exe or .com, and call
GetBinaryType() only in this case.  For BC we also report .bat and .cmd
files as executables again.

The patch has been provided by @weltling.
2019-06-06 15:55:46 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Christoph M. Becker
637d8677b3 Fix ZTS issue regarding new Windows CTRL handling API
php_win32_signal_system_ctrl_handler() is called from a kernel thread,
so the former initialization of `vm_interrupt_flag` has no effect,
since it is defined as thread-local.  This is, however, not necessary,
since the CTRL signal handling is supposed to work only for the main
thread anyway.  We therefore change `vm_interrupt_flag` and the related
variables to true globals.

This also allows us to unmark the respective test case as XFAIL.

Furthermore, `vm_interrupt_flag` is declared as `zend_bool *`, so we
better treat it such.
2019-06-01 09:35:47 +02:00
Joe Watkins
e11233dc49
Revert "Rename *.l files to *.re"
This reverts commit 969047749d.
2019-05-20 06:06:38 +02:00
Peter Kokot
969047749d Rename *.l files to *.re
This syncs PHP lexer files to all use *.re extension. The *.re files are
processed with the RE2C tool.
2019-05-17 23:53:03 +02:00
Peter Kokot
9219e56063 Remove redundant memory.h file
The memory.h file is part of the pre-C89 era and is on today's systems
only a simple wrapper for including the final string.h header file.
2019-05-11 19:47:54 +02:00
Christoph M. Becker
d0d290d4aa Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix erroneous assertions
2019-05-09 16:56:57 +02:00
Christoph M. Becker
fd1ffa4692 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix erroneous assertions
2019-05-09 16:55:35 +02:00
Christoph M. Becker
27f168cf63 Fix erroneous assertions
Since PHP strings are binary safe (i.e. they may contain NUL bytes), we
must not assume that strlen()/wcslen() actually return the length of
the string.  Only if the given in_len is zero, it is safe to assert
this.
2019-05-09 16:54:11 +02:00
Stanislav Malyshev
f7d59844e1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77821: Potential heap corruption in TSendMail()
2019-04-29 22:09:15 -07:00
Stanislav Malyshev
506a764089 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77821: Potential heap corruption in TSendMail()
2019-04-29 22:09:10 -07:00
Stanislav Malyshev
2c3933821f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #77821: Potential heap corruption in TSendMail()
2019-04-29 22:09:04 -07:00
Christoph M. Becker
6c631ccfef Fix #77821: Potential heap corruption in TSendMail()
`zend_string_tolower()` returns a copy (not a duplicate) of the given
string, if it is already in lower case.  In this case we must not not
`zend_string_free()` both strings.  The cleanest solution is to call
` zend_string_release()` on both strings, which properly handles the
refcount.
2019-04-29 22:08:19 -07:00
Peter Kokot
24cd183fdf Merge branch 'pull-request/4046' into PHP-7.4
* pull-request/4046:
  Remove php.gif from the project root directory
2019-04-23 08:59:44 +02:00
Christoph M. Becker
6710929c04 Fix parameter order
The parameter order of `php_sys_link()` should be identical on Windows
and POSIX, bug commit c9861bd[1] got that wrong.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=c9861bd7a974ef1555395b879c1035a0bbc12ef1>
2019-04-22 12:38:24 +02:00
Peter Kokot
aff1a927d9 Remove php.gif from the project root directory
The PHP logo is also displayed in the main README.md file using a shiny
SVG format so there is no need to use GIF format.
2019-04-21 03:20:47 +02:00
Peter Kokot
769db42341 Remove PHP_READDIR_R_TYPE
The PHP_READDIR_R_TYPE m4 macro has been removed via
2b28f71891.

HAVE_POSIX_READDIR_R in windows header file is also not needed anymore.
2019-04-13 04:50:05 +02:00
Anatol Belski
5477d68300 Fix potential OPcache file cache related issues
To solve issues detected during testing, we backport the following
commits to PHP 7.2:

129c5c1181
9ac133a0b3
ce72bc6b65
2019-04-11 18:28:49 +02:00
Nikita Popov
2b28f71891 Use readdir() instead of readdir_r()
readdir_r() is deprecated in modern glibc versions. readdir() is
thread safe in practice, as long as there are no concurrent accesses
on the *same* directory stream.
2019-04-11 16:52:36 +02:00
Anatol Belski
d207c9a78a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Ensure double slashes are replaced by the path normalization
2019-04-10 15:47:36 +02:00
Anatol Belski
ce72bc6b65 Ensure double slashes are replaced by the path normalization 2019-04-10 15:20:36 +02:00
Peter Kokot
e06836a1a3 Remove checks for locale.h, setlocale, localeconv
The `<loccale.h>` header file, setlocale, and localeconv are part of the
standard C89 [1] and on current systems can be used unconditionally.

Since PHP 7.4 requires at least C89 or greater, the `HAVE_LOCALE_H`,
`HAVE_SETLOCALE`, and `HAVE_LOCALECONV` symbols defined by Autoconf in
configure.ac [2] can be ommitted and simplifed.

The bundled libmagic (file) has also been patched already in version
5.35 and up in upstream location so when it will be patched also in
php-src the check for locale.h header is still left in the configure.ac
and in windows headers definition file.

[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.4
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4

Omit the bundled libmagic files
2019-04-07 18:32:54 +02:00
Peter Kokot
afd52f9d99 Refactor AC_INIT in configure.ac and PHP versions
Since Autoconf 2.53 the AC_INIT call with only a single argument has
been made obsolete and now includes several other optional arguments to
make installation experience a bit better by providing program version
and links to the project in the `./configure -h` output. This patch also
updates win build version. The phpize.m4 AC_INIT has been updated with
the call without arguments.
2019-04-07 05:52:14 +02:00
Christoph M. Becker
3393ae6e77 Fix ASAN configuration
Commit 6a624c1[1] mostly replaced `COMPILER_NAME` with
`COMPILER_NAME_LONG` and `COMPILER_NAME_SHORT`, but not all
occurrences, what broke the Clang ASAN configuration.  We fix this by
getting rid of `COMPILER_NAME` altogether.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=6a624c1dfda0dbfaaff3e453e6cb58de12748fb3>
2019-04-06 17:38:18 +02:00
Anatol Belski
1686c3fa47 Improve ascii check 2019-04-01 02:16:52 +02:00
Anatol Belski
f7b053f5da Rework conditions and make them more future proof 2019-03-31 22:10:56 +02:00
Anatol Belski
dd0aca0c11 Implement stricter CRT check
This aligns with the recommendations about VS2015, VS2017 and VS2019
compatibility.

More info below
https://devblogs.microsoft.com/cppblog/cpp-binary-compatibility-and-pain-free-upgrades-to-visual-studio-2019/
2019-03-31 17:33:36 +02:00
Anatol Belski
6a624c1dfd Rework the VS version evaluation
For the latest versions, refer also to the Visual Studio version, not to
the exact toolset version. The latest Visual Studio versions are moving
fast and the method existed previously is not sutable to keep up
anymore. Instead of refering to the exact toolset, it refers to the
Visual Studio version and implies the latest toolset available there.
That is still not ideal, another situation can arise where VS version is
not changed, but the toolset version is. It might be better to refer to
it a generic way in the future or even omit at all, and improve the
internal compatibility checks instead.
2019-03-31 14:26:00 +02:00
Anatol Belski
ddce7ada4c Implement stricter extension compatibility check
This hardens the dynamic module loading by checking the linker compatibility
between the core and the dynamic module. This likely should be extended
for the CRT as well, as 2015, 2017 and 2019 versions of Visual Studio
all have same DLL name for the CRT.
2019-03-31 14:26:00 +02:00
Anatol Belski
4d028a9ee9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix memory leak
2019-03-30 21:30:48 +01:00
Anatol Belski
a2c87c7f29 Fix memory leak 2019-03-30 21:28:51 +01:00
Anatol Belski
22091084fa Use wchar_t as native type in C 2019-03-30 21:08:03 +01:00
Peter Kokot
a8e879c53f Join README.GIT-RULES and CONTRIBUTING.md
This patch joins two very much related pieces of docs together in a
single file dedicated to all sorts of contributing info.

Some more changes:
- Branches info copied from the current master branch
- LXR and bonsai info removed
- Duplicated info reduced a bit
- Security branch updated to 7.1
- Refactor intro for Git commit rules
- Updated README.GIT-RULES file usage in win32/build/confutils.js
- Refactored configure.ac
2019-03-30 15:58:23 +01:00
Christoph M. Becker
8c9d8c3f66 Avoid unnecessary global variable 2019-03-18 15:57:27 +01:00
Christoph M. Becker
7cdb232e37 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add bison version check to configure
2019-03-18 15:05:19 +01:00
Christoph M. Becker
7ef2fa6d0d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add bison version check to configure
2019-03-18 15:04:09 +01:00
Christoph M. Becker
f21c054903 Add bison version check to configure
Since we're already checking for the minimum required re2c version,
also checking for the minimum required bison version is sensible.
2019-03-18 15:02:52 +01:00
Peter Kokot
ccc29473ec Sync AC_CHECK_SIZEOF m4 macro calls
- AC_CHECK_SIZEOF is now called mostly only in PHP_CHECK_STDINT_TYPES()
  macro except for some parts checking for the 32 or 64 bit architecture.
- SIZEOF_CHAR removed since it is always 1
- ZEND_BIN_ID is now of a more logical pattern `BIN_48888` on 64bit
  architectures and `BIN_44444` on 32bit instead of literal string
  `BIN_SIZEOF_CHAR48888` on 64bit and `BIN_SIZEOF_CHAR44444` on 32bit.
  The unneeded SIZEOF_CHAR part has been removed.
- XMLRPC_TYPE_CHECKS removed
- The `long long int` is the same as `long long` and redundant checks
  removed accordingly.
- Removed PHP_CHECK_64BIT macro. Checking if current platform is 64bit
  or not can be also done simply by using a check of the long type on
  place. This removes redundant m4 macro PHP_CHECK_64BIT.
2019-03-18 02:11:23 +01:00
Peter Kokot
97d25c87d2 Clean build system
Changes:
- AC_TYPE_SIZE_T called on only one place (configure.ac)
- AC_FUNC_ALLOCA called on only one place (configure.ac)
- AC_TYPE_UID_T called on only one place (configure.ac)
- HAVE_STRSTR removed since strstr is part of C89 standard [1]
- Remove checks for strtol and strpbrk
- Checking for the presence of perror function is not needed anymore
  since it is part of C89 standard and PHP calls it unconditionally.
- Checking for functions strdup, setenv, strerror, and memmove done only
  on one place (configure.ac)
- outdated check for snprintf removed

1: https://port70.net/~nsz/c/c89/c89-draft.html
2019-03-14 20:20:12 +01:00
Peter Kokot
3a857852a8 Remove HAVE_STRFTIME
Function strftime is part of the C89 standard [1] and current systems
don't need to check for its presence anymore.

Additionally, checks for strftime function in tests have been removed
since the PHP strftime function is now always available.

1: https://port70.net/~nsz/c/c89/c89-draft.html
2019-03-14 19:42:29 +01:00
Joe Watkins
6529d7acd9
zend_weakrefs 2019-03-12 00:35:35 +01:00
Anatol Belski
a526a6b4c1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Die hard if mc.exe or mt.exe not found
2019-03-11 20:59:51 +01:00
Anatol Belski
95c8f67a4c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Die hard if mc.exe or mt.exe not found
2019-03-11 20:59:23 +01:00
Anatol Belski
6814ba11bc Die hard if mc.exe or mt.exe not found
Even configure would pass, that producess quite subtle build errors
which are better to avoid at configure stage already.
2019-03-11 20:41:45 +01:00
c9s
9f6f6fe219 Remove function_table var from the caller
function_table var is not used in call_user_function macro anymore
hence replace the usage with NULL
2019-03-11 10:00:39 +01:00
johnstevenson
b37a6aafce Fix bc break in Windows readlink
GetFinalPathNameByHandleW is given a file handle to a symbolic link,
rather than one to the target, and therefore returns an incorrect path.

Fix symlink with relative path and add test
2019-03-10 15:48:31 +01:00
Anatol Belski
44b7126c6d Don't use Opcache with the master test process
Additionally, enable opcache.file_cache to mitigate possible reattach
failures in the tests.
2019-03-10 13:56:32 +01:00