aspell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[aspell-devel] Core dump, bus error, byte alignment, ObjStack


From: James Lee
Subject: [aspell-devel] Core dump, bus error, byte alignment, ObjStack
Date: Fri, 21 May 2004 10:58:40 GMT

aspell-0.60-20040511 fails on Sparc architecture (big endian). The 
failure occurs here when building the dictionaries:

#0  0xff228bac in (anonymous 
namespace)::create(acommon::StringEnumeration*, aspeller::Language 
const&, acommon::Config&) (els=0x5e6f0, address@hidden, address@hidden) 
at modules/speller/default/readonly_ws.cpp:855
#1  0xff229f34 in 
aspeller::create_default_readonly_dict(acommon::StringEnumeration*, 
acommon::Config&) (els=0x5e6f0, address@hidden) at 
modules/speller/default/readonly_ws.cpp:1107
#2  0x00029efc in master() () at prog/aspell.cpp:1333


The problem is the misalignment of 'b' as produced 2 lines above by:
          WordData * b = (WordData *)buf.alloc(total_size);


A simple workaround which so far has allowed aspell to run is to modify 
ObjStack alloc(size_t size) to align to a 4 byte boundary:


--- common/objstack.hpp.orig    2004-05-11 17:13:18.000000000 +0100
+++ common/objstack.hpp 2004-05-20 21:25:33.990018000 +0100
@@ -96,7 +96,7 @@
 
   // By default objects are allocated from the top since that is sligtly
   // more efficient
-  void * alloc(size_t size) {return alloc_top(size);}
+  void * alloc(size_t size) {return alloc_top(size, 4);}
   void * alloc(size_t size, size_t align) {return 
alloc_top(size,align);}
   char * dup(ParmString str) {return dup_top(str);}
 


James.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]