Skip to content

sync #20

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

Merged
merged 87 commits into from
Dec 14, 2022
Merged

sync #20

merged 87 commits into from
Dec 14, 2022

Conversation

chopins
Copy link
Owner

@chopins chopins commented Dec 14, 2022

No description provided.

derickr and others added 30 commits November 29, 2022 18:25
Dialect 1 databases store and transfer `NUMERIC(15,2)` values as
doubles, which we need to cater to in `firebird_stmt_get_col()` to
avoid `ZEND_ASSUME(0)` to ever be triggered, since that may result
in undefined behavior.

Since adding a regression test would require to create a dialect 1
database, we go without it.

Closes GH-10021.
* PHP-8.1:
  Fix GH-9971: Incorrect NUMERIC value returned from PDO_Firebird
* PHP-8.2:
  Fix GH-9971: Incorrect NUMERIC value returned from PDO_Firebird
Only arrays can be unpacked in constant expressions.

Closes GH-9776.
* PHP-8.1:
  Fix GH-9769: Misleading error message for unpacking of objects
* PHP-8.2:
  Fix GH-9769: Misleading error message for unpacking of objects
We cannot compare the function handler pointer directly for trampolines, as they may be reallocated
…be unregistered)

There are two issues to resolve:
 1. The FCC is not refetch when trying to unregister a trampoline
 2. Comparing the function pointer of trampolines is meaningless as they are reallocated, thus we need to compare the name of the function

Found while working on GH-8294

Closes GH-10033
* PHP-8.1:
  Fix GH-10011 (Trampoline autoloader will get reregistered and cannot be unregistered)
* PHP-8.2:
  Fix GH-10011 (Trampoline autoloader will get reregistered and cannot be unregistered)
ex->opline can be null due to missing SAVE_OPLINE() in the VM

Fixes GH-9933
* PHP-8.1:
  Fallback to first line of function when ex->opline is NULL (#10003)
devnexen and others added 29 commits December 10, 2022 14:13
- helpers only called on linux anyway.
- proper C calls prototypes.

Closes GH-10068.
* PHP-8.2:
  Fix compilation on RHEL 7 ppc64le (gcc 4.8)
…, etc

This boosts the performance of mb_strpos, mb_stripos, mb_strrpos,
mb_strripos, mb_strstr, mb_stristr, mb_strrchr, and mb_strrichr when
used on non-UTF-8 strings. mb_substr is also faster.

With UTF-8 input, there is no appreciable difference in performance for
mb_strpos, mb_stripos, mb_strrpos, etc. This is expected, since the only
real difference here (aside from shorter and simpler code) is that the
new text conversion code is used when converting non-UTF-8 input strings
to UTF-8. (This is done because internally, mb_strpos, etc. work only
on UTF-8 text.)

For ASCII, speed is boosted by 30-65%. For other legacy text encodings,
the degree of performance improvement will depend on how slow the
legacy conversion code was.

One other minor, but notable difference is that strings encoded using
UTF-8 variants from Japanese mobile vendors (SoftBank, KDDI, Docomo)
will not undergo encoding conversion but will be processed "as is". It
is expected that this will result in a large performance boost for
such input strings; but realistically, the number of users who work
with such strings is probably minute.

I was not originally planning to include mb_substr in this commit, but
fuzzing of the reimplemented mb_strstr revealed that mb_substr needed
to be reimplemented, too; using the old mbfl_substr, which was based
on the old text conversion filters, in combination with functions which
use the new text conversion filters caused bugs.

The performance boost for mb_substr varies from 10%-500%, depending
on the encoding and input string used.
While benchmarking the new implementation of mb_substr, I found it was
slower than the old one only when the selected encoding was SJIS.
Investigation showed that the new text conversion filter for SJIS
was a touch slower than the old one.

With this optimization, the new SJIS decoder is about 20% faster than
the old one.
On longer MacJapanese strings, conversion speed is boosted by 60-80%.
On medium-length strings, conversion speed is boosted around 20-30%.
For very short strings, there is no appreciable difference.
From my microbenchmarks, the new decoder makes encoding conversion
from SJIS-Mobile#DOCOMO about 15-20% faster.
From my microbenchmarks, the new decoder makes encoding conversion
from SJIS-Mobile#KDDI about 30-50% faster.
From my microbenchmarks, the new decoder makes encoding conversion
from SJIS-Mobile#SOFTBANK about 15-40% faster.
* Add CLEAN sections to file_(get|put)_contents() tests

* Add CLEAN sections to file() tests
It might not have a primary maintainer, but it is maintained.
The code checks if stack is a NULL pointer. Below that if the
stack->next pointer is updated unconditionally. Therefore a call with a
NULL pointer will crash, even though the if (stack) check seems to show
the intent that it is valid to call the function with NULL.
The function is not meant to be called with NULL, so just ZEND_ASSERT
instead.
`ap_get_brigade()` may fail for different reasons, and we must not
pretend that a partially read POST payload is fine; instead we report
a content length of zero what matches all other `read_post()` callbacks
of bundled SAPIs.

Closes GH-10059.
* PHP-8.1:
  Fix GH-9949: Partial content on incomplete POST request
* PHP-8.2:
  Fix GH-9949: Partial content on incomplete POST request
Fixes #9944

https://man7.org/linux/man-pages/man2/shmget.2.html notes

   The name choice IPC_PRIVATE was perhaps unfortunate, IPC_NEW
   would more clearly show its function.

Closes GH-9946.
* PHP-8.1:
  Fix Windows shmget() wrt. IPC_PRIVATE
* PHP-8.2:
  Fix Windows shmget() wrt. IPC_PRIVATE
The recently committed fix for GH-9944 did only indirectly cater to
that, namely because in this case `CreateFileMapping()` with a zero
size couldn't be created.  As of PHP 8.2.0, the mappings of the actual
SHM and the info segment have been merged, so creating a zero size SHM
would be possible unless we explicitly prohibit this.
* PHP-8.2:
  shmget() with IPC_CREAT must not create 0 size SHM
* PHP-8.2:
  Add a new imap_is_open() function to check that a connection object is still valid
* PHP-8.2:
  PHP-8.2 is now for PHP 8.2.2-dev
@chopins chopins merged commit 2c54b72 into chopins:master Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.