Re: [code] [textadept] Possible bug?

From: triplejam <triplejam.att.protonmail.com>
Date: Thu, 10 May 2018 13:53:57 -0400

Hi again, I've just discovered a way to get it to stop from crashing. But I don't really understand exactly why it works. All I had to do was move the l_setcfunction function calls in spell(lua_State *L) in the lspell.cxx file to outside of the conditional so it looks like this:

  if(luaL_newmetatable(L, "ta_spell")) {}
  l_setcfunction(L, -1, "add_dic", ls_adddic);
  l_setcfunction(L, -1, "spell", ls_spell);
  l_setcfunction(L, -1, "suggest", ls_suggest);
  l_setcfunction(L, -1, "add_word", ls_addword);
  lua_pushvalue(L, -1), lua_setfield(L, -2, "__index");

The only hint to why it was crashing was that gdb warning message, into which I looked a bit further. I discovered that the ?? might be refering to somewhere the shared library was located in memory before the reset(). I compared the output in gdb of 'info proc all' before a reset() and after a crash(can send a pic or text file comparing if you want). Based on it, I think sometimes, a pointer doesn't get changed to the new location, so it segfaults when trying to access the old location.

​Cordially,

James

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On May 10, 2018 9:53 AM, Mitchell <m.att.foicica.com> wrote:

> Hi James,
>
> On Wed, 9 May 2018, triplejam wrote:
>
> > I've tried my best to figure it out. Although compiling Hunspell gives more debugging info, the place where it segfaults still says ??. It's hard to trigger debugging too because it only seems to crash like a third or fourth of the times after I do reset(). The most helpful info I got sometimes is a warning message from gdb in after the reset() which says:
> >
> > Continuing.
> >
> > warning: Temporarily disabling breakpoints for unloade
> >
> > d shared library "/home/james/.textadept/modules/spell
> >
> > check/spell64.so"
> >
> > Then as soon as I save:
> >
> > Thread 1 "textadept" received signal SIGSEGV, Segmenta
> >
> > tion fault.
> >
> > 0x00007f649a004e66 in ?? ()
> >
> > And when it does work right those other times I can step through the lspell.cxx file and hunspell.
>
> Thanks for all of your time and patience looking into this.
>
> I have no idea why the backtrace is not identifying the spellcheck module or hunspell as the source of the crash. I'm beginning to question that it is. However, you said earlier you narrowed it down to a line of code in the spellcheck module.
>
> I'm afraid I do not know how to proceed :(
>
> Cheers,
>
> Mitchell
>
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> You are subscribed to code.att.foicica.com.
>
> To change subscription settings, send an e-mail to code+help.att.foicica.com.
>
> To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Thu 10 May 2018 - 13:53:57 EDT

This archive was generated by hypermail 2.2.0 : Fri 11 May 2018 - 06:25:45 EDT