Red Hat Bugzilla – Bug 63980
reproduceable gdbm fatal read error
Last modified: 2007-04-18 12:42:16 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc1) Gecko/20020417
Description of problem:
I think I've located a reproduceable gdbm bug under linux. It happens when a
specific set of items are inserted into a database from scratch. I get a
gdbm fatal read error. From cursory glancing over the source it looks to me
like gdbm is seeking to the end of the file and then getting a short read
while looking for an empty "bucket."
I've included a URL for a tar file with an example program and text file of keys
and value lengths to insert. Please read the README for specific instructions.
A couple of notes:
1. This ONLY happens on 64 bit builds of this (i.e. -D_FILE_OFFSET_BITS=64).
2. This has been verified on redhat 6.2, 7.1 and 7.2 systems.
Version-Release number of selected component (if applicable): 1.8.0
Steps to Reproduce:
Download and unpack the following file...
Read the README for specific instructions, but the general idea is that you need
to build a 64 bit version of the library and then link the breakgdbm.c program
against it. The program should be run with the keys.txt file as it's input.
Again, the README in the archive has specific instructions.
Actual Results: gdbm fatal: read error
Expected Results: build a database.
Created attachment 54944 [details]
program to break gdbm
We don't build it that way, and this is a major reason why...
Created attachment 55368 [details]
Patch I received from gdbm maintainer
Do you mean you don't build it as an archive file or you don't build it using
the 64 bit offsets.
I've attached a patch I got from the gdbm maintainer (firstname.lastname@example.org).
Everything looks ok now, but considering how rare this was, it's hard to verify.
We don't build gdbm with 64 bit offsets (may change). Unfortunately, gdbm has
been rather stagnant for a long time, while bdb is alive and well. I'll take a
look at the patch and will probably put it in.
Added the patch and 64 bit directive to gdbm-1.8.0-15
You are probably aware of this, but there is no binary compatiblity between 32
and 64 bit gdbm databases.