Need help understanding source of dbm errors 
Author Message
 Need help understanding source of dbm errors

I'm working with a dbm file, and occasionally the file seems to suddenly
become corupt. The program will read from and store to the file fine, and
then all of the sudden will start returning errors of the form:

dbm store returned -1, errno 69, key "(key)" at (file), line 402, <STDIN> line
nn

Where nn is the nnth time I've entered data into STDIN. It will do this for
different keys at random, i.e., there is no pattern to which keys it does this
for. Does anyone have any ideas on what would be causing this error?

--
 Joshua A. Laff, CRL Head Operator, University of Illinois    (217) 333-7408

_______________________________________________________________________________
Disclaimer: If I were speaking for the UofI, I wouldn't be paying tuition.



Fri, 27 Sep 1996 05:24:37 GMT  
 Need help understanding source of dbm errors

:
: I'm working with a dbm file, and occasionally the file seems to suddenly
: become corupt. The program will read from and store to the file fine, and
: then all of the sudden will start returning errors of the form:
:
: dbm store returned -1, errno 69, key "(key)" at (file), line 402, <STDIN> line
: nn
:
: Where nn is the nnth time I've entered data into STDIN. It will do this for
: different keys at random, i.e., there is no pattern to which keys it does this
: for. Does anyone have any ideas on what would be causing this error?

You don't say what architecture you're on, but if you're on SunOS, errno 69
is "Disk quota exceeded."

Larry



Sat, 28 Sep 1996 02:04:53 GMT  
 Need help understanding source of dbm errors

:): dbm store returned -1, errno 69, key "(key)" at (file), line 402, <STDIN> line nn

:): Where nn is the nnth time I've entered data into STDIN. It will do this for
:): different keys at random, i.e., there is no pattern to which keys it does th
:): for. Does anyone have any ideas on what would be causing this error?

:)You don't say what architecture you're on, but if you're on SunOS, errno 69
:)is "Disk quota exceeded."

Hmm... I'm on SunOS, but the file is owned by root. I can also guarantee I'm
far below quota. Will that error show up for disk limit reached as well? That
would be a possible situation...

--
 Joshua A. Laff, CRL Head Operator, University of Illinois    (217) 333-7408

_______________________________________________________________________________
Disclaimer: If I were speaking for the UofI, I wouldn't be paying tuition.



Sat, 28 Sep 1996 02:51:44 GMT  
 Need help understanding source of dbm errors

I just checked the system messages file, and there were no occurances of
the file system being full, so that wouldn't have been the problem...

--
 Joshua A. Laff, CRL Head Operator, University of Illinois    (217) 333-7408

_______________________________________________________________________________
Disclaimer: If I were speaking for the UofI, I wouldn't be paying tuition.



Sat, 28 Sep 1996 02:55:08 GMT  
 Need help understanding source of dbm errors
I would like to use usub to pass binary structures between
C and Perl using pack and unpack.  The idea would be to
pass the struct from C to Perl as a string, then use
unpack to convert it into an array, or use pack to create
a string from an array then pass it to C, where it would be
treated as a struct.  

My first attempts don't seem to be working, apparently
because the Perl internal functions str_get() and str_set()
are intended to work with null terminated strings.
For example, str_set() calls strlen() and, str_get() calls
str_2ptr(), which calls strcpy().  Both of these functions
(strlen and strcpy) would stop at the first null character.

Apparently pack and join treat the strings representing
binary structures in a special way and know how long
they are supposed to be, but I haven't deciphered what's
going on there.

I guess what I need to do is write my own functions like
str_set() and str_get() that copy a fixed number of bytes.

Before I go off in the weeds trying this, has anybody
tried something like this?  Is there an easier way?
Am I crazy?

Thanks,
Chris Kapral



Sat, 28 Sep 1996 07:30:30 GMT  
 Need help understanding source of dbm errors

: Hmm... I'm on SunOS, but the file is owned by root. I can also guarantee I'm
: far below quota. Will that error show up for disk limit reached as well? That
: would be a possible situation...

I suppose it's possible that NDBM is setting that errno to indicate that
you've filled a bucket too full, or that too many keys hashed to the
same bucket.

Larry



Sun, 29 Sep 1996 02:50:11 GMT  
 Need help understanding source of dbm errors
:)I suppose it's possible that NDBM is setting that errno to indicate that
:)you've filled a bucket too full, or that too many keys hashed to the
:)same bucket.

That being the case (and the current structure of the program could easily
allow for this), is there any way to work around this (for example forcing
keys to a different bucket)? It seems to be quite a major limitation...

--
 Joshua A. Laff, CRL Head Operator, University of Illinois    (217) 333-7408

_______________________________________________________________________________
Disclaimer: If I were speaking for the UofI, I wouldn't be paying tuition.



Sun, 29 Sep 1996 20:21:24 GMT  
 Need help understanding source of dbm errors

Quote:


>:
>: I'm working with a dbm file, and occasionally the file seems to suddenly
>: become corupt. The program will read from and store to the file fine, and
>: then all of the sudden will start returning errors of the form:
>:
>: dbm store returned -1, errno 69, key "(key)" at (file), line 402, ...
>: .....

>You don't say what architecture you're on, but if you're on SunOS, errno 69
>is "Disk quota exceeded."

>Larry

On our Solaris 2.3 SC2000 and sparc-10's, I tried using dbm files linked
to associative arrays, and got the same error.  Repeated testing adn
debugging convinced me it was timing/load related, because the error seemed to
move around at random, faw fewer errors late at night, never got an error
when debugging in single-step mode, etc..  File system itself still had
lots of space, and I was way under quota limits.  Since my problem could
fit into available memory, and the dbm files were for persistance between
the parsing pass and a seperate analysis pass, I replaced the dbm/assoc array
linkage with flat files of $key$Seperator$value lines, and used print and
<> to store/read the data.  Since the Perl manual says you are at the
mercy of the dbm implementation, and since the error message was going
directly to the screen even when the Perl's script stdout was > into a file,
I guessed it was the dbm implementation at fault.
- Bill
--

Fujitsu Network Switching Inc.      | They do not necessarly reflect the
4403 Bland Rd, Raleigh, NC 27502    | view of Fujitsu Network Switching, Inc.


Mon, 30 Sep 1996 03:12:50 GMT  
 Need help understanding source of dbm errors


: :)I suppose it's possible that NDBM is setting that errno to indicate that
: :)you've filled a bucket too full, or that too many keys hashed to the
: :)same bucket.
:
: That being the case (and the current structure of the program could easily
: allow for this), is there any way to work around this (for example forcing
: keys to a different bucket)?

Store shorter values, or use a different DBM implementation.

: It seems to be quite a major limitation...

It seems so because it is.

Larry



Tue, 01 Oct 1996 03:31:32 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Tool to help understand unknown Perl source code

2. Need help understanding API

3. Need help understanding this

4. Help needed understanding bitwise operations

5. Perl DBI: Understanding errorhandling - help needed

6. Perl DBI: help needed understanding errorhandling

7. Need Help Understanding a perl script

8. Need help understanding references, specifically when dealing with subroutines

9. read.txt (long) was [Need some help to understand how some scripts work]

10. rsjemail.cgi (cgi post for e-mail) - help needed to understand perl

11. Please, need help understanding

12. Need help understanding directory structure (NEWBIE)

 

 
Powered by phpBB® Forum Software