Bug #79811 [NEW]: Script stops and delivers incomplete web page

From: Date: Wed, 08 Jul 2020 16:23:10 +0000
Subject: Bug #79811 [NEW]: Script stops and delivers incomplete web page
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227893@lists.php.net to get a copy of this message
From: buschmann at nidsa dot net Operating system: Windows Server 2019 64bit PHP version: 8.0.0alpha1 Package: opcache Bug Type: Bug Bug description:Script stops and delivers incomplete web page Description: ------------ During testing our application for compatibility with php 8 one script stopped suddenly and the resulting web page was incomplete. This occured when loading the empty web page without retrieving the central data from the database. The stop occurs at the following lines of code (the original code): ... for($i=0;$i<=7;$i++){ @$fSOrder=pg_fetch_assoc($rSOrder); if($fSOrder['od_distribution']==2){ ... This code has worked on all the version 7.x.y until 7.4.8 even if it misses error-handling. The query to get a valid $rSOrder with pg_query has not been called/executed, so $rSOrder is not existent at this point of the script. ($rSOrder etc. is declared global in a function for executing the query: function searchOrder(){ global $fSOrder,$rSOrder,$book,$iden,$style,$season,$file,$only; ... The original application developers knew that at this point there could be an error by using the not existing $rSOrder and included the @ to suppress the error message (not introduced/changed by me). When using php8 (already tested on php8 alpha 2) the script terminates with a last error message pointing to the line of pg_fetch_assoc: 08-Jul-2020 16:35:20 Europe/Berlin] PHP Warning: Undefined variable $rSOrder in N:\cpsdev\cps\cps_pg\AltaPedido.php on line 2390 The script terminates processing without any fatal error/crash and sends the incomplete web page to apache/browser. On the same machine and the same source tree php 7.4.8 logs the same error but continues and completes the web page. The problem remains when removing error reporting by deleting the @. Environment: - Windows server 2019 64bit Standard in a VM under HyperV - Apache 2.43 64bit from apachelounge - php 8 alpha2 64bit thread safe from php.net QA download - php loaded as a module with php_module - JIT is on for php8 (not sure if it is really used) - opcache is enabled -- Edit bug report at https://bugs.php.net/bug.php?id=79811&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79811&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79811&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79811&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79811&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79811&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79811&r=support Expected behavior: https://bugs.php.net/fix.php?id=79811&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79811&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79811&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79811&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79811&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79811&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79811&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79811&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79811&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79811&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79811&r=mysqlcfg

« previous php.bugs (#227893) next »