logo       

#19077 [Ana->Csd]: dba_open fails: msg#00345

Subject: #19077 [Ana->Csd]: dba_open fails
 ID:               19077
 Updated by:       helly@xxxxxxx
 Reported By:      wboring at qualys dot com
-Status:           Analyzed
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: Redhat  6.2 kernel 2.2.10
 PHP Version:      4.2.2
 Assigned To:      helly
 New Comment:

Documentation was updated some time ago...


Previous Comments:
------------------------------------------------------------------------

[2002-09-09 17:20:34] sniper@xxxxxxx

Yes, that's true..reclassified as documentation problem.


------------------------------------------------------------------------

[2002-09-09 17:17:20] wboring at qualys dot com

If its not a bug in php, someone should not this anomaly in the php
docs, so other don't make the same mistake.  There is no info on any of
the docs that say you need to "manually" semaphore access to the db
file.  
  I guess this means that only 1 script can access the db at 1 time,
which means slow.  *sigh* I wish I could use a real DB.

------------------------------------------------------------------------

[2002-09-09 17:12:39] sniper@xxxxxxx

There can only be one writer at the time. This really isn't bug in
PHP..just do what Wez proposed. (use the semaphores)

------------------------------------------------------------------------

[2002-09-09 15:10:24] wboring at qualys dot com

Ok So I modified the dba_gdbm.c's dba_open call to output a little
debugging information

        if(dbf) {
                info->dbf = malloc(sizeof(dba_gdbm_data));
                memset(info->dbf, 0, sizeof(dba_gdbm_data));
                ((dba_gdbm_data *) info->dbf)->dbf = dbf;
                php_error(E_WARNING, "gdbm_open worked, %s\n",
gdbm_strerror(gdbm_errno));
                return SUCCESS;
        } else {
                php_error(E_WARNING, "gdbm_open failed %s\n",
gdbm_strerror(gdbm_errno));
                return FAILURE;
        }


The error I am always getting is
PHP Warning:  gdbm_open failed Can't be writer
from the gdbm_open call.

------------------------------------------------------------------------

[2002-09-09 14:55:10] wez@xxxxxxx

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.

------------------------------------------------------------------------

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


-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe