php / php/php-src

PHP 8.2.0 access violation while executing a 'foreach' loop

Aperta
#10,067 10 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Bug Category: JIT Status: Needs Triage
Lingua principale
C
Stelle
40.4k
Fork
8.2k
Merge medio
2g 13h
PR unite (30g)
96

Descrizione

Description

Encountered an access violation bug in PHP 8.2.0 while executing a foreach loop on an array. It's inside a complex PHP application. Unfortunateley, I cannot reproduce the error with a small extract of the code just with the loop. Using the extract, it works :-\

I added the extract also to here. But, might not help much as it works. I assigned the variables for the loop with the same values just before the loop which crashes. Background: Application is a house automation server. Loop creates the commands for an i2c command.

What I see:

  • The loop just stops before all array elements are executed and PHP exits immediately without calling any error- or exit-handler. The last command in the loop is executed. The next element is not retrieved. The loop is successfully executed ~10 times. In the next attempt, PHP crashes
  • No message is written to the prompt
  • No entry in the PHP error log is created (all error reporting is enabled)
  • A windows access violation event is created. See attachment (partly in German; hope thats not a problem)
  • It workes without errors in PHP 8.1.13 (cli) (built: Nov 22 2022 15:49:14) (ZTS Visual C++ 2019 x64)

If I can provide more information, just advise me.

PHP_8.2.0_Crash.txt
PHP_8.2.0_Crash_php.txt

PHP Version

PHP 8.2.0 (cli) (built: Dec 6 2022 15:31:23) (ZTS Visual C++ 2019 x64) - from windows.php.net

Operating System

Windows 10 22H2 Build 19045.2311

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia esaminando PHP_8.2.0_Crash_php.txt e PHP_8.2.0_Crash.txt, quindi esegui l'estratto fornito con PHP 8.2.0 e 8.1.13 su Windows per confermare la differenza. Per procedere è necessario ridurre il problema complesso di foreach a un caso riproducibile; il lavoro è completato quando la violazione di accesso può essere riprodotta e la sua causa o correzione è stata stabilita.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
php
Ambito
backend
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
18/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.