History log of /php-src/ext/opcache/ZendAccelerator.c (Results 1 – 25 of 755)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 3293fafa 24-Sep-2024 Florian Engelhardt

Add OPcache restart hook (#15590)

This hook will allow observing extensions to observe the actual OPcache restart.


# ded8fb79 02-Aug-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix UAF issues with PCRE after request shutdown

There are two related issues, each tested.

First problem:
What happens is that on the CLI SAPI we have a per-request pcre cache,

Fix UAF issues with PCRE after request shutdown

There are two related issues, each tested.

First problem:
What happens is that on the CLI SAPI we have a per-request pcre cache,
and on there the request shutdown for the pcre module happens prior to
the remaining live object destruction. So when the SPL object wants to
clean up the regular expression object it gets a use-after-free.

Second problem:
Very similarly, the non-persistent resources are destroyed after request
shutdown, so on the CLI SAPI the pcre request cache is already gone, but
if a userspace stream references a regex in the pcre cache, this breaks.

Two things that come immediately to mind:
- We could fix it by no longer treating the CLI SAPI special and just use
the same lifecycle as the module. This simplifies the pcre module code
a bit too. I wonder why we even have the separation in the first place.
The downside here is that we're using more the system allocator
than Zend's allocator for cache entries.
- We could modify the shutdown code to not remove regular expressions
with a refcount>0 and modify php_pcre_pce_decref code such that it
becomes php_pcre_pce_decref's job to clean up when the refcount
becomes 0 during shutdown. However, this gets nasty quickly.

I chose the first solution here as it should be reliable and simple.

Closes GH-15064.

show more ...


# 3665ab01 09-Sep-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-15657: Segmentation fault in ext/opcache/jit/ir/dynasm/dasm_x86.h

The crash happens because the zend_persist.c code tries to JIT the hook's
op_array while the JIT buffer memory is

Fix GH-15657: Segmentation fault in ext/opcache/jit/ir/dynasm/dasm_x86.h

The crash happens because the zend_persist.c code tries to JIT the hook's
op_array while the JIT buffer memory is still protected. This happens in
`zend_persist_property_info` called via `zend_persist_class_entry`
through the inheritance cache.

We shouldn't JIT the property hook code when persisting property info
for the inheritance cache.

This is a simple workaround by temporarily disabling the JIT so that the
property hook code is not JITted when persisting the property info.

An alternative solution would be to move the JITting of the property
hooks to a different place in zend_persist.c by doing an additional pass
over the classes.

Closes GH-15819.

show more ...


# 3e226af5 15-Aug-2024 Gina Peter Banyard

ext/opcache/ZendAccelerator.c: Restrict MD5 header include to Windows (#15418)

As it is only ever used in accel_gen_uname_id() which is Windows only


# 8b6f14a9 24-Jul-2024 Ilija Tovilo

Compile in opcache without COMPILE_IGNORE_INTERNAL_CLASSES (#15025)


# 3d6bd162 27-Jun-2024 Peter Kokot

Sync missing hash and pcre dependencies for opcache on Windows (#14682)

- ext/hash is required only on Windows
- ext/pcre is required


# cf3b9fca 24-Jun-2024 Peter Kokot

Sync #if/ifdef/defined (-Wundef) (#14623)

These are either define (to value 1) or undefined:
- __GNUC__
- DBA_CDB_BUILTIN
- DBA_GDBM
- HAVE_FORK
- HAVE_PUTENV
- HAVE_

Sync #if/ifdef/defined (-Wundef) (#14623)

These are either define (to value 1) or undefined:
- __GNUC__
- DBA_CDB_BUILTIN
- DBA_GDBM
- HAVE_FORK
- HAVE_PUTENV
- HAVE_SETENV
- HAVE_SYS_SELECT_H
- HAVE_SYS_SOCKET_H
- HAVE_SYS_WAIT_H
- HAVE_UNSETENV
- RFC3678_API
- ZEND_ENABLE_ZVAL_LONG64
- ZTS

Follow-up of GH-5526

show more ...


# 84a0da15 09-Jun-2024 Peter Kokot

Sync #if/ifdef/defined (#14508)

This syncs CPP macro conditions:
- _WIN32
- _WIN64
- HAVE_ALLOCA_H
- HAVE_ALPHASORT
- HAVE_ARPA_INET_H
- HAVE_CONFIG_H
- HAVE_DIRE

Sync #if/ifdef/defined (#14508)

This syncs CPP macro conditions:
- _WIN32
- _WIN64
- HAVE_ALLOCA_H
- HAVE_ALPHASORT
- HAVE_ARPA_INET_H
- HAVE_CONFIG_H
- HAVE_DIRENT_H
- HAVE_DLFCN_H
- HAVE_GETTIMEOFDAY
- HAVE_LIBDL
- HAVE_POLL_H
- HAVE_PWD_H
- HAVE_SCANDIR
- HAVE_SYS_FILE_H
- HAVE_SYS_PARAM_H
- HAVE_SYS_SOCKET_H
- HAVE_SYS_TIME_H
- HAVE_SYS_TYPES_H
- HAVE_SYS_WAIT_H
- HAVE_UNISTD_H
- PHP_WIN32
- ZEND_WIN32

These are either undefined or defined to 1 in Autotools and Windows.

Follow up of GH-5526 (-Wundef).

show more ...


# 8e62e2b8 22-May-2024 Cristian Rodríguez

Mark multple functions as static (#13864)

* Mark many functions as static

Multiple functions are missing the static qualifier.

* remove unused struct sigactions

st

Mark multple functions as static (#13864)

* Mark many functions as static

Multiple functions are missing the static qualifier.

* remove unused struct sigactions

struct sigaction act, old_term, old_quit, old_int;
all unused.

* optimizer: minXOR and maxXOR are unused

show more ...


# 1bae61a4 19-Mar-2024 Arnaud Le Blanc

Compress interned string table offsets and increase maximum supported buffer size (#13676)

Compress interned string table offsets and increase maximum supported buffer size

The inte

Compress interned string table offsets and increase maximum supported buffer size (#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.

show more ...


# 566100d7 29-Nov-2023 yang yuhan

Enhance moving PHP code pages into huge pages (#12806)

The former implementation of huge pages for PHP code segments may
fail to map in certain scenarios. For instance, if the initial

Enhance moving PHP code pages into huge pages (#12806)

The former implementation of huge pages for PHP code segments may
fail to map in certain scenarios. For instance, if the initial
'r-x-' segment is not PHP, it will result in a failure to map into
huge pages. Consequently, the optimization for huge pages with PHP
code will no longer be effective.

This patch improves the implementation by accurately matching all
'r-x-' segments until it locates the PHP code segment. Subsequently,
it performs the necessary huge page mapping.


Reviewed-by: chen-hu-97 <hu1.chen@intel.com>

Signed-off-by: PeterYang12 <yuhan.yang@intel.com>

show more ...


# fde41bc7 16-Nov-2023 Daniil Gentili

Report fatal error if JIT cannot be enabled

Closes GH-12403


# 07d81592 17-Oct-2023 Ilija Tovilo

Avoid JIT warning with opcache.jit_buffer_size=0

Closes GH-12460


# 71774611 10-Oct-2023 Daniil Gentili

Report warning if JIT cannot be enabled

Closes GH-12404


# f4ab4949 29-Sep-2023 Mikhail Galanin

Invalidate path even if the file was deleted

Closes GH-12323


# bdc87b0f 27-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix #80092: ZTS + preload = segfault on shutdown

After preloading has executed, the executor globals for class_table and
function_table are still referring to the values during preloadin

Fix #80092: ZTS + preload = segfault on shutdown

After preloading has executed, the executor globals for class_table and
function_table are still referring to the values during preloading.
If no request happens after that then these values will remain dangling
pointers. If then the -v option on CLI or -h option (and possibly
others) on CGI is provided, there is a double free.
Fix it by nulling the pointers explicitly after preloading has finished
to fix it for all SAPIs.

Closes GH-12311.

show more ...


# 5e8c992c 23-Sep-2023 Jakub Zelenka

Reduce impact of stream file path check in filestat

Fix for #76857 introduced slight perf regression so this is an attempt
to fix it. The idea is to re-use stream path check from ZendAcc

Reduce impact of stream file path check in filestat

Fix for #76857 introduced slight perf regression so this is an attempt
to fix it. The idea is to re-use stream path check from ZendAccelerator
that should be quicker than strstr.

Signed-off-by: Jakub Zelenka <bukka@php.net>

show more ...


# b2dbf0a2 31-Jul-2023 Ilija Tovilo

Remove opcache.consistency_checks

This feature has been broken at least since the tracing JIT and inheritance
cache have been introduced. The attempted fix (GH-10798) was too complex. We

Remove opcache.consistency_checks

This feature has been broken at least since the tracing JIT and inheritance
cache have been introduced. The attempted fix (GH-10798) was too complex. We
have thus decided to remove this feature for now.

Closes GH-11832

show more ...


# ee3f9323 17-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-11715: opcache.interned_strings_buffer either has no effect or opcache_get_status() / phpinfo() is wrong

There are a couple of oddities.

1) The interned strings buffer compri

Fix GH-11715: opcache.interned_strings_buffer either has no effect or opcache_get_status() / phpinfo() is wrong

There are a couple of oddities.

1) The interned strings buffer comprises the whole hashtable
datastructure.
Therefore, it seems that the interned strings buffer size is the size of
only said table. However, in the current code it also includes the size
of the zend_accel_shared_globals.

2) ZCSG(interned_strings).end is computed starting from the accelerator
globals struct itself. I would expect it to start from the part where
the interned strings table starts.

3) When computing the used size, it is done using
ZCSG(interned_strings).end - ZCSG(interned_strings).start. However,
this does not include the uin32_t slots array because
ZCSG(interned_strings).start pointers after that array.

This patch corrrects these 3 points.

Closes GH-11717.

show more ...


# 1a0ef2c1 06-Jul-2023 Ilija Tovilo

Revert "Remove name field from the zend_constant struct (#10954)"

This reverts commit f42992f580343931434dff2e4b2042ff945b48a1.

Closes GH-11604


# b0bc057e 17-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Prevent potential deadlock if accelerated globals cannot be allocated

Not sure if this is possible to hit in practice, zend_accel_error_noreturn
doesn't return so the unlock isn't called

Prevent potential deadlock if accelerated globals cannot be allocated

Not sure if this is possible to hit in practice, zend_accel_error_noreturn
doesn't return so the unlock isn't called. Other callsites that use both
zend_accel_error_noreturn and zend_shared_alloc_unlock first perform the
unlocking.

Closes GH-11718.

show more ...


# ad1b70d6 04-Jul-2023 Ilija Tovilo

Revert "Revert "Remove name field from the zend_constant struct (#10954)""

This reverts commit 9f4bd3040d2809f209d73f696b21302f311665b7.


# 9f4bd304 03-Jul-2023 Máté Kocsis

Revert "Remove name field from the zend_constant struct (#10954)"

This reverts commit f42992f580343931434dff2e4b2042ff945b48a1.

Fix GH-11423


# 9c59d22a 29-May-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-11336: php still tries to unlock the shared memory ZendSem with opcache.file_cache_only=1 but it was never locked

I chose to check for the value of lock_file instead of checking the

Fix GH-11336: php still tries to unlock the shared memory ZendSem with opcache.file_cache_only=1 but it was never locked

I chose to check for the value of lock_file instead of checking the
file_cache_only, because it is probably a little bit faster and we're
going to access the lock_file variable anyway. It's also more generic.

Closes GH-11341.

show more ...


# 414f71a9 16-Apr-2023 Máté Kocsis

Typed class constants (#10444)

RFC: https://wiki.php.net/rfc/typed_class_constants

Co-Authored-By: Ben <7127204+moliata@users.noreply.github.com>
Co-Authored-By: Bob Weinand <31

Typed class constants (#10444)

RFC: https://wiki.php.net/rfc/typed_class_constants

Co-Authored-By: Ben <7127204+moliata@users.noreply.github.com>
Co-Authored-By: Bob Weinand <3154871+bwoebi@users.noreply.github.com>
Co-Authored-By: Ilija Tovilo <ilija.tovilo@me.com>

show more ...


12345678910>>...31