Sat 30 Sep 2017 05:03:27 PM UTC, comment #2:
I can't repeat that here, but that doesn't mean this isn't an Octave bug.
The error message you are seeing originates from GNU readline, so I doubt you would have a chance to use the debugger to much effect unless readline were built with debug info. Since I can't replicate the crash and get the message, I'm not 100% sure which readline is being used on my system (5.2 or 6.3):
If Octave ends up using 6.3, perhaps that is more robust to this situation.
My thinking is this could be a simple one or two line change.
First hypothesis
----------------
The readline library needs to be initialized with using_history():
https://tiswww.case.edu/php/chet/readline/history.html#SEC10
and one line of thought is that without an .octave_hist file present, perhaps Octave is inadvertently skipping the call to using_history() such that readline's innards aren't properly initialized when the up-arrow initiates a fetch from readline's symbol list.
However, it's strange that only such an error would occur after a Cntrl-C rather than an up-arrow immediately upon launch. What is it about Cntrl-C that would affect the history list internal to GNU readline? Is Cntrl-C removing a command from the list?
OK, I don't think it is an initialization issue. I've printed out a comment at every location there is a using_history() [why it appears so often, I don't know]:
So, using_history() does get called.
Second hypothesis
-----------------
Given that the error is occurring in readline, it must be readline's use of history, for which prev-history (up arrow) is described here
http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC15
Could it be that SIGINT handling is doing something strange?
http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC44
"
When a SIGINT is received, the Readline signal handler performs some additional work, which will cause any partially-entered line to be aborted (see the description of rl_free_line_state() below).
"
That would seem like a bug in library readline, wouldn't it?
Could you try the following?
Are you ever seeing a crash in that case?
|