#33994 [NEW]: DB unavailable after forked child exits

From: Date: Thu, 04 Aug 2005 06:03:08 +0000
Subject: #33994 [NEW]: DB unavailable after forked child exits
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-82930@lists.php.net to get a copy of this message
From: greatwhitepine at bigfoot dot com Operating system: Tru64 UNIX V5.1B (Rev. 2650) PHP version: 5.0.4 PHP Bug Type: Scripting Engine problem Bug description: DB unavailable after forked child exits Description: ------------ As per the manual ingres_connect connections are terminated when the process exits. When a forked child exits the connection is terminated permanently until the parent process is restarted. Reproduce code: --------------- ingres_connect($str_database, $str_username, $str_password); if (ingres_query('select count(*) from table')) { print 'db ok during fork'."\n\n"; } $int_pid = pcntl_fork(); if(!$int_pid) { ingres_connect($str_database, $str_username, $str_password); if (ingres_query('select count(*) from table')) { print 'db ok for child'."\n\n"; } exit(); } ingres_connect($str_database, $str_username, $str_password); if (!ingres_query('select count(*) from table')) { print 'db not ok after fork'."\n\n"; } Expected result: ---------------- db ok during fork db ok for child Actual result: -------------- db ok during fork db ok for child Warning: ingres_query(): Ingres II: Server or API error : Read from peer process failed; it may have exited. in /home/its/autoldg/lib/php/local/lib_autoldg_daemon.php on line 228 Warning: ingres_query(): Ingres II: SQLSTATE : 08004 in /home/its/autoldg/lib/php/local/lib_autoldg_daemon.php on line 228 db not ok after fork Warning: Unknown: Ingres II: Server or API error : API function cannot be called in the current state. in Unknown on line 0 Warning: Unknown: Ingres II: SQLSTATE : 5000R in Unknown on line 0 Warning: Unknown: Ingres II: Unable to close statement !! in Unknown on line 0 Warning: Unknown: Ingres II: Unable to rollback transaction !! in Unknown on line 0 -- Edit bug report at http://bugs.php.net/?id=33994&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33994&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33994&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33994&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33994&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33994&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33994&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33994&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33994&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33994&r=support Expected behavior: http://bugs.php.net/fix.php?id=33994&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33994&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33994&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33994&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33994&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33994&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33994&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33994&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33994&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33994&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33994&r=mysqlcfg

« previous php.bugs (#82930) next »