Skip to content

sync #9

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 497 commits into from
Dec 17, 2020
Merged

sync #9

merged 497 commits into from
Dec 17, 2020

Conversation

chopins
Copy link
Owner

@chopins chopins commented Dec 17, 2020

No description provided.

Girgias and others added 30 commits November 30, 2020 14:08
…lid UIDs in PHP 8.0.0

Checking for a valid Unique ID (UID) cannot use the convenience macro as they might
be larger than the message number which has for maximum value the total number of
current messages available in the mailbox.
* PHP-8.0:
  Fix Bug #80438: imap_msgno() incorrectly warns and return false on valid UIDs in PHP 8.0.0
  Rename XmlParser to XMLParser for consistency with XMLWriter/XMLReader
Apparently treating LibreSSL as OpenSSL 1.1 is not just something
we did in our code, it's something that upstream LibreSSL claims,
despite not actually being compatible. Duh.

Check for EVP_CIPH_OCB_MODE instead, which should reliably
determine support...
* PHP-7.4:
  Next attempt to fix bug #80368
* PHP-8.0:
  Next attempt to fix bug #80368
phpdbg now disables JIT, so these cause XFAIL warnings.
* PHP-8.0:
  Drop all JIT related XFAILS from phpdbg test suite
* PHP-8.0:
  Fixed "may be used uninitialized" compilation warnings
* PHP-8.0:
  Preallocate stack space for JIT in execute_ex() to eliminate JIT prologue/epilogue.
As it is, `::seek(0)` sets the file pointer to the beginning of the
file, but `::seek($n)` where `$n > 0` sets the file pointer to the
beginning of the following line, having line `$n` already read into the
line buffer.  This is pretty inconsistent; we fix it by always seeking
to the beginning of the line.

We also add a test case for the duplicate bug #46569.

Closes GH-6434.
* PHP-8.0:
  Fix #62004: SplFileObject: fgets after seek returns wrong line
Signed-off-by: Anatol Belski <ab@php.net>
* PHP-8.0:
  Skip test if JIT is not available
* PHP-8.0:
  Fixed incorrect "skipif.inc" include
The use of no-sanitize may result in an inlining failure, which
will be promoted into a compile error by always-inline. Use a
normal inlining hint without enforcing it.
* PHP-8.0:
  Don't mark cpu_supports functions as always inline
* PHP-8.0:
  Fix use after free with file cache and arena allocated strings
This is not safe to do at this point. Even if we made it safe,
we'd see inconsistencies due to a partially compiled class.

Fixes oss-fuzz #28129.
* PHP-8.0:
  Don't use scope when validating Attribute
* PHP-8.0:
  Disable stack reuse optimization for x86 PIC code. It may clobber local variable used for Global Offset Table.
cmb69 and others added 29 commits December 15, 2020 11:46
* PHP-7.4:
  Fix #77322: PharData::addEmptyDir('/') Possible integer overflow
* PHP-8.0:
  Fix #77322: PharData::addEmptyDir('/') Possible integer overflow
Something odd was being done here, with the row packet having a
flag for whether it should allocate the zval buffer, which would
then get moved into the result set.

Keep the management of this buffer purely at the result set level.
This also allows us to easily reuse the same buffer for all results,
rather than allocating a new one for each fetch.
* PHP-8.0:
  Optimize out result value of ASSIGN, ASSIGN_OP and INC/DEC opcodes, if possible.
Merge it into free_result. There is a large number of different
free_* functions for result sets, let's avoid having one more.
Only difference is that it does not increment stats, and that
seems like a bug as free_stmt_result is still freeing a result.
This was missing from f1f78ac.
PARAM_ZVAL with a STR result should be treated the same way as
PARAM_STR in this regard.
Don't truncate the file length to unsigned int...

I have no idea whether that fully fixes the problem because the
process gets OOM killed before finishing, but at least the
immediate parse error is gone now.
* PHP-7.4:
  Fix bug #80523
* PHP-8.0:
  Fix bug #80523
We need to check the BIT case first, otherwise it will get skipped
in INT_AND_FLOAT_NATIVE mode.
* PHP-7.4:
  Fixed bug #67983
* PHP-8.0:
  Fixed bug #67983
mysqlnd already creates interned zend_strings for us, so let's
make use of them.

This also required updating the PDO case changing code to work
with potentially shared strings. For the lowercasing, use the
optimized zend_string_tolower() implementation.
* PHP-8.0:
  PDO MySQL: Use mysqlnd column names
This was done for int and float ranges, but not char ranges.

Fixes oss-fuzz #28666.
* PHP-8.0:
  Detect overlarge step for character range()
We have to use the proper value for the bitmask.
* PHP-8.0:
  Fix #80521: Parameters with underscores no longer recognized
Fixes this error:
> Zend/zend_alloc.c:473:73: runtime error: left shift of 250 by 24 places cannot be represented in type 'int'
Retain the field, but always populate it with zero. This was
already the case for PS without length updating.

max_length has nothing lost in the field metadata -- it is a
property of the specific result set, and requires scanning the
whole result set to compute. PHP itself never uses max_length
with mysqlnd, it is only exposed in the raw mysqli API.

Keeping it for just that purpose is not worthwhile given the costs
involved. People who actually need this for some reason can easily
calculate it themselves, while making it obvious that the
calculation requires a full result set scan.
This is a larger overhaul of the mysqlnd result set infrastructure:

 * Drop support for two different types of buffered results sets
   ("c" and "zval"). Possibly these made sense at some earlier
   time, but now (with minor adjustments) one option is strictly
   worse than the other. Buffered result sets already buffer the
   full row packets, from which zvals can be decoded. The "zval"
   style additionally also buffered the decoded zvals. As result
   sets, even buffered ones, are generally only traversed once,
   this just ends up wasting memory. Now, a potentially useful
   variation here would be to buffer the decoded zvals instead of
   the row packets, but that's not what the code was doing.
 * To make it really strictly better, pre-allocate the zval row
   buffer and reuse it for all rows. Previously the "c" style always
   allocated a new buffer for each row.
 * The fetch_row API now provides a populated zval[]. The task of
   populating an array is deferred to fetch_row_into, which also
   avoids duplicating this code in multiple places. The fetch_row_c
   API is also implemented on top of fetch_row now, rather than
   duplicating large parts of the code.
 * The row fetching code for prepared statements and normal result
   sets has been mostly merged. These already used the same
   infrastructure, but prepared statements used separate row
   fetching functions that were nearly the same as the normal ones.
   This requires passing the stmt into the result set, rather than
   just a flag. The only part that remains separate is reading of
   unbuffered results in the presence of PS cursors.
@chopins chopins merged commit 725f0ef into chopins:master Dec 17, 2020
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.