delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/10/12/16:47:29

X-Originating-IP: [212.234.3.190]
From: "yun zhang" <yunzhang73 AT hotmail DOT com>
To: ST001906 AT HRZ1 DOT HRZ DOT TU-Darmstadt DOT De
Cc: djgpp AT delorie DOT com
Subject: Re: gdbm read error
Date: Fri, 12 Oct 2001 13:43:25 -0700
Mime-Version: 1.0
Message-ID: <F47rzvsTDWWcuZcGwM000004baf@hotmail.com>
X-OriginalArrivalTime: 12 Oct 2001 20:43:25.0394 (UTC) FILETIME=[8A367320:01C1535E]
Reply-To: djgpp AT delorie DOT com

Hi, Juan:

Thanks a lot for your response! It's my fault that I did not give enough 
information for you to identify the problem. Actually, my application is 
written to be running on Solaris 2.7, it is not a window application. I 
downloaded the gdbm 1.8.0 on Aug. 22 last year and that's the only one I 
use. My application will create db files and read from those db files. So it 
does not read old db files.

Looks like you are familiar with gnu database. I looked into the code in 
gdbm where it gives out the error "read error" and found out that it calls 
the function read(). From my understanding, this low level unix function 
should be stable if no pipes involved. It will fail for instance, the file 
descriptor is not valid or the address is wrong. But I do not think that's 
the case here since the same code worked for the same inputs on the first 
run, and then failed on the second run. Now if I run it with the same inputs 
again, it always succeed.

Several reasons that I do not know how to debug this problem: 1. I can not 
replicate the problem now; 2. gdbm only told me that there is "read error", 
but it does not set errno. If you could give me a clue, I'll be really 
appreciated.

Thanks again and hope you have a good weekend!
Yun


>From: "Juan Manuel Guerrero" <ST001906 AT HRZ1 DOT HRZ DOT TU-Darmstadt DOT De>
>To: yunzhang73 AT hotmail DOT com (yun zhang)
>CC: djgpp AT delorie DOT com
>Subject: Re: gdbm read error
>Date: Fri, 12 Oct 2001 21:56:18 +0200
>
>On 11 Oct 2001, yun zhang wrote:
>
> > I'm using gdbm-1.8.0 and got error: "gdbm error: read error". Does
> > anybody have ideas about this failure? The code actually works fine
> > for the past two months and suddenly I got such error message.
>
>You do not give me very much information so I must *speculate*.
>I must assume that you have compiled your database application
>and linked it with an old and bogus version of gdbm. The serious
>bug of this library is that it reads and writes db files in *dos
>text mode* instead of *dos binary mode*. All this means that you
>have created broken db files using your broken application.
>Later you have downloaded the repaired gdbm library and recompiled
>your application. Now, your new application will read and write
>all db files written in dos text mode, in dos binary mode. This fact,
>probabely, originates the error message.
>IMHO, there are only two possibilities:
>1) Try to convert your db files from text style files into binary
>style files using an utility like dtou.exe from djdev203.zip.
>I have never tried this, so I do not know if this will ever work.
>2) There is no way to convert the original db files from dos text
>mode into dos binary mode. The db files must be recreated from
>scratch.
>
>Please note that I have been speculating. You have not given any
>information to me to reproduce the difficulty. I would need at least
>the timestamp of the gdbm library used to create the db files that
>can no longer be read. Anyway, it is *very* likely that your db files
>are lost and I would seriously suggest to download the actual gdbm
>library (timestamp: 2001-08-27) and recreate your db files from
>scratch.
>
>Regards,
>Guerrero, Juan Manuel


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019