[code] [textadept] LexerLPeg's references to Scintilla?

From: Chris Emerson <c-ta.att.mail.nosreme.org>
Date: Fri, 6 Sep 2013 23:11:57 +0100

Hi,

I have a repeatable crash in my modified textadept where I've implemented
split views for curses (https://bitbucket.org/jugglerchris/textadept/).
It's almost certainly something I'm doing wrong!

The sequence to reproduce (on my modified textadept-curses) are:

1. textadept-curses init.lua -- any file which triggers a lexer, I think
2. view:split()
3. gui.goto_view(1) -- switch to the other view
4. view:unsplit() -- back to one view
5. view:split() -- bang!

The immediate cause is that something's happening to a LexerLPeg object which
has a reference to the Scintilla object deleted in step 4 above. The top of
the callstack is as follows (after that are quite a lot of Lua frames):
 
#0 0x000000000046ace3 in scintilla_send_message (sci=0xbcc7d0, iMessage=2051, wParam=13, lParam=32896) at scintilla/term/ScintillaTerm.cxx:1053
#1 0x000000000046d8aa in LexerLPeg::SetStyle (this=0xbf07d0, num=13, style=<value optimized out>) at LexLPeg.cxx:222
#2 0x000000000046f3a9 in LexerLPeg::PropertySet (this=0xbf07d0, key=<value optimized out>, value=<value optimized out>) at LexLPeg.cxx:583
#3 0x00000000004601ff in LexState::PropSet (this=0xa7b580, key=0x8884a8 "style.class", val=0xdbb2e8 "fore:%(color.yellow)") at scintilla/src/ScintillaBase.cxx:634
#4 0x0000000000462721 in ScintillaBase::WndProc (this=0xd97ab0, iMessage=<value optimized out>, wParam=8946856, lParam=14398184) at scintilla/src/ScintillaBase.cxx:931
#5 0x000000000046b8b1 in ScintillaTerm::WndProc (this=<value optimized out>, iMessage=<value optimized out>, wParam=<value optimized out>, lParam=<value optimized out>) at scintilla/term/ScintillaTerm.cxx:854
#6 0x000000000046ace9 in scintilla_send_message (sci=<value optimized out>, iMessage=<value optimized out>, wParam=<value optimized out>, lParam=<value optimized out>) at scintilla/term/ScintillaTerm.cxx:1053
#7 0x000000000047021f in l_callscintilla (L=0x7003f0, msg=4004, wtype=7, ltype=7, rtype=0, arg=4) at textadept.c:1248
#8 0x0000000000471e03 in lbuf_property (L=0x7003f0) at textadept.c:1315
#9 0x000000000047c5d7 in luaD_precall (L=0x7003f0, func=0xe6ed20, nresults=0) at lua/src/ldo.c:318
[...]

I haven't got my head around what the relationship between ScintillaTerms and
the LexerLPeg objects is supposed to be, so any pointers would be helpful.

Also, are there any tips for getting a Lua stack trace from inside gdb? That
would help me to understand a bit more about what's going on.
  
Regards,

Chris

-- 
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 Fri 06 Sep 2013 - 18:11:57 EDT

This archive was generated by hypermail 2.2.0 : Sat 07 Sep 2013 - 06:54:48 EDT