From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22325 invoked from network); 3 Jan 2000 11:54:44 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Jan 2000 11:54:44 -0000 Received: (qmail 13465 invoked by alias); 3 Jan 2000 11:54:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9184 Received: (qmail 13458 invoked from network); 3 Jan 2000 11:54:33 -0000 Date: Mon, 03 Jan 2000 12:54:03 +0100 From: jarausch@igpm.rwth-aachen.de Subject: Re: Glob problem with memory In-reply-to: <200001031011.LAA11708@numa1.igpm.rwth-aachen.de> To: pws@pwstephenson.fsnet.co.uk Cc: zsh-workers@sunsite.auc.dk Reply-to: jarausch@igpm.rwth-aachen.de Message-id: <200001031154.MAA18806@numa1.igpm.rwth-aachen.de> MIME-version: 1.0 Content-type: TEXT/plain; charset=us-ascii On 3 Jan, To: pws@pwstephenson.fsnet.co.uk wrote: > On 1 Jan, Peter Stephenson wrote: >> Felix Rosencrantz wrote: >>> When attempting to do an "echo *(/)" or use other glob qualifiers, >>> I've been getting a bus error with this stack trace on Solaris 5.6. >>> I started seeing this problem in builds sometime after Dec 14th. >>> I think it is related to the recently made memory changes. >>> I don't see the problem if I replace the hcalloc on line glob.c:1312 >>> with a zcalloc, so the problem seems to be related to memory allocation. >> >> We should check that the new mmap() memory things in mem.c always return >> 64-bit aligned pointers where necessary, even on 32-bit machines. I was >> getting just this sort of problem with the old form of the zhalloc() >> mechanism when I introduced 64-bit integer support and before I fixed the >> alignment. I'll have a look at this, but Sven might be able to trace it >> more effectively when he gets back. Meanwhile, changing the USE_MMAP >> #define in mem.c to #undef USE_MMAP should fix things up for the time >> being. >> > Here on my IRIX box (it's 64 bit but I am using -n32 i.e. 32 bit code) > I get the same bus error, > BUT mem.c does NOT use mmap here, since my doesn't define > MAP_ANONYMOUS > > So what can we do? > Helmut. > In addition I found out sizeof(struct heap) == 20 here, so with the definition #define arena(X) ((char *) (X) + sizeof(struct heap)) in mem.c line 324 return arena(h) + n - size; is nearly guaranteed to be misaligned here. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik Institute of Technology, RWTH Aachen D 52056 Aachen, Germany