Dear All,
it seems that the ticket #21670 recently merged into develop makes sage crash on my machine, can anyone replicate this?
In a new xterm run this:

$ echo "a = 1" > /tmp/test.py
$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 7.4.rc2, Release Date: 2016-10-15                 │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage:

now resize the xterm, everything works as it is supposed to.
now attach /tmp/test.py and again resize the window. I get this:

sage: %attach /tmp/prova.py
sage:
**********************************************************************

Oops, Sage crashed. We do our best to make it stable, but...

A crash report was automatically generated with the following information:
 - A verbatim copy of the crash traceback.
 - A copy of your input history during this session.
 - Data on your current Sage configuration.

It was left in the file named:
       '/home/VulK/.sage/ipython-5.0.0/Sage_crash_report.txt'
If you can email this file to the developers, the information in it will help
them in understanding and correcting the problem.

You can mail it to: sage-support at sage-supp...@googlegroups.com
with the subject 'Sage Crash Report'.

If you want to do it now, the following command will work (under Unix):
mail -s 'Sage Crash Report' sage-supp...@googlegroups.com < 
/home/VulK/.sage/ipython-5.0.0/Sage_crash_report.txt

To ensure accurate tracking of this issue, please file a report about it at:
http://trac.sagemath.org

Hit <Enter> to quit (your terminal may close):



I attached to this e-mail the crash report.

Best
S.

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.
***************************************************************************

IPython post-mortem report

{'commit_hash': u'1ba246d',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/mnt/sage/local/lib/python2.7/site-packages/IPython',
 'ipython_version': '5.0.0',
 'os_name': 'posix',
 'platform': 
'Linux-4.1.12-gentoo-x86_64-Intel-R-_Core-TM-_i7-5600U_CPU_@_2.60GHz-with-gentoo-2.2',
 'sys_executable': '/mnt/sage/local/bin/python',
 'sys_platform': 'linux2',
 'sys_version': '2.7.10 (default, Oct 15 2016, 20:24:20) \n[GCC 4.9.3]'}

***************************************************************************



***************************************************************************

Crash traceback:

---------------------------------------------------------------------------
---------------------------------------------------------------------------
error                             Python 2.7.10: /mnt/sage/local/bin/python
                                                   Sat Oct 15 22:13:36 2016
A problem occurred executing Python code.  Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.
/mnt/sage/src/bin/sage-ipython in <module>()
      1 #!/usr/bin/env python
      2 # -*- coding: utf-8 -*-
      3 """
      4 Sage IPython startup script.
      5 """
      6 
      7 from sage.repl.interpreter import SageTerminalApp
      8 
      9 app = SageTerminalApp.instance()
     10 app.initialize()
---> 11 app.start()
        global app.start = <bound method SageTerminalApp.start of 
<sage.repl.interpreter.SageTerminalApp object at 0x7f47960c58d0>>

/mnt/sage/local/lib/python2.7/site-packages/IPython/terminal/ipapp.pyc in 
start(self=<sage.repl.interpreter.SageTerminalApp object>)
    333         if self.log_level <= logging.INFO: print()
    334 
    335     def _pylab_changed(self, name, old, new):
    336         """Replace --pylab='inline' with --pylab='auto'"""
    337         if new == 'inline':
    338             warnings.warn("'inline' not available as pylab backend, "
    339                       "using 'auto' instead.")
    340             self.pylab = 'auto'
    341 
    342     def start(self):
    343         if self.subapp is not None:
    344             return self.subapp.start()
    345         # perform any prexec steps:
    346         if self.interact:
    347             self.log.debug("Starting IPython's mainloop...")
--> 348             self.shell.mainloop()
        self.shell.mainloop = <bound method 
SageTerminalInteractiveShell.mainloop of 
<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f478e3e9d10>>
    349         else:
    350             self.log.debug("IPython not interactive...")
    351 
    352 def load_default_config(ipython_dir=None):
    353     """Load the default config file from the default ipython_dir.
    354 
    355     This is useful for embedded shells.
    356     """
    357     if ipython_dir is None:
    358         ipython_dir = get_ipython_dir()
    359 
    360     profile_dir = os.path.join(ipython_dir, 'profile_default')
    361 
    362     config = Config()
    363     for cf in Application._load_config_files("ipython_config", 
path=profile_dir):

