Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh problems on sparc: fixed



Chmouel Boudjnah wrote:
> Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx> writes:
> 
> > I've put this in the MACHINES file, but it would be nice to know a bit more
> > about what Solaris systems 
> 
> no solaris installed, linux :

Ah, I've been chasing up a gum tree looking on Solaris 5.6, then, where
there's no problem.  It's presumably the same problem reported by Clint, or
a version of it.  If that's the case, try moving the 'data' element of
'struct qual' around line 108 in glob.c to be the first element of the
struct.  It shouldn't be necessary with gcc, but it's the first workaround
that comes to mind.  To be on the safe side, better rewrite struct gmatch
too --- here's a patch.  The compiler's supposed to handle this if the
struct itself is properly aligned anyway, so it's still possible the
memory allocator isn't returning 64-bit aligned quantities for some
reason which would need further investigation.

> Date: Thu, 30 Dec 1999 17:43:30 -0500
> From: Clint Adams <schizo@xxxxxxxxxx>
> Subject: reproducible bus error
> 
> On UltraSPARC Linux zsh (compiled 32-bit) experiences a bus error
> when trying to execute this line (1320) in Src/glob.c:
> 
> qn->data = data;
> 
> I notice that off_t data has ALIGN64.  Is that relevant or
> is something else going on here?

Index: Src/glob.c
===================================================================
RCS file: /home/pws/CVSROOT/projects/zsh/Src/glob.c,v
retrieving revision 1.2
diff -u -r1.2 glob.c
--- Src/glob.c	1999/12/03 19:12:10	1.2
+++ Src/glob.c	2000/01/18 20:37:41
@@ -41,13 +41,13 @@
 typedef struct gmatch *Gmatch; 
 
 struct gmatch {
-    char *name;
     off_t size ALIGN64;
+    off_t _size ALIGN64;
+    char *name;
     long atime;
     long mtime;
     long ctime;
     long links;
-    off_t _size ALIGN64;
     long _atime;
     long _mtime;
     long _ctime;
@@ -102,10 +102,10 @@
 typedef int (*TestMatchFunc) _((char *, struct stat *, off_t, char *));
 
 struct qual {
+    off_t data ALIGN64;		/* Argument passed to function               */
     struct qual *next;		/* Next qualifier, must match                */
     struct qual *or;		/* Alternative set of qualifiers to match    */
     TestMatchFunc func;		/* Function to call to test match            */
-    off_t data ALIGN64;		/* Argument passed to function               */
     int sense;			/* Whether asserting or negating             */
     int amc;			/* Flag for which time to test (a, m, c)     */
     int range;			/* Whether to test <, > or = (as per signum) */
-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>



Messages sorted by: Reverse Date, Date, Thread, Author