Bug 40529 - Perl 5.6.0 cannot open DB_Files existing from before upgrade to RH71
Perl 5.6.0 cannot open DB_Files existing from before upgrade to RH71
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: perl (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Warren Togami
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-05-14 07:56 EDT by Justin Mason
Modified: 2007-04-18 12:33 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-28 02:55:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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 07:57 EDT, Justin Mason
no flags Details

  None (edit)
Description Justin Mason 2001-05-14 07:56:04 EDT
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 
libdb.


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:

open("/home/jm/.webmake/nethome_jm_ftp_ettext_doc_documentation/cache.db", 
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 07:57:25 EDT
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 03:36:59 EST
you can fix your database by a dump/load pair.  I was able to read it via this
command:

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.