Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test sanitizer #97

Open
wants to merge 1,313 commits into
base: master
Choose a base branch
from
Open

Test sanitizer #97

wants to merge 1,313 commits into from

Conversation

nielsdos
Copy link
Owner

No description provided.

petk and others added 30 commits February 22, 2024 15:48
The union semun is always defined in php-src code. Current systems
require user to define it manually as done in the ext/sysvsem/sysvsem.c.
The conditional checks for HAVE_SEMUN were unused. The PHP 3.0.12 AIX
bug bugs.php.net/2149 was fixed by the removal of __GNU_LIBRARY__ check,
so this now further simplifies the code. The Autoconf AC_CHECK_TYPES
checks if system by any chance has the union semun, and by default
defines the HAVE_UNION_SEMUN.
The sysconf can be assumed to be present on current systems, when
checking for the _SC_CLK_TCK symbol.
Method to quote strings in XPath, similar to PDO::quote() / mysqli::real_escape_string.

Sample usage: $xp->query("//span[contains(text()," . $xp->quote($string) . ")]")

The algorithm is derived from Robert Rossney's research into XPath quoting published at https://stackoverflow.com/a/1352556/1067003
But using an improved implementation I wrote myself, originally for chrome-php/chrome#575
In sapi/fpm the inet_ntop is used instead of the deprecated inet_addr
and the required library, if needed, is linked from the configure.ac.
This never resulted in a working XPath object anyway, as trying to query
or evaluate anything resulted in an "Invalid XPath context" error.
Supporting this is more trouble than it's worth, so just block the clone
operation.
AC_SEARCH_LIBS can be used to check for dlopen and if dl library needs
to be prepended to LIBS. The dlsym is available with the same scope as
dlopen (if dlopen is present, also dlsym is). The redundant HAVE_DLOPEN
and HAVE_DLSYM symbols have been removed.
On some systems (Haiku) the math library is part of the C library and it
doesn't need to be explicitly prepended to LIBS. The redundant HAVE_LIBM
symbol defined by the AC_CHECK_LIB has been removed.
This removes the deprecated inet_aton and its Windows implementation.
The inet_aton can be replaced with platform agnostic inet_pton.

Closes phpGH-13479
Now that ext/imap is unbundled, `libc-client-dev*` packages are no longer necessary.
This simplifies the check and defines the symbol with description.
When AC_DEFINE is called after some macro that has already defined the
symbol with description (help text), it can be called with two arguments
to make things easier.

[ci skip]
…streams_context

This was previously untested and the branch was not covered according to
codecov.
The value will always be overwritten.
The libtool --silent option for PHP build invocation is already set in
the configure.ac.
bwoebi and others added 27 commits March 18, 2024 20:26
)

- Declared compatibility expectations of stub files are now enforced by a ZEND_STATIC_ASSERT call at the top of arginfo files
- Property registration for PHP 7 is fixed: function zend_declare_property_ex() is used again instead of zend_declare_typed_property(). This has been a regression since I added support for exposing doc comments.
- As a defensive measure, deep cloning is performed before newer features (type declarations, attributes etc.) are discarded before generating legacy arginfo files. Until now, some of the objects were forgotten to be taken care of. These omissions may have resulted in some weird bugs in theory (but probably they didn't have much impact in practice).
- PHP version related conditions inside *non-legacy arginfo files* used to possibly check for the 70000 version iD until now if compatibility with PHP 7.0 was declared in a stub. This was not 100% correct, since non-legacy arginfo files are only for PHP 8.0+. Now, I made sure that at least PHP version ID 80000 is used in the preprocessor conditions. The solution was a bit tricky though...
pdo/php_pdo_int.h is not part of the PDO's headers to install.
Basically all constants are now declared via stubs. The rest of the constants are either deprecated (`SID` or `MHASH_*`) or out of interest (`__COMPILER_HALT_OFFSET__` and `PHP_CLI_PROCESS_TITLE`).
… buffer size (php#13676)

Compress interned string table offsets and increase maximum supported buffer size

The interned string buffer is organized as a header + a hash table + a
zend_string arena. Hash slots point to the arena, but are represented as 32bit
offsets from the buffer, which limits the maximum buffer size to about 4GiB.
However zend_strings are 8-byte aligned in the buffer, so we can compress the
3 lower bits. This allows to increase the maximum supported interned string
buffer size from 4095 MiB to 32767 MiB.
* PHP-8.3:
  Fix ASan build
Now that the CombinedLCG is no longer used within GENERATE_SEED(), we can
safely use the CSPRNG with a php_random_generate_fallback_seed() fallback to
seed the CombinedLCG.
13.2 is going to be EOL.

close phpGH-13622
php#13761)

As all the input bits and pieces are mixed with SHA-1, cross-architecture
compatibility is not required and we can just mix in whatever they may look
like in memory, instead of going through the `write_*()` helpers that were
created for a previous in-development version that first filled a buffer that
was then hashed (allowing for easy inspection of the input data, but making it
harder to safely add values without checking for buffer overflows all the
time).

This change should also fix a build error on macOS ZTS: The thread ID is an
opaque type and not guaranteed to be arithmetic as per IEEE Std 1003.1-2017.
And indeed macOS defines it as a pointer to a structure, failing due to the
implicit pointer to integer conversion.
* PHP-8.3:
  Restore error handler after running it
IR commit: 0e3608e3c945140d366134034ee8d86edbe6d050
IR commit: 7586ac611a32d8f4116721b1d96b855c1087eac9
The zend_shutdown_constants() usage was removed in
21698c1 (memory leak)
and in b80cb7b (unicode support).
* PHP-8.3:
  Fix phpdoc for DOMDocument load methods
Move some of the DOM APIs from the non-public php_dom.h header to the
public header xml_common.h.
This removes the unused and obsolete Zend/zend_istdiostream.h header and
symbols on Windows:
- HAVE_STDIOSTR_H
- HAVE_CLASS_ISTDIOSTREAM
- istdiostream
Shared objects of extensions during the *nix build are copied to the
`modules` directory. It is a practice established since the early days
of the PHP build system. Other build systems may have similar concept of
"library destination directory". On Windows, they are put into the root
build directory. Such directory simplifies collection of the shared
extensions during testing, or when running the cli executable at the end
of the build process.

This change ensures that the directory is consistently created in a
single location, for both the primary PHP build process and when
utilizing `phpize` within community extensions.

The AC_CONFIG_COMMANDS_PRE is executed at the end of the configuration
phase, before creating the config.status script, where also build
directories and global Makefile are created.

The pwd is executed using the recommended $(...) instead of the obsolete
backticks. Autoconf automatically locates the proper shell and
re-executes the configure script if such case is found that $(...) is
not supported (the initial /bin/sh on Solaris 10, for example).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.