Bug 136305 - gdbm prefers flock over fcntl when being built
Summary: gdbm prefers flock over fcntl when being built
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gdbm
Version: 3.0
Hardware: i386
OS: Linux
medium
low
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: Jay Turner
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-10-19 09:50 UTC by Ralph Angenendt
Modified: 2015-01-08 00:08 UTC (History)
3 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2005-09-29 20:56:47 UTC


Attachments (Terms of Use)
Patch for systems.h which checks for fcntl first (1.58 KB, patch)
2004-10-19 09:51 UTC, Ralph Angenendt
no flags Details | Diff
patch to allow gdbm to use fcntl even if flock is present (817 bytes, patch)
2004-12-17 17:46 UTC, Neil Horman
no flags Details | Diff
Fixed version of patch for systems.h which checks for fcntl first (1.49 KB, patch)
2004-12-20 11:13 UTC, Adam Spiers
no flags Details | Diff

Description Ralph Angenendt 2004-10-19 09:50:08 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7)
Gecko/20040808 Lightninganemone/0.9.3 (Firefox/0.9.3 gotcha)

Description of problem:
With gdbm it is not possible to lock files via nfs, as gdbm has been
built against flock, which "the sourcecode" prefers over fcntl (in
systems.h HAVE_FLOCK is tested, if - and only then - this fails,
locking gets defined for fcntl).

As no Posix locking is available, using gdbm via NFS fails with "No
locks available".

When being built, availability of fcntl should be checked first, only
if it is not available do a fallback on flock.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. install gdbm
2. try dbm_open() on a file exported via NFS
3.
    

Actual Results:  The program fails with "No locks available"

Expected Results:  It should have opened the database.

Additional info:

Comment 1 Ralph Angenendt 2004-10-19 09:51:43 UTC
Created attachment 105433 [details]
Patch for systems.h which checks for fcntl first

When being rebuild with this patch, gdbm uses fcntl over flock, so that posix
locking is possible

Comment 2 Adam Spiers 2004-12-17 12:31:31 UTC
See also bug #123415

Comment 3 Neil Horman 2004-12-17 17:46:48 UTC
Created attachment 108815 [details]
patch to allow gdbm to use fcntl even if flock is present

This patch adds a configure script option to gdbm so that even if flock is
detected during configuration, fcntl will be used to lock files.  This will
allow the package to be rebuilt to work over NFS by adding a
--enable-force-fcntl flag on the %configure line of the gdbm spec file.

Comment 4 Adam Spiers 2004-12-20 11:10:24 UTC
Is there any reason ever to prefer flock to fcntl if both are available?

If not, I would prefer the first approach - it's better to
automatically always make the right decision rather requiring the
person building the package to override the wrong decision via
--enable-force-fcntl.  Unless you have some other reasons I haven't
thought of for taking this latter approach?

Comment 5 Adam Spiers 2004-12-20 11:13:16 UTC
Created attachment 108884 [details]
Fixed version of patch for systems.h which checks for fcntl first

The first patch didn't apply to 1.8.0 cleanly for me.  Attaching a version
which does; should be identical in functionality.


Note You need to log in before you can comment on or make changes to this bug.