bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] SIGSEGV in _rl_dispatch_callback()


From: Chet Ramey
Subject: Re: [Bug-readline] SIGSEGV in _rl_dispatch_callback()
Date: Mon, 10 Mar 2014 11:43:11 -0400

> So it is the exact place where python calls the readline function
> http://hg.python.org/cpython/file/7ff62415e426/Modules/readline.c#l1115
>  (the file in url points to 3.3.4 tag - it is where we see the crash).
> 
> 
> Here is output of rl_readline_state and _rl_kscxt variables.
> 
> 
> <PRESS UP>
> 
> (gdb) p *_rl_kscxt
> $10 = {flags = 0, subseq_arg = 0, subseq_retval = 0, dmap =
> 0x7fb38926ad20 <emacs_meta_keymap>,
>   oldmap = 0x7fb38926bd40 <emacs_standard_keymap>, okey = 27, ocxt =
> 0x0, childval = 42}
> p /x rl_readline_state
> $9 = 0x2c0006
> 
> <GDB CONTINUE>
> 
> p *_rl_kscxt
> $14 = {flags = 0, subseq_arg = 0, subseq_retval = 0, dmap = 0x1e5f9d0,
> oldmap = 0x7fb38926ad20 <emacs_meta_keymap>, okey = 91,
>   ocxt = 0x1e1e900, childval = -3}
> (gdb) p /x rl_readline_state
> $15 = 0x2c0006
> 
> <PRESS DOWN>
> 
> p *_rl_kscxt
> $16 = {flags = 1, subseq_arg = 0, subseq_retval = 0, dmap =
> 0x7fb38926ad20 <emacs_meta_keymap>,
>   oldmap = 0x7fb38926bd40 <emacs_standard_keymap>, okey = 27, ocxt =
> 0x0, childval = 1}
> (gdb) p /x rl_readline_state
> $17 = 0x2c0006

As you noted in a separate message, it's the "childval = 1" that causes
the problem here.  That causes r to be set to 1, the multikey state is
not reset, and we have the crash.

I know how and where to fix the crash, but I cannot for the life of me
get childval set to 1 here, no matter how I reproduce your steps, using
test programs.  It always ends up being set to 0, and I can't see a way
to force rl_get_next_history or rl_get_previous_history to return 1.

If you can do a little more debugging and figure out how childval gets
set to 1, I would appreciate it.  That should wrap it up.

Thanks for all your help so far.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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