1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 22:11:12 +02:00
Commit Graph

124520 Commits

Author SHA1 Message Date
Christopher Jones
c9cfef6abd Update NEWS for #77120 2021-06-10 10:18:57 +10:00
Sergei Morozov
e496123c36 [Bug #77120] Handle OCI_SUCCESS_WITH_INFO returned from OCIStmtExecute
1. Backup last_error before replacing it with the error code
2. Continue normal operations if last_error is OCI_SUCCESS_WITH_INFO
2021-06-09 15:45:46 -05:00
Sergei Morozov
ee51eac39f [Bug #77120] Handle OCI_SUCCESS_WITH_INFO returned from OCISessionBegin
1. Proceed with connection initialization if OCI_SUCCESS_WITH_INFO is returned
2. Do not throw an exception upon OCI_SUCCESS_WITH_INFO
2021-06-09 15:45:46 -05:00
Martin Schröder
fa3d19830c Unify control & data transfer between fibers (#7120)
Co-authored-by: Aaron Piotrowski <aaron@trowski.com>
2021-06-09 11:20:13 -05:00
Dmitry Stogov
539948924c Typo 2021-06-09 17:50:16 +03:00
Dmitry Stogov
cd90655ebc JIT/ARM64: Remove redundand x86 specific optimization for recursive calls
On ARM64 we always load "func" into REG0
2021-06-09 16:55:51 +03:00
Nikita Popov
cbe485db05 Make PRE_INC/PRE_DEC type inference more accurate
The return value can never be a reference, even if the variable
is a reference.

While here, also exclude the resource and array types which throw
a TypeError since PHP 8.0.
2021-06-09 15:15:23 +02:00
Nikita Popov
b58d74547f Rerun GC if destructors encountered
Since PHP 7.4 objects that have a destructor require two GC runs
to be collected. Currently the collection is delayed to the next
automatic GC run. However, in some cases this may result in a large
increase in memory usage, as in one of the cases of bug #79519.

See also bug #78933 and bug #81117 where the current behavior is
unexpected for users.

This patch will automatically rerun GC if destructors were encountered.
I think this should not have much cost, because it is very likely that
objects on which the destructor has been called really are garbage,
so the extra GC run should not be doing wasted work.

Closes GH-5581.
2021-06-09 14:53:14 +02:00
Dmitry Stogov
af319b072a JIT/ARM64: Improve JIT for MOD instruction.
Eliminate x86 specific register constrints (idiv imlicitly used
%eax and %rdx). On ARM64 we use reserved TMP registers.
2021-06-09 15:17:51 +03:00
Dmitry Stogov
62e0b83204 JIT/x86: Reuse code when MOD is going to be converted to AND. 2021-06-09 15:15:06 +03:00
Nikita Popov
0ce2359233 Remove dom_nnodemap dtor_obj handler
Don't see any obvious reason why this would have to happen in a
dtor_obj handler. If there is a reason, we're lacking test
coverage for it.
2021-06-09 12:31:34 +02:00
Nikita Popov
bc8aa7d0e0 Use free_obj in IMAP\Connection
Looks like this incorrect pattern was copied from the FTP
implementation.
2021-06-09 12:14:41 +02:00
Nikita Popov
d982f4eb28 Use free_obj handler in FTPConnection 2021-06-09 12:13:15 +02:00
Nikita Popov
050e13c55e Use free_obj handler in HashContext
Instead of dtor_obj.
2021-06-09 12:12:13 +02:00
Nikita Popov
4c37645acf Disable file_cache_only as well in optimizer pass test 2021-06-09 12:02:55 +02:00
Nikita Popov
e79a8c05ad Convert UConverter dtor_obj to free_obj
An unusal case where free_obj was not specified at all, and only
dtor_obj was used. Use the right handler.
2021-06-09 11:59:51 +02:00
Nikita Popov
cdbf3fdcdd Remove redundant dtor_obj handlers in intl
Both of these just forward to the default implementation, so
just use that directly. This is simpler and benefits from the
special-casing of the default implementation.
2021-06-09 11:47:37 +02:00
Nikita Popov
cde735e630 Remove SimpleXMLElement dtor_obj handler
I don't see any reason why this cleanup needs to happen inside
dtor_obj.

If there is a reason, it's lacking in test coverage...
2021-06-09 11:46:28 +02:00
Dmitry Stogov
3fa0c99a1b JIT/AArch64: Use only reserved TMP registers for EG(vm_interrupt) checks.
This removes limitation of REG0 usage for register-allocation.
2021-06-09 12:43:13 +03:00
Nikita Popov
9d2a466c4b Remove explicit assignments of zend_objects_destroy_object
This is the default handler, no need to set it explicitly. This
makes it easier to see which objects really have a custom dtor_obj.
2021-06-09 11:29:50 +02:00
Nikita Popov
9c18138a71 Support GC for RecursiveIteratorIterator
And move its dtor_obj handler into free_obj, so that cycle leaks
get automatically detected.
2021-06-09 11:25:50 +02:00
Nikita Popov
0643301c75 Don't perform recursive get_gc call
On further consideration, we should be making use of the fact
that zend_object_iterator is also a zend_object here, and let
GC handle the get_gc call on it. Calling get_gc recursively like
this is generally not safe, because there is only one gc_buffer.

This also happens to be much simpler...
2021-06-09 11:15:59 +02:00
Dmitry Stogov
029d06992e JIT/AArch64: Use only reserved TMP registers for EG(jit_trace_num) assignment.
This eliminates a need for checking CPU registers used at the entry to a
side trace.
2021-06-09 12:02:11 +03:00
Nikita Popov
67440dd695 Null out member after releasing
Missed this when changing from zval -> zend_string.
2021-06-09 10:52:27 +02:00
Nikita Popov
b2cf198733 Use zend_string* for RecursiveTreeIterator prefixes
We don't perform any append operations on these strings, they
are fixed. Use zend_string* rather than smart_str for them.
2021-06-09 10:49:59 +02:00
Nikita Popov
6b9ffaff56 Simplify string management in RecursiveTreeIterator
Make use of zend_string rather than zval to clean up the
implementation.
2021-06-09 10:38:58 +02:00
Hao Sun
ac80aeb3ac JIT/AArch64: Use 'tbnz/tbz' to check the signedness (#7123)
'tbnz/tbz' instruction can be used to check whether a given W or X
register value is negative or positive.

For example,
    ```
    tst x0, x0
    blt >1
    ```
can be optimized as `tbnz x0, #63, >1`

It's important to note that the jump range of 'tbnz/tbz' is limited, and
it's better NOT to use 'tbnz/tbz' if the target of 'b.cond' is a label
in section .cold_code or a global label, such as the instruction
sequence `tst RETVALw, RETVALw; blt ->trace_halt` at function
zend_jit_trace_exit_stub(), and the instruction sequence `tst REG0,
  REG0; blt >7` at function zend_jit_incdec_obj().

Minor updates:
Use macros BW_OP_32_WITH_CONST and GC_ADDREF at function
zend_jit_push_call_frame().

Change-Id: I1597609bdabf55ea2f9d24528e7a037bc3e5c3a1
2021-06-09 16:30:25 +08:00
Nikita Popov
ff2fbd0ecb Remove zend_make_printable_zval() use in debug code
This is an awkward API left from the PHP 5 times. Replacing it
with zval_get_string().
2021-06-09 10:19:42 +02:00
Nikita Popov
d7eea8e1be Store cached string as zend_string
This makes the code a bit simpler.
2021-06-09 10:15:36 +02:00
Nikita Popov
88c57df53d Remove dual_it dtor, add more GC roots
Move the dual_it_free call from the dtor_obj into the free_obj
handler, allowing us to drop the dtor_obj handler entirely. This
exposes another leak in bug65387.phpt, which is addressed by
adding more GC roots in the get_gc handler.
2021-06-09 10:04:43 +02:00
David CARLIER
7d5a9dd05d Litespeed sapi OpenBSD build fix (#3999)
attempt to core dump in the proper place.
implement sendfile
2021-06-09 09:11:54 +02:00
Hao Sun
c1bf4b3ed3 JIT/AArch64: Fix codestyle issues (#7125)
Fix codestyle issues, such as aligning comments, changing whitespace to
tab, adding necessary whitespace.

Change-Id: I0c6ae1e5d87a0f6832bc776294558d48a9b5d420
2021-06-09 14:57:09 +08:00
David Carlier
fc147ed8db sockets exposing TC_DEFER_ACCEPT to optimise tcp exchanges. 2021-06-09 06:54:02 +02:00
David CARLIER
e69729f2ba fdatasync disable warning on macOS. (#7122)
The symbol exists and picked up but nowhere to be found on the headers.
tested on gcc/clang from homebrew and clang/Xcode.
2021-06-09 03:51:10 +02:00
Patrick Allaert
87068aead9 Preparing for alpha2 2021-06-08 18:24:06 +02:00
Patrick Allaert
9859e35951 Adapted Travis CI urls 2021-06-08 18:15:49 +02:00
Nikita Popov
15fafcd664 Expose inner dual_it iterator to GC
Moving the zend_iterator_dtor from dual_it_dtor to dual_it_free_storage
exposed this GC leak in an existing test. Forward the result of the
iterator get_gc to the dual_it get_gc.
2021-06-08 16:55:22 +02:00
Christoph M. Becker
64865c6092 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81092: fflush before stream_filter_remove corrupts stream
2021-06-08 15:41:09 +02:00
Christoph M. Becker
902ec698eb Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81092: fflush before stream_filter_remove corrupts stream
2021-06-08 15:38:57 +02:00
Christoph M. Becker
a1738d8bd1 Fix #81092: fflush before stream_filter_remove corrupts stream
When doing a non finishing flush, BZ2_bzCompress() returns BZ_FLUSH_OK
(not BZ_FINISH_OK) what requires us to do further flushes right away.

We also refactor the while-loop as do-loop.

Closes GH-7113.
2021-06-08 15:36:37 +02:00
Aaron Piotrowski
2184422adc Merge fiber switching functions (#7106)
Co-authored-by: Martin Schröder <m.schroeder2007@gmail.com>
2021-06-08 08:23:56 -05:00
Nikita Popov
291d8db7c5 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #81104
2021-06-08 14:34:08 +02:00
Nikita Popov
d29f15ce5f Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #81104
2021-06-08 14:33:29 +02:00
Nikita Popov
d8165c2502 Fixed bug #81104
When the memory limit is restored during shutdown, we may still
be using a lot of memory. Ignore the failure at that point and
set it again after the MM is shut down, at which point memory
usage should be at its lowest point.
2021-06-08 14:31:55 +02:00
Nikita Popov
703fcf0f2f Disable file cache in optimizer_register_pass.phpt 2021-06-08 13:57:19 +02:00
Joe Watkins
27ce269c1b Revert "Fix bug #24214 implement access to skip_last in user API for backtrace"
This reverts commit a5cef84de8.
2021-06-08 11:30:37 +02:00
Nikita Popov
d4b843b2f0 Merge branch 'PHP-8.0'
* PHP-8.0:
  Avoid MSVC unused variable warning in FastZPP
2021-06-08 10:14:58 +02:00
Nikita Popov
3ee6a4b35f Avoid MSVC unused variable warning in FastZPP
MSVC doesn't support __attribute__((unused)), so this can cause
a lot of warnings for extensions. Use the (void) trick instead.
However, this requires us to initialize the variable as well,
to ensure that ubsan does not read a trap representation.
2021-06-08 10:12:21 +02:00
Martin Schröder
b76a9dbcf9 Add fiber type to better support custom fiber APIs (#7105) 2021-06-07 14:21:05 -05:00
Joe Watkins
c220c96c37 fix optimizer pass registration test 2021-06-07 17:58:33 +02:00