Mysql PDO heap corruption on Win10 x64 1909 (PHP x86 NTS)
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C
- Estrellas
- 40.4k
- Forks
- 8.2k
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 96
Descripción
Description
The following code:
<?php
define('DB_DRIVER', 'mysql');
define('DB_HOST', 'localhost');
define('DB_PORT', 3306);
define('DB_USER', '[removed]');
define('DB_PASS', '[removed]');
define('DB_NAME', '[removed]');
define('DB_DSN' , DB_DRIVER.':dbname='.DB_NAME.';host='.DB_HOST.';port='.DB_PORT);
$params = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_PERSISTENT => true,
PDO::ATTR_EMULATE_PREPARES => false,
PDO::MYSQL_ATTR_INIT_COMMAND => "SET SESSION sql_mode='', group_concat_max_len=32000, time_zone='+00:00'"
);
$params[PDO::ATTR_DEFAULT_FETCH_MODE] = PDO::FETCH_OBJ;
$handle = new PDO(DB_DSN, DB_USER, DB_PASS, $params);
Resulted in this output:
Random crashes with the following in Event Viewer:
Faulting application name: php-cgi.exe, version: 8.1.8.0, time stamp: 0x62c4c3bb
Faulting module name: ntdll.dll, version: 10.0.18362.719, time stamp: 0x832e7bce
Exception code: 0xc0000374
Fault offset: 0x000df95d
Faulting process id: 0x5458
Faulting application start time: 0x01d8a070256f66a2
Faulting application path: C:\Program Files (x86)\php81\php-cgi.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: a41ae7dc-55de-4152-b401-9553e23d1b5d
Faulting package full name:
Faulting package-relative application ID:
But I expected this output instead:
Successful database connection and no crashing.
Other notes:
This issue seems to be somewhat random, but I was able to get it to consistently crash if I kill the idle db connection via the sql command kill <id>;, then refresh the page. Using IIS 10 configured to hand-off the request to php via fastcgi. Database server attempting to connect to is on the same machine - Version: 10.4.12-MariaDB-log - Win10 x64. DebugDiag log attached (zipped due to file ext limitation on github).
php-cgi.exe_220725_131714_CrashHangAnalysis.zip
PHP Version
PHP 8.1.8 x86 NTS
Operating System
Windows 10 x64 1909
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.
Línea de trabajo
Empieza reproduciendo la conexión PDO mostrada en el issue con conexiones persistentes, luego termina la conexión inactiva de MariaDB y actualiza a través de IIS FastCGI. Inspecciona el registro de DebugDiag adjunto y las rutas de conexión y reconexión de PDO MySQL; se considera terminado cuando la misma secuencia ya no provoca un fallo por corrupción del heap.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- mariadb, mysql, php
- Área
- databases
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100