#19077 [Opn->Fbk]: dba_open fails

From: Date: Mon, 09 Sep 2002 19:55:10 +0000
Subject: #19077 [Opn->Fbk]: dba_open fails
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18845@lists.php.net to get a copy of this message
ID: 19077 Updated by: wez@php.net Reported By: wboring@qualys.com -Status: Open +Status: Feedback Bug Type: DBM/DBA related Operating System: Redhat 6.2 kernel 2.2.10 PHP Version: 4.2.2 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. If PHP really is bailing out when dba_open fails, we need a backtrace to be able to determine the cause. However, from what you describe, I don't think that this crash is actually the cause of your problem - it's a side-effect... dba works by passing the calls through to your dbm style library. Since the default for gdbm is to open the db in locking mode (and that's what we're using), it sounds like this is either an issue with gdbm itself or perhaps even with your kernel. It's doesn't say anywhere in the docs for gdbm that multiple writers will block when accessing the database, so I would expect to get those intermittent errors you reported. (not a bug). So it seems that you need to manually ensure that writers will block - rather than use flock to protect your db, try using a semaphore from the sysvsem extension (much more reliable). Other things to try are upgrading (or perhaps downgrading) your gdbm installation and see if that makes a difference. (See if there are any known issues with gdbm too). --Wez. Previous Comments: ------------------------------------------------------------------------ [2002-09-09 12:24:59] wboring@qualys.com I just did a diff on ext/dba_gdbm.c between php 4.2.2 and php 4.2.3 and php in cvs, and there is no difference. ------------------------------------------------------------------------ [2002-09-09 12:19:13] wboring@qualys.com This seems to happen more frequently depending on the size of the DB, and when multiple calls to dba_open() happen. I even have all my dba_* calls wrapped with flock() calls to make sure only 1 script @ a time can access the db. I also have added a check to see if the DB file exists, to change the mode to 'w' instead of 'c'. Unfortunatly trying a dev version of php is not an option, since this is a production environment. ------------------------------------------------------------------------ [2002-08-23 18:24:55] sniper@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip I'm unable to reproduce this with PHP 4.3.0-dev. ------------------------------------------------------------------------ [2002-08-23 15:41:11] wboring@qualys.com I beg to differ. This is actually a bug. If you read the bug, it states that I cannot use dba_open(). it intermittently fails. This is a bug in php, that prevents me from opening a db file. ------------------------------------------------------------------------ [2002-08-23 14:55:02] georg@php.net Sorry, but the bug system is not the appropriate forum for asking support questions. Your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php Thank you for your interest in PHP. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/19077 -- Edit this bug report at http://bugs.php.net/?id=19077&edit=1

« previous php.bugs (#18845) next »