/mnt/sage/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc
 in mainloop(self=<sage.repl.interpreter.SageTerminalInteractiveShell object>, 
display_banner=<object object>)
    387                 if (not self.confirm_exit) \
    388                         or self.ask_yes_no('Do you really want to exit 
([y]/n)?','y','n'):
    389                     self.ask_exit()
    390 
    391             else:
    392                 if code:
    393                     self.run_cell(code, store_history=True)
    394 
    395     def mainloop(self, display_banner=DISPLAY_BANNER_DEPRECATED):
    396         # An extra layer of protection in case someone mashing Ctrl-C 
breaks
    397         # out of our internal code.
    398         if display_banner is not DISPLAY_BANNER_DEPRECATED:
    399             warn('mainloop `display_banner` argument is deprecated 
since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, 
stacklevel=2)
    400         while True:
    401             try:
--> 402                 self.interact()
        self.interact = <bound method SageTerminalInteractiveShell.interact of 
<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f478e3e9d10>>
    403                 break
    404             except KeyboardInterrupt:
    405                 print("\nKeyboardInterrupt escaped interact()\n")
    406         
    407         if hasattr(self, '_eventloop'):
    408             self._eventloop.close()
    409 
    410     _inputhook = None
    411     def inputhook(self, context):
    412         if self._inputhook is not None:
    413             self._inputhook(context)
    414 
    415     def enable_gui(self, gui=None):
    416         if gui:
    417             self._inputhook = get_inputhook_func(gui)

/mnt/sage/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc
 in interact(self=<sage.repl.interpreter.SageTerminalInteractiveShell object>, 
display_banner=<object object>)
    370 
    371     def pre_prompt(self):
    372         if self.rl_next_input:
    373             self.pt_cli.application.buffer.text = 
cast_unicode_py2(self.rl_next_input)
    374             self.rl_next_input = None
    375 
    376     def interact(self, display_banner=DISPLAY_BANNER_DEPRECATED):
    377 
    378         if display_banner is not DISPLAY_BANNER_DEPRECATED:
    379             warn('interact `display_banner` argument is deprecated 
since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, 
stacklevel=2)
    380 
    381         while self.keep_running:
    382             print(self.separate_in, end='')
    383 
    384             try:
--> 385                 code = self.prompt_for_code()
        code = u'%attach /tmp/prova.py'
        self.prompt_for_code = <bound method 
SageTerminalInteractiveShell.prompt_for_code of 
<sage.repl.interpreter.SageTerminalInteractiveShell object at 0x7f478e3e9d10>>
    386             except EOFError:
    387                 if (not self.confirm_exit) \
    388                         or self.ask_yes_no('Do you really want to exit 
([y]/n)?','y','n'):
    389                     self.ask_exit()
    390 
    391             else:
    392                 if code:
    393                     self.run_cell(code, store_history=True)
    394 
    395     def mainloop(self, display_banner=DISPLAY_BANNER_DEPRECATED):
    396         # An extra layer of protection in case someone mashing Ctrl-C 
breaks
    397         # out of our internal code.
    398         if display_banner is not DISPLAY_BANNER_DEPRECATED:
    399             warn('mainloop `display_banner` argument is deprecated 
since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, 
stacklevel=2)
    400         while True:

/mnt/sage/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc
 in prompt_for_code(self=<sage.repl.interpreter.SageTerminalInteractiveShell 
object>)
    306                         
processor=HighlightMatchingBracketProcessor(chars='[](){}'),
    307                         filter=HasFocus(DEFAULT_BUFFER) & ~IsDone() &
    308                             Condition(lambda cli: 
self.highlight_matching_brackets))],
    309                 }
    310 
    311     def _update_layout(self):
    312         """
    313         Ask for a re computation of the application layout, if for 
example ,
    314         some configuration options have changed.
    315         """
    316         if self._pt_app:
    317             self._pt_app.layout = 
create_prompt_layout(**self._layout_options())
    318 
    319     def prompt_for_code(self):
    320         document = self.pt_cli.run(
--> 321             pre_run=self.pre_prompt, reset_current_buffer=True)
        global pre_run = undefined
        self.pre_prompt = <bound method SageTerminalInteractiveShell.pre_prompt 
