Bug 40529 - Perl 5.6.0 cannot open DB_Files existing from before upgrade to RH71
Summary: Perl 5.6.0 cannot open DB_Files existing from before upgrade to RH71
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: perl   
(Show other bugs)
Version: 7.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Warren Togami
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2001-05-14 11:56 UTC by Justin Mason
Modified: 2007-04-18 16:33 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-05-28 06:55:42 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
a copy of the existing .db file which illustrates the problem (gzipped .db file) (2.89 KB, application/octet-stream)
2001-05-14 11:57 UTC, Justin Mason
no flags Details

Description Justin Mason 2001-05-14 11:56:04 UTC
Description of Problem:

Any perl script that uses the DB_File module in the recommended manner 
(ie. as seen in 'man DB_File') will not be able to open existing db's 
after an upgrade to RH7.

I reckon this is because the new perl (5.6.0) is linked with the newer 

How Reproducible: Every Time

Steps to Reproduce:

1. install RH6.2 ;)
2. create a .db database using DB_File
3. upgrade to RH7
4. attempt to open the .db from step 2
Actual Results:

A spurious "File Exists" error is returned.

Expected Results:

The file should have been opened correctly.

Additional Information:

The error message returned by the DB_File module's "tie" command is 
EEXIST, "File exists".

Here's a sample strace line:

O_RDWR|O_CREAT|O_EXCL, 0600) = -1 EEXIST (File exists)

The perl line that produced this was:
    my $dbobj = tie (%db, $dbtype, $self->{filename},
                                  O_CREAT|O_RDWR, 0600)
Note -- no O_EXCL was specified, but perl/db is using it for some reason, 
as the strace proves! The O_CREAT|O_RDWR options are recommended in the 
DB_File manpage.

The error will persist as long as the existing .db file exists. Once it 
is removed, the script will work fine.

I can provide a sample .db file which illustrates this.

Comment 1 Justin Mason 2001-05-14 11:57:25 UTC
Created attachment 18271 [details]
a copy of the existing .db file which illustrates the problem (gzipped .db file)

Comment 2 Chip Turner 2001-12-19 08:36:59 UTC
you can fix your database by a dump/load pair.  I was able to read it via this

db2_dump rh62cache.db | db_load foo.db

Then I could tie properly to foo.db.

This is a workaround, but it should solve your problems.

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