Re: Core dump, bus error, byte alignment, ObjStack

Kevin Atkinson <[email protected]>
Newsgroups gmane.comp.gnu.aspell.devel
Message-ID <Pine.LNX.4.44.0405210936411.19186-100000@kevin-p3.atkinson.dhs.org>
On Fri, 21 May 2004, James Lee wrote:

> 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, lang=@0x60888, config=@0x60070) 
> at modules/speller/default/readonly_ws.cpp:855
> #1  0xff229f34 in 
> aspeller::create_default_readonly_dict(acommon::StringEnumeration*, 
> acommon::Config&) (els=0x5e6f0, config=@0x60888) 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:

But memory ineffect (in the case of very short strings).  Also won't work 
on 64 bit platforms.  Best to modify the above statement to:
  WordData * b = (WordData *)buf.alloc(total_size, sizeof(void *));

-- 
http://kevin.atkinson.dhs.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.