Ilija Tovilo
42ede5597e
Fix persisting of inherited class constants
...
Class constants are inherited to user classes without cloning. Thus, internal
class constants should not be persisted at all. Simply keep pointing to the
internal class constant.
Fixes GH-14109
Closes GH-14114
2024-05-06 16:00:48 +02:00
Bob Weinand
ea927caffa
Fix exception IP in JIT ( #13929 )
2024-04-10 20:37:54 +02:00
Bob Weinand
e48a5c14b9
Add zend_test.observer.enabled=0 to opcache tests asserting specific TMP count
...
Necessary to succeed when tests are run with zend_test.observer.enabled=1.
2024-04-08 20:16:35 +02:00
Bob Weinand
af098acd6e
Always load EX(opline) into the current frame in JIT when observers are enabled
...
Fixes #13772 .
Closes #13776 .
2024-04-08 15:09:14 +02:00
Bob Weinand
e7462bff19
Run one testsuite with observers enabled in CI ( #13869 )
...
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2024-04-02 18:11:02 +02:00
Cristian Rodríguez
18d70db091
Fix gcc-14 Wcalloc-transposed-args warnings
...
gcc-14 and later warns of inverted arguments in calloc or
calloc-like __alloc_size__ annotated functions.
Closes GH-13818.
2024-04-01 20:34:14 +02:00
Bob Weinand
10d912d6e3
Fix GH-13712: Segmentation fault for enabled observers when calling trait method of internal trait when opcache is loaded ( #13735 )
...
Inherited methods regardless of source must share the original runtime cache. Traits were missed.
This adds ZEND_ACC_TRAIT_CLONE to internal functions as well to allow easy distinction of these.
2024-03-18 19:02:42 +01:00
Bob Weinand
6fb8b9d721
Fix possible segfault with 0x0 shared opcache base
...
Moving the minimum base of the shared opcache memory to the second huge page to avoid a possible 0x0 base, which may cause all sorts of segfaults.
This is not a problem on most systems which have a mmap_min_addr which is non-zero, but e.g. WSL1 doesn't have a minimum mapping address.
2024-03-18 17:18:33 +01:00
David Carlier
868257a3de
Fix GH-13727: macro generating invalid call test prototypes fixes.
...
autoconf/libtool generating code to test features missed `void` for
C calls prototypes w/o arguments.
Note that specific changes related to libtool have to be upstreamed.
Co-authored-by: Peter Kokot <petk@php.net>
close GH-13732
2024-03-18 06:53:39 +00:00
Arnaud Le Blanc
0ea80126ea
Fix GH-13508: JITed QM_ASSIGN may be optimized out when op1 is null ( #13610 )
...
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2024-03-11 15:10:12 +01:00
Ilija Tovilo
00f9c5eeb4
Remove MAP_JIT flag
...
This flag is supposed to go on the flags parameter, rather than prot. Moreover,
this flag is no longer needed because the JIT does not set RWX without ZTS, and
JIT+ZTS has been disabled on macOS with Apple Silicon.
Closes GH-13638
2024-03-09 23:08:44 +01:00
Dmitry Stogov
728b81d92e
Prevent recording traces started from usupported VM instruction
2024-02-19 13:22:30 +03:00
Ilija Tovilo
6db95512b4
Disable JIT on Apple Silicon + ZTS
...
Apple Silicon has stricter rules about rwx mmap regions. They need to be created
using the MAP_JIT flag. However, the MAP_JIT seems to be incompatible with
MAP_SHARED. ZTS requires MAP_SHARED so that some threads may execute code from a
page while another writes/appends to it. We did not find another solution, other
than completely disabling JIT for Apple Silicon + ZTS.
See discussion in https://github.com/php/php-src/pull/13351 .
Co-authored-by: Peter Kokot <peterkokot@gmail.com>
Fixes GH-13400
Closes GH-13396
2024-02-18 00:07:46 +01:00
Dmitry Stogov
94ba883e19
Fix TLS access in JIT with MUSL ( #13329 )
2024-02-12 08:13:23 +03:00
Niels Dossche
d417072ebe
Fix GH-13232: Segmentation fault will be reported when JIT is off but JIT_debug is still on
...
Closes GH-13234.
2024-01-24 17:47:40 +01:00
Ilija Tovilo
1c1d785c4f
[skip ci] Fix 64-bit only test
2024-01-23 17:32:59 +01:00
Dmitry Stogov
f120ac93a1
Fix GH-12481: PHP crash with JIT enabled
2024-01-22 15:56:12 +03:00
Dmitry Stogov
5350952a37
Fix assertion
...
Fixes oss-fuzz #65233
2023-12-25 13:22:03 +03:00
Dmitry Stogov
731734dacb
Fixed type inference
...
Fixes oss-fuzz #65150
2023-12-18 12:27:35 +03:00
Dmitry Stogov
c67f6f449c
Fixed incorrect elimination of refcounted check in JIT for BIND_GLOBAL
...
Fixes oss-fuzz #65135
2023-12-18 11:27:55 +03:00
Ilija Tovilo
7cf1a2ad9d
Fix SELinux mprotect execheap error due to mem adjacent to heap
...
It seems SELinux has a bug where memory directly adjacent to the heap is
interpreted as heap memory. Dodge this issue by leaving some space between the
heap and memory suggested by find_prefered_mmap_base.
See GH-12932
See https://bugzilla.kernel.org/show_bug.cgi?id=218258
Closes GH-12942
2023-12-13 11:25:48 +01:00
Ilija Tovilo
623da03845
Fix zend_jit_undefined_long_key overwriting dim when dim == result
...
Fixes oss-fuzz #64727
Closes GH-12900
2023-12-11 15:07:09 +01:00
Dmitry Stogov
ff22409082
JIT: Fix .debug_abbrev section in GDB JIT API.
2023-12-11 10:08:55 +03:00
Ilija Tovilo
53909896e0
Fix asan shadow memory and shared_alloc_mmap clash
...
The memory region found by find_prefered_mmap_base may clash with memory regions
reserved by asan for tracking memory. The symptom of this is that mprotect for
JIT fails adding the PROT_EXEC flag to the shared memory region.
Closes GH-12890
2023-12-07 18:28:21 +01:00
Dmitry Stogov
1e55c97601
Fixed type inference
...
Fixes oss-fuzz #64577 , #64579 , #64589
2023-12-01 17:08:16 +03:00
Dmitry Stogov
423a1e586e
Fixed GH-8251: Narrowing occurred during type inference of ZEND_FETCH_DIM_W
2023-11-28 22:49:39 +03:00
Dmitry Stogov
39a813d9ca
Fixed GH-12812: Integer string in variable used as offset produces wrong undefined array key warning ( #12817 )
...
* Fixed GH-12812: Integer string in variable used as offset produces wrong undefined array key warning
* Fixed register names
2023-11-28 21:19:57 +03:00
Gina Peter Banyard
126a255d66
jit: fixed JIT "Attempt to assign property of non-object" warning emitted at the same time as Error is being thrown
2023-11-27 16:19:35 +00:00
Gina Peter Banyard
ed8b901869
jit: fixed "Uninitialized string offset" warning being emitted at the same time as invalid offset Error
2023-11-27 16:04:41 +00:00
Dmitry Stogov
2d65d714a3
Fixed GH-12748: Function JIT emits "could not convert to int" warning at the same time as invalid offset Error
2023-11-22 13:19:10 +03:00
Muhammad Moinur Rahman
6be4ba9f90
Add host_cpu type for FreeBSD
...
In FreeBSD world x86_64 host type is identified as amd64 so add proper
checks for FreeBSD amd64 hosts.
Close GH-12736
2023-11-21 21:01:38 +00:00
Dmitry Stogov
db26aee801
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Backport fix for GH-12512: JIT Assertion `info & (1 << type)' failed (#12660 )
2023-11-13 13:27:11 +03:00
Dmitry Stogov
c60c2a0d67
Backport fix for GH-12512: JIT Assertion `info & (1 << type)' failed ( #12660 )
2023-11-13 13:26:17 +03:00
Dmitry Stogov
6bf4041398
Backport fix for HASH/PACKED array inference through MAY_BE_ARRAY_EMPTY flag ( #12591 )
...
* Fixed HASH/PACKED array inference through MAY_BE_ARRAY_EMPTY flag
This fixes GH-12527
* typo
2023-11-03 10:54:57 +03:00
Dmitry Stogov
bbf2fc99a3
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Don't JIT after fatal errors
2023-11-02 14:14:48 +03:00
Dmitry Stogov
77a497d56a
Don't JIT after fatal errors
2023-11-02 14:14:12 +03:00
Dmitry Stogov
177a6f5d8a
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Fixed GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT
2023-11-02 08:11:00 +03:00
Dmitry Stogov
798b9d097b
Fixed GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT
2023-11-02 08:09:29 +03:00
Dmitry Stogov
125dbb2c03
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Fixed inorrect QM_ASSIGN elimination
2023-11-01 09:55:28 +03:00
Dmitry Stogov
19dfe05f16
Fixed inorrect QM_ASSIGN elimination
...
Fixes oss-fuzz #63771
2023-11-01 09:54:58 +03:00
Dmitry Stogov
4b82ed4387
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Backport fix for incorrect assumption about in-memory zval type
2023-10-31 11:59:08 +03:00
Dmitry Stogov
455a967934
Backport fix for incorrect assumption about in-memory zval type
2023-10-31 11:56:01 +03:00
Dmitry Stogov
14b36c8583
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Fixed GH-12511: Use must be in next opline assertion with patched infection
2023-10-31 07:52:38 +03:00
Dmitry Stogov
b3b46a44c5
Fixed GH-12511: Use must be in next opline assertion with patched infection
2023-10-31 07:51:36 +03:00
Dmitry Stogov
770c1b0361
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Fixed GH-12509: JIT assertion when running php-parser tests
2023-10-26 23:59:03 +03:00
Dmitry Stogov
5f46d86955
Fixed GH-12509: JIT assertion when running php-parser tests
2023-10-26 23:58:29 +03:00
Dmitry Stogov
76724fc4ac
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Fixed regression intoduced by 76c41d27f9
2023-10-25 15:15:39 +03:00
Dmitry Stogov
fbf4e196da
Fixed regression intoduced by 76c41d27f9
2023-10-25 15:15:13 +03:00
Dmitry Stogov
7320f33f7f
Merge branch 'PHP-8.1' into PHP-8.2
...
* PHP-8.1:
Fixed incorrect type inference
2023-10-24 18:48:58 +03:00
Dmitry Stogov
aa45df4849
Fixed incorrect type inference
2023-10-24 18:48:29 +03:00