[comp.lang.perl] Perl 4.003 fails dbm test - System 5.2

russ@wpg.com (Russell Lawrence) (05/02/91)

In comp.lang.perl, article <3127@sparko.gwu.edu>, Randy McCaskill writes:
rm> I had the same problem so I compiled it using Larry's malloc.  It
rm> passed the dbm test this way.  It didn't really fix the problem, only
rm> avoided it.  If anyone knows of a better way, please post it.

In article <=A_+TWB@smurf.sub.org>, Matthias Urlichs writes:
mu> The problem is that some mallocs return NULL when you 
mu> allocate a zero-byte memory block.  While that seems to be 
mu> legal behavior, some dbm libraries can't cope with this.  
mu> 
mu> I don't have a good fix either.  (However, the Perl malloc 
mu> is faster anyway, at least on my machine.) 

I compiled perl4.003 without any immediate hitches on my 
system 5.2, 68020, multibus I machine using gcc with the 
-fpcc-struct-return and -traditional flags but I got
"Out of Memory!" messages at the beginning of the dbm test 
suite until I switched to Larry's malloc.  Now I'm getting 
a bus error message and a core dump on dbm test #2.  

A stack trace with adb gave me the following:
_memcpy(6ac04)+1a
_str_nset(4d184)+44
_str_make(77000000,41768)+38
_do_each(45de4)+7c
_eval(45dc4)+27ca
_eval(457c4)+290
_cmd_exec(41ec4)+10a4
_main(2,7fedf4,7fee00,2)+18e0

Not being expert with adb, the only thing I can gather from this is
that we're introducing a stray pointer somewhere in the do_each 
function.

Any suggestions?

-- 
Russell Lawrence, WP Group, New Orleans (504) 443-5000
russ@wpg.com   uunet!wpg!russ