Bug #75595 [Opn->Fbk]: Database connect

From: Date: Thu, 30 Nov 2017 14:48:32 +0000
Subject: Bug #75595 [Opn->Fbk]: Database connect
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212838@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75595&edit=1 ID: 75595 Updated by: requinix@php.net Reported by: markus at prepaid-order dot com Summary: Database connect -Status: Open +Status: Feedback Type: Bug Package: PDO MySQL Operating System: ubuntu 16.04 PHP Version: 7.1.12 Block user comment: N Private report: N New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. According to your description the problem would be somewhere within generateErrorPlistWithFailReason... Previous Comments: ------------------------------------------------------------------------ [2017-11-30 13:15:59] markus at prepaid-order dot com Description: ------------ simple mariadb PDO connect and give result after success... when Database is available all worked fine.... shut down DB instance manual and host is not available call simple php script with this function... if Database is down catch block will not work and php is working and after that following Message appear. Fatal error: Allowed memory size of 629145600 bytes exhausted (tried to allocate 20480 bytes) my php function shows like this. the Code worked before,source code have never changed. tested with arbitrary php_memory limit,but the issue is still available... testet with php 5.6,7.0,7.1 (default)... it works fine with 7.1,but have no idea... timeout array in PDO constructor have also removed... Test script: --------------- > function getDBConnection() > { > global $pdo; > try { > if ($pdo == null) > $pdo = new PDO( > > 'mysql:host=databaseHost;dbname=someDatabase;charset=utf8mb4', > 'removed', > 'removed_too' > ); > } catch (Exception $ex) { > > generateErrorPlistWithFailReason(ErrorCodes::DATABASE_IS_DOWN, > exit(); > } > return $pdo; > } Expected result: ---------------- resource result and or result from catch block (if databse is down/notavailable)... Actual result: -------------- after timeout Fatal error: Allowed memory size of 629145600 bytes exhausted (tried to allocate 20480 bytes) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75595&edit=1

« previous php.bugs (#212838) next »