octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #57234] 'dbquit' in graphics system callback f


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #57234] 'dbquit' in graphics system callback function can cause segfault
Date: Thu, 19 Dec 2019 12:44:18 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Follow-up Comment #15, bug #57234 (project octave):

I think I can prevent the crash, but properly handling input inside a callback
function is going to be difficult.

As far as I can tell, calling readline recursively is not going to work. 
Looking at the code in main_window::run_file_in_terminal, it seems that
someone must have already recognized this problem.  There, an attempt is made
to jump out of the readline input loop and execute code as a function call,
followed by restoring any pending input the next time readline is called.  But
even that is only a partial solution since the internal readline state won't
be saved and restored properly if it is called again for a separate input
sequence (debugging vs. the normal command prompt).  There are functions in
readline for saving and restoring part of the internal state (rl_save_state
and rl_restore_state) but they appear to be incomplete and not fully
functional.

I just don't see a way to fix this problem without fixing readline so that
multiple instances can be created and used simultaneously.  Then the debugger
(or anything that wants to get user input) could create a new readline object,
use that, and then restore/redisplay the previous readline prompt when
finished.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57234>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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