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: Alessandro Vesely
Subject: [aspell-devel] Core dump, bus error, byte alignment, ObjStack
Date: Sun, 18 Sep 2005 17:38:23 +0200

Hi,
the subject is the same as last year post from James Lee
http://lists.gnu.org/archive/html/aspell-devel/2004-05/msg00005.html
but the bug is different:

It occurs in the following context (gdb bt)

#0  clear_check_info (address@hidden) at check_list.hpp:19
#1  0xff2f7990 in aspeller::GuessInfo::add (this=0xffbef098) at 
check_list.hpp:31
#2  0xff265270 in aspeller::LookupInfo::lookup (this=0xffbeef30, word=
{str_ = 0xffbeed68 "minchiar", size_ = 4294967295}, c=0x1f0, achar=122 'z', address@hidden, gi=0xffbef098) at modules/speller/default/affix.cpp:1001
#3  0xff2660e8 in aspeller::SfxEntry::check (this=0xb61fc, address@hidden, word=
     {str_ = 0x7c180 "minchia", size_ = 7}, address@hidden, gi=0xffbef098, 
optflags=0, ppfx=0x0)
   at modules/speller/default/affix.cpp:1254

Even if CheckInfo has size 36, the dump shows the CheckInfo structure has an
odd address (address@hidden). That's because of a previous GuessInfo::dup() for
an odd size.

The following apparently fixes it

--- modules/speller/default/check_list.hpp%     2005-09-18 17:21:54.689029000 
+0200
+++ modules/speller/default/check_list.hpp      2005-09-18 17:21:54.699031000 
+0200
@@ -27,7 +27,7 @@
    void reset() { buf.reset(); num = 0; head = 0; }
    CheckInfo * add() {
      num++;
-      CheckInfo * tmp = (CheckInfo *)buf.alloc_top(sizeof(CheckInfo));
+      CheckInfo * tmp = (CheckInfo *)buf.alloc_top(sizeof(CheckInfo), 
sizeof(void*));
      clear_check_info(*tmp);
      tmp->next = head;
      head = tmp;




reply via email to

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