AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

potential place for segfault
 
 

I see in your last code in src/spellcheck.cpp
next lines

364: for (unsigned int  i 0size; ++i) ++dictWordLetterSet[letterIndexData[(unsigned char)dictinfo[i]]]// computer number of each kind of letter
632: for (unsigned int  i 0len; ++i)  ++realWordLetterCounts[(unsigned char)letterIndexData[word[i]]]// compute number of each kind of character 

look at work with letterIndexData,
as you can see in line 364 (unsigned char) cast

you must add such casting and in line 632 for word
because… of cause you must understand why wink

PS: in my case i use gdb in your old customized version chatscript(~2.7) and got
Program received signal SIGSEGV, Segmentation fault.
0x080bf4c7 in SpellFix (originalWord=0xb563c0ec “\360\237\230\214”, position=1, posflags=210445008896) at src/spellcheck.cpp:583
583         for (unsigned int i = 0; i < len; ++i)  ++set[(unsigned char)letterIndexData[word]];// for length of dictionary word, not user input
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.107.el6.i686 libgcc-4.4.7-3.el6.i686 libstdc++-4.4.7-3.el6.i686

 

 

 
  [ # 1 ]

Indeed. Thanks for finding that.

 

 
  login or register to react