opcache.file_cache: segfault or wrong function for functions loaded with dl()
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- backend, performance
Línea de trabajo
Start with the ZEND_INIT_FCALL offset handling in zend_file_cache.c and review the change identified as d6541df63, along with related issue GH-24661. Reproduce the supplied dl() and OPcache file cache commands using the example scripts, then trace how functions added by the extension affect cached calls. Done means repeated runs call dl_test_test2() and print "Hello World" without a crash or calling a different function.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
Quoted text written with an LLM and checked by a human developer.
A script in the file cache can crash or call the wrong function if it calls a function loaded with
dl(), and that function has a different position in the function table on a later run.d6541df63 (GH-24664) removed the reset of the
ZEND_INIT_FCALLoffset fromzend_file_cache.c. The old comment said the reset could go once system ID validation was in place. The system ID is finalized at startup, so it does not cover functions added later bydl().
main.php:
<?php
if (isset($argv[1])) {
function a() {}
function b() {}
}
dl('dl_test');
include __DIR__ . '/call.php';
call.php:
<?php
var_dump(dl_test_test2());
With dl_test built as a shared extension:
PHP="php -d opcache.enable_cli=1 -d opcache.file_cache=/tmp/fc -d opcache.file_cache_only=1 -d opcache.file_update_protection=0"
$PHP main.php x
$PHP main.php
Resulted in this output:
string(11) "Hello World"
Segmentation fault
But I expected this output instead:
string(11) "Hello World"
string(11) "Hello World"
With only function a() {}, the second run calls a different function:
Fatal error: Uncaught ArgumentCountError: dl_test_frameless() expects exactly 1 argument, 0 given
Tested on debug and release builds of PHP-8.4 at 3ace94211. An earlier build at 2f6fd1167, without d6541df63, prints the expected output. The reset is also gone from the sources of php-8.4.28RC1, php-8.5.13RC1 and php-8.6.0RC5, which I did not build.
Related: GH-24661
PHP Version
PHP 8.4.28-dev (3ace94211)
Operating System
Ubuntu 26.04
- Lenguaje dominante
- C
- Estrellas
- 41.8k
- Forks
- 8.5k
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 137
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de php/php-src
-
SNMP accepts malformed remote portsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
php/php-src#25137 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Bug Status: Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
quoted_printable_encode() produces lines longer than 76 characters for bytes 0xF5 to 0xFFPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Bug Status: Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
php/php-src#24196 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Feature Status: Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
php/php-src#24183 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de php/php-src
Issues similares
-
Research radar digest 2026-W46Abiertoresearch-radar
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
good first issue help wanted program
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
hffgzktbcc-blip/ounce-core#297 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
virtualsquare/picotcp#88 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día