[php-src] PR #25734: Fix opcache.jit_max_root_traces accepting values outside of its valid range
| From: | marc-mabe | Date: | Wed, 25 Nov 2026 09:04:28 +0000 |
| Subject: | [php-src] PR #25734: Fix opcache.jit_max_root_traces accepting values outside of its valid range | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40990@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25734
Author: marc-mabe
opcache.jit_max_root_traces was taken as is to size the root traces buffer in shared memory. A value
of 0 allocated no buffer at all, so the trace counters kept in its first element overlapped the next
shared memory allocation. A negative value or one as large as 2**62 on 64-bit wrapped the buffer
size around, failing the allocation or leaving a buffer far too small for the traces, which crashed
once they got compiled.
Reject values outside of 1 to the smaller of UINT32_MAX, as trace ids are uint32_t, and the number
of root traces whose buffer size fits size_t. Like the other JIT settings, an invalid value emits a
warning naming the range and keeps the default. A failure to allocate the buffer now also tells its
size and which settings to change.