of <sage.repl.interpreter.SageTerminalInteractiveShell object at 
0x7f478e3e9d10>>
        global reset_current_buffer = undefined
        global True = undefined
    322         return document.text
    323 
    324     def init_io(self):
    325         if sys.platform not in {'win32', 'cli'}:
    326             return
    327 
    328         import win_unicode_console
    329         import colorama
    330 
    331         win_unicode_console.enable()
    332         colorama.init()
    333 
    334         # For some reason we make these wrappers around stdout/stderr.
    335         # For now, we need to reset them so all output gets coloured.
    336         # https://github.com/ipython/ipython/issues/8669

/mnt/sage/local/lib/python2.7/site-packages/prompt_toolkit/interface.pyc in 
run(self=<prompt_toolkit.interface.CommandLineInterface object>, 
reset_current_buffer=True, pre_run=<bound method 
SageTerminalInteractiveShell.pre_p...interpreter.SageTerminalInteractiveShell 
object>>)
    374         try:
    375             self._is_running = True
    376 
    377             self.on_start.fire()
    378             self.reset(reset_current_buffer=reset_current_buffer)
    379 
    380             # Call pre_run.
    381             if pre_run:
    382                 pre_run()
    383 
    384             # Run eventloop in raw mode.
    385             with self.input.raw_mode():
    386                 self.renderer.request_absolute_cursor_position()
    387                 self._redraw()
    388 
--> 389                 self.eventloop.run(self.input, 
self.create_eventloop_callbacks())
        self.eventloop.run = <bound method PosixEventLoop.run of 
<prompt_toolkit.eventloop.posix.PosixEventLoop object at 0x7f4793360250>>
        self.input = StdinInput(stdin=<open file '<stdin>', mode 'r' at 
0x7f47961bd0c0>)
        self.create_eventloop_callbacks = <bound method 
CommandLineInterface.create_eventloop_callbacks of 
<prompt_toolkit.interface.CommandLineInterface object at 0x7f4793368190>>
    390         finally:
    391             # Clean up renderer. (This will leave the alternate screen, 
if we use
    392             # that.)
    393 
    394             # If exit/abort haven't been called set, but another 
exception was
    395             # thrown instead for some reason, make sure that we redraw 
in exit
    396             # mode.
    397             if not self.is_done:
    398                 self._exit_flag = True
    399                 self._redraw()
    400 
    401             self.renderer.reset()
    402             self.on_stop.fire()
    403             self._is_running = False
    404 

/mnt/sage/local/lib/python2.7/site-packages/prompt_toolkit/eventloop/posix.pyc 
in run(self=<prompt_toolkit.eventloop.posix.PosixEventLoop object>, 
stdin=StdinInput(stdin=<open file '<stdin>', mode 'r' at 0x7f47961bd0c0>), 
callbacks=<prompt_toolkit.interface._InterfaceEventLoopCallbacks object>)
     87             # Quit when the input stream was closed.
     88             if stdin_reader.closed:
     89                 self.stop()
     90 
     91         self.add_reader(stdin, read_from_stdin)
     92         self.add_reader(self._schedule_pipe[0], None)
     93 
     94         with ctx:
     95             while self._running:
     96                 # Call inputhook.
     97                 with TimeIt() as inputhook_timer:
     98                     if self._inputhook_context:
     99                         def ready(wait):
    100                             " True when there is input ready. The 
inputhook should return control. "
    101                             return 
self._ready_for_reading(current_timeout[0] if wait else 0) != []
--> 102                         self._inputhook_context.call_inputhook(ready)
        self._inputhook_context.call_inputhook = <bound method 
InputHookContext.call_inputhook of 
<prompt_toolkit.eventloop.inputhook.InputHookContext object at 0x7f47933606d0>>
        ready = <function ready at 0x7f4793367e60>
    103 
    104                 # Calculate remaining timeout. (The inputhook consumed 
some of the time.)
    105                 if current_timeout[0] is None:
    106                     remaining_timeout = None
    107                 else:
    108                     remaining_timeout = max(0, current_timeout[0] - 
inputhook_timer.duration)
    109 
    110                 # Wait until input is ready.
    111                 fds = self._ready_for_reading(remaining_timeout)
    112 
    113                 # When any of the FDs are ready. Call the appropriate 
callback.
    114                 if fds:
    115                     # Create lists of high/low priority tasks. The main 
reason
    116                     # for this is to allow painting the UI to happen as 
soon as
    117                     # possible, but when there are many events 
happening, we

/mnt/sage/local/lib/python2.7/site-packages/prompt_toolkit/eventloop/inputhook.pyc
 in call_inputhook(self=<prompt_toolkit.eventloop.inputhook.InputHookContext 
object>, input_is_ready_func=<function ready>)
     57 
     58     def call_inputhook(self, input_is_ready_func):
     59         """
     60         Call the inputhook. (Called by a prompt-toolkit eventloop.)
     61         """
     62         self._input_is_ready = input_is_ready_func
     63 
     64         # Start thread that activates this pipe when there is input to 
process.
     65         def thread():
     66             input_is_ready_func(wait=True)
     67             os.write(self._w, b'x')
     68 
     69         threading.Thread(target=thread).start()
     70 
     71         # Call inputhook.
---> 72         self.inputhook(self)
        self.inputhook = <bound method SageTerminalInteractiveShell.inputhook 
of <sage.repl.interpreter.SageTerminalInteractiveShell object at 
0x7f478e3e9d10>>
        self = <prompt_toolkit.eventloop.inputhook.InputHookContext object at 
0x7f47933606d0>
     73 
     74         # Flush the read end of the pipe.
     75         try:
     76             os.read(self._r, 1024)
     77         except OSError:
     78             # This happens when the window resizes and a SIGWINCH was 
received.
     79             # We get 'Error: [Errno 4] Interrupted system call'
     80             # Just ignore.
     81             pass
     82         self._input_is_ready = None
     83 
     84     def close(self):
     85         """
     86         Clean up resources.
     87         """

/mnt/sage/local/lib/python2.7/site-packages/IPython/terminal/interactiveshell.pyc
 in inputhook(self=<sage.repl.interpreter.SageTerminalInteractiveShell object>, 
context=<prompt_toolkit.eventloop.inputhook.InputHookContext object>)
    398         if display_banner is not DISPLAY_BANNER_DEPRECATED:
    399             warn('mainloop `display_banner` argument is deprecated 
since IPython 5.0. Call `show_banner()` if needed.', DeprecationWarning, 
stacklevel=2)
    400         while True:
    401             try:
    402                 self.interact()
    403                 break
    404             except KeyboardInterrupt:
    405                 print("\nKeyboardInterrupt escaped interact()\n")
    406         
    407         if hasattr(self, '_eventloop'):
    408             self._eventloop.close()
    409 
    410     _inputhook = None
    411     def inputhook(self, context):
    412         if self._inputhook is not None:
--> 413             self._inputhook(context)
        self._inputhook = <function sage_inputhook at 0x7f44ad833ed8>
        context = <prompt_toolkit.eventloop.inputhook.InputHookContext object 
at 0x7f47933606d0>
    414 
    415     def enable_gui(self, gui=None):
    416         if gui:
    417             self._inputhook = get_inputhook_func(gui)
    418         else:
    419             self._inputhook = None
    420 
    421     # Run !system commands directly, not through pipes, so terminal 
programs
    422     # work correctly.
    423     system = InteractiveShell.system_raw
    424 
    425     def auto_rewrite_input(self, cmd):
    426         """Overridden from the parent class to use fancy rewriting 
prompt"""
    427         if not self.show_rewritten_input:
    428             return

/mnt/sage/local/lib/python2.7/site-packages/sage/repl/inputhook.pyc in 
sage_inputhook(context=<prompt_toolkit.eventloop.inputhook.InputHookContext 
object>)
     19 import select
     20 
     21 from IPython import get_ipython
     22 from IPython.terminal.pt_inputhooks import register
     23 
     24 import sage.repl.attach
     25 
     26 
     27 TIMEOUT = 0.25   # seconds
     28 
     29 
     30 def sage_inputhook(context):
     31     f = context.fileno()
     32     while True:
     33         sage.repl.attach.reload_attached_files_if_modified()
---> 34         r, w, e = select.select([f], [], [], TIMEOUT)
        r = []
        w = []
        e = []
        global select.select = <built-in function select>
        f = 8
        global TIMEOUT = 0.25
     35         if f in r:
     36             return  # IPython signalled us to stop
     37 
     38 
     39 register('sage', sage_inputhook)
     40 
     41 
     42 def install():
     43     """
     44     Install the Sage input hook
     45 
     46     EXAMPLES::
     47 
     48         sage: from sage.repl.inputhook import install
     49         sage: install()

error: (4, 'Interrupted system call')

***************************************************************************

History of session input:get_ipython().magic(u'attach /tmp/prova.py')
*** Last line of input (may not be in above history):
get_ipython().magic(u'attach /tmp/prova.py')

Reply via email to