Skip to content

Instantly share code, notes, and snippets.

@vbraun
Created January 25, 2013 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vbraun/4634931 to your computer and use it in GitHub Desktop.
Save vbraun/4634931 to your computer and use it in GitHub Desktop.
IPython crash log
***************************************************************************
IPython post-mortem report
{'commit_hash': '177894e',
'commit_source': 'installation',
'default_encoding': 'UTF-8',
'ipython_path': '/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/lib/python/site-packages/IPython',
'ipython_version': '0.13.1',
'os_name': 'posix',
'platform': 'SunOS-5.11-i86pc-i386-32bit-ELF',
'sys_executable': '/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/bin/python',
'sys_platform': 'sunos5',
'sys_version': '2.7.3 (default, Jan 25 2013, 07:44:36) \n[GCC 4.6.3]'}
***************************************************************************
***************************************************************************
Crash traceback:
---------------------------------------------------------------------------
OperationalErrorPython 2.7.3: /export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/bin/python
Fri Jan 25 14:02:02 2013
A problem occured executing Python code. Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.
/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/bin/sage-ipython in <module>()
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 """
4 Sage IPython startup script.
5 """
6 from sage.misc.interpreter import SageTerminalApp
7
8 # Make sure we're using the Sage profile if one isn't specified.
9 import sys
10 if '--profile' not in sys.argv:
11 sys.argv.extend(['--profile', 'sage'])
12
13 app = SageTerminalApp.instance()
---> 14 app.initialize()
global app.initialize = <bound method SageTerminalApp.initialize of <sage.misc.interpreter.SageTerminalApp object at 0x81691ac>>
15 app.start()
/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/lib/python/site-packages/IPython/frontend/terminal/ipapp.pyc in initialize(self=<sage.misc.interpreter.SageTerminalApp object>, argv=None)
/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/lib/python/site-packages/IPython/config/application.pyc in catch_config_error(method=<function initialize>, app=<sage.misc.interpreter.SageTerminalApp object>, *args=(None,), **kwargs={})
69
70 #-----------------------------------------------------------------------------
71 # Application class
72 #-----------------------------------------------------------------------------
73
74 @decorator
75 def catch_config_error(method, app, *args, **kwargs):
76 """Method decorator for catching invalid config (Trait/ArgumentErrors) during init.
77
78 On a TraitError (generally caused by bad config), this will print the trait's
79 message, and exit the app.
80
81 For use on init methods, to prevent invoking excepthook on invalid input.
82 """
83 try:
---> 84 return method(app, *args, **kwargs)
method = <function initialize at 0x87eda74>
app = <sage.misc.interpreter.SageTerminalApp object at 0x81691ac>
args = (None,)
kwargs = {}
85 except (TraitError, ArgumentError) as e:
86 app.print_description()
87 app.print_help()
88 app.print_examples()
89 app.log.fatal("Bad config encountered during initialization:")
90 app.log.fatal(str(e))
91 app.log.debug("Config at the time: %s", app.config)
92 app.exit(1)
93
94
95 class ApplicationError(Exception):
96 pass
97
98
99 class Application(SingletonConfigurable):
/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/lib/python/site-packages/IPython/frontend/terminal/ipapp.pyc in initialize(self=<sage.misc.interpreter.SageTerminalApp object>, argv=None)
309
310 @catch_config_error
311 def initialize(self, argv=None):
312 """Do actions after construct, but before starting the app."""
313 super(TerminalIPythonApp, self).initialize(argv)
314 if self.subapp is not None:
315 # don't bother initializing further, starting subapp
316 return
317 if not self.ignore_old_config:
318 check_for_old_config(self.ipython_dir)
319 # print self.extra_args
320 if self.extra_args and not self.something_to_run:
321 self.file_to_run = self.extra_args[0]
322 self.init_path()
323 # create the shell
--> 324 self.init_shell()
self.init_shell = <bound method SageTerminalApp.init_shell of <sage.misc.interpreter.SageTerminalApp object at 0x81691ac>>
325 # and draw the banner
326 self.init_banner()
327 # Now a variety of things that happen after the banner is printed.
328 self.init_gui_pylab()
329 self.init_extensions()
330 self.init_code()
331
332 def init_shell(self):
333 """initialize the InteractiveShell instance"""
334 # Create an InteractiveShell instance.
335 # shell.display_banner should always be False for the terminal
336 # based app, because we call shell.show_banner() by hand below
337 # so the banner shows *before* all extension loading stuff.
338 self.shell = TerminalInteractiveShell.instance(config=self.config,
339 display_banner=False, profile_dir=self.profile_dir,
/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/lib/python/site-packages/sage/misc/interpreter.pyc in init_shell(self=<sage.misc.interpreter.SageTerminalApp object>)
683 EXAMPLES::
684
685 sage: from sage.misc.interpreter import SageTerminalApp, DEFAULT_SAGE_CONFIG
686 sage: app = SageTerminalApp(config=DEFAULT_SAGE_CONFIG)
687 sage: app.initialize() #indirect doctest
688 sage: app.shell
689 <sage.misc.interpreter.SageInteractiveShell object at 0x...>
690 """
691 # We need verbose crashes for the Sage crash handler. We set it here
692 # so that we don't overwrite the traitlet attribute
693 self.verbose_crash = True
694
695 # Shell initialization
696 self.shell = SageInteractiveShell.instance(config=self.config,
697 display_banner=False, profile_dir=self.profile_dir,
--> 698 ipython_dir=self.ipython_dir)
global ipython_dir = undefined
self.ipython_dir = u'/export/home/buildbot/.sage/ipython-0.12'
699 self.shell.configurables.append(self)
700 self.shell.extension_manager.load_extension('sage.misc.sage_extension')
/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/lib/python/site-packages/IPython/config/configurable.pyc in instance(cls=<class 'sage.misc.interpreter.SageInteractiveShell'>, *args=(), **kwargs={'config': {'SageTerminalApp': {'profile': u'sage', 'force_...{'display_banner': False, 'verbose_crash': True}}, 'display_banner': False, 'ipython_dir': u'/export/home/buildbot/.sage/ipython-0.12', 'profile_dir': <IPython.core.profiledir.ProfileDir object>})
303 >>> class Foo(SingletonConfigurable): pass
304 >>> foo = Foo.instance()
305 >>> foo == Foo.instance()
306 True
307
308 Create a subclass that is retrived using the base class instance::
309
310 >>> class Bar(SingletonConfigurable): pass
311 >>> class Bam(Bar): pass
312 >>> bam = Bam.instance()
313 >>> bam == Bar.instance()
314 True
315 """
316 # Create and save the instance
317 if cls._instance is None:
--> 318 inst = cls(*args, **kwargs)
inst = undefined
cls = <class 'sage.misc.interpreter.SageInteractiveShell'>
args = ()
kwargs = {'ipython_dir': u'/export/home/buildbot/.sage/ipython-0.12', 'display_banner': False, 'config': {'SageTerminalApp': {'profile': u'sage', 'force_interact': True}, 'TerminalInteractiveShell': {'separate_in': '', 'ast_node_interactivity': 'all', 'colors': 'NoColor', 'confirm_exit': False}, 'ProfileDir': {}, 'PromptManager': {'out_template': '', 'in2_template': '....: ', 'in_template': 'sage: ', 'justify': False}, 'TerminalIPythonApp': {'display_banner': False, 'verbose_crash': True}}, 'profile_dir': <IPython.core.profiledir.ProfileDir object at 0x88244cc>}
319 # Now make sure that the instance will also be returned by
320 # parent classes' _instance attribute.
321 for subclass in cls._walk_mro():
322 subclass._instance = inst
323
324 if isinstance(cls._instance, cls):
325 return cls._instance
326 else:
327 raise MultipleInstanceError(
328 'Multiple incompatible subclass instances of '
329 '%s are being created.' % cls.__name__
330 )
331
332 @classmethod
333 def initialized(cls):
/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/lib/python/site-packages/IPython/frontend/terminal/interactiveshell.pyc in __init__(self=<sage.misc.interpreter.SageInteractiveShell object>, config={'SageTerminalApp': {'profile': u'sage', 'force_...{'display_banner': False, 'verbose_crash': True}}, ipython_dir=u'/export/home/buildbot/.sage/ipython-0.12', profile_dir=<IPython.core.profiledir.ProfileDir object>, user_ns=None, user_module=None, custom_exceptions=((), None), usage=None, banner1=None, banner2=None, display_banner=False)
345 )
346 term_title = CBool(False, config=True,
347 help="Enable auto setting the terminal title."
348 )
349
350 # In the terminal, GUI control is done via PyOS_InputHook
351 from IPython.lib.inputhook import enable_gui
352 enable_gui = staticmethod(enable_gui)
353
354 def __init__(self, config=None, ipython_dir=None, profile_dir=None,
355 user_ns=None, user_module=None, custom_exceptions=((),None),
356 usage=None, banner1=None, banner2=None, display_banner=None):
357
358 super(TerminalInteractiveShell, self).__init__(
359 config=config, profile_dir=profile_dir, user_ns=user_ns,
--> 360 user_module=user_module, custom_exceptions=custom_exceptions
user_module = None
custom_exceptions = ((), None)
361 )
362 # use os.system instead of utils.process.system by default,
363 # because piped system doesn't make sense in the Terminal:
364 self.system = self.system_raw
365
366 self.init_term_title()
367 self.init_usage(usage)
368 self.init_banner(banner1, banner2, display_banner)
369
370 #-------------------------------------------------------------------------
371 # Things related to the terminal
372 #-------------------------------------------------------------------------
373
374 @property
375 def usable_screen_length(self):
/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/lib/python/site-packages/IPython/core/interactiveshell.pyc in __init__(self=<sage.misc.interpreter.SageInteractiveShell object>, config={'SageTerminalApp': {'profile': u'sage', 'force_...{'display_banner': False, 'verbose_crash': True}}, ipython_dir=None, profile_dir=<IPython.core.profiledir.ProfileDir object>, user_module=None, user_ns=None, custom_exceptions=((), None))
421 self.init_create_namespaces(user_module, user_ns)
422 # This has to be done after init_create_namespaces because it uses
423 # something in self.user_ns, but before init_sys_modules, which
424 # is the first thing to modify sys.
425 # TODO: When we override sys.stdout and sys.stderr before this class
426 # is created, we are saving the overridden ones here. Not sure if this
427 # is what we want to do.
428 self.save_sys_module_state()
429 self.init_sys_modules()
430
431 # While we're trying to have each part of the code directly access what
432 # it needs without keeping redundant references to objects, we have too
433 # much legacy code that expects ip.db to exist.
434 self.db = PickleShareDB(os.path.join(self.profile_dir.location, 'db'))
435
--> 436 self.init_history()
self.init_history = <bound method SageInteractiveShell.init_history of <sage.misc.interpreter.SageInteractiveShell object at 0x8824c8c>>
437 self.init_encoding()
438 self.init_prefilter()
439
440 self.init_syntax_highlighting()
441 self.init_hooks()
442 self.init_pushd_popd_magic()
443 # self.init_traceback_handlers use to be here, but we moved it below
444 # because it and init_io have to come after init_readline.
445 self.init_user_ns()
446 self.init_logger()
447 self.init_alias()
448 self.init_builtins()
449
450 # The following was in post_config_initialization
451 self.init_inspector()
/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/lib/python/site-packages/IPython/core/interactiveshell.pyc in init_history(self=<sage.misc.interpreter.SageInteractiveShell object>)
1474 with self.builtin_trap:
1475 info = self._object_find(oname)
1476 if info.found:
1477 return self.inspector.info(info.obj, oname, info=info,
1478 detail_level=detail_level
1479 )
1480 else:
1481 return oinspect.object_info(name=oname, found=False)
1482
1483 #-------------------------------------------------------------------------
1484 # Things related to history management
1485 #-------------------------------------------------------------------------
1486
1487 def init_history(self):
1488 """Sets up the command history, and starts regular autosaves."""
-> 1489 self.history_manager = HistoryManager(shell=self, config=self.config)
self.history_manager = None
global HistoryManager = <class 'IPython.core.history.HistoryManager'>
global shell = undefined
self = <sage.misc.interpreter.SageInteractiveShell object at 0x8824c8c>
global config = undefined
self.config = {'SageTerminalApp': {'profile': u'sage', 'force_interact': True}, 'TerminalInteractiveShell': {'separate_in': '', 'ast_node_interactivity': 'all', 'colors': 'NoColor', 'confirm_exit': False}, 'ProfileDir': {}, 'PromptManager': {'out_template': '', 'in2_template': '....: ', 'in_template': 'sage: ', 'justify': False}, 'TerminalIPythonApp': {'display_banner': False, 'verbose_crash': True}}
1490 self.configurables.append(self.history_manager)
1491
1492 #-------------------------------------------------------------------------
1493 # Things related to exception handling and tracebacks (not debugging)
1494 #-------------------------------------------------------------------------
1495
1496 def init_traceback_handlers(self, custom_exceptions):
1497 # Syntax error handler.
1498 self.SyntaxTB = ultratb.SyntaxTB(color_scheme='NoColor')
1499
1500 # The interactive one is initialized with an offset, meaning we always
1501 # want to remove the topmost item in the traceback, which is our own
1502 # internal code. Valid modes: ['Plain','Context','Verbose']
1503 self.InteractiveTB = ultratb.AutoFormattedTB(mode = 'Plain',
1504 color_scheme='NoColor',
/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/lib/python/site-packages/IPython/core/history.pyc in __init__(self=<IPython.core.history.HistoryManager object>, shell=<sage.misc.interpreter.SageInteractiveShell object>, config={'SageTerminalApp': {'profile': u'sage', 'force_...{'display_banner': False, 'verbose_crash': True}}, **traits={})
457 _exit_re = re.compile(r"(exit|quit)(\s*\(.*\))?$")
458
459 def __init__(self, shell=None, config=None, **traits):
460 """Create a new history manager associated with a shell instance.
461 """
462 # We need a pointer back to the shell for various tasks.
463 super(HistoryManager, self).__init__(shell=shell, config=config,
464 **traits)
465 self.save_flag = threading.Event()
466 self.db_input_cache_lock = threading.Lock()
467 self.db_output_cache_lock = threading.Lock()
468 if self.enabled and self.hist_file != ':memory:':
469 self.save_thread = HistorySavingThread(self)
470 self.save_thread.start()
471
--> 472 self.new_session()
self.new_session = <bound method HistoryManager.new_session of <IPython.core.history.HistoryManager object at 0x882980c>>
473
474 def _get_hist_file_name(self, profile=None):
475 """Get default history file name based on the Shell's profile.
476
477 The profile parameter is ignored, but must exist for compatibility with
478 the parent class."""
479 profile_dir = self.shell.profile_dir.location
480 return os.path.join(profile_dir, 'history.sqlite')
481
482 @needs_sqlite
483 def new_session(self, conn=None):
484 """Get a new session number."""
485 if conn is None:
486 conn = self.db
487
/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/lib/python/site-packages/IPython/core/history.pyc in new_session(self=<IPython.core.history.HistoryManager object>, conn=None)
/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/lib/python/site-packages/IPython/core/history.pyc in needs_sqlite(f=<function new_session>, self=<IPython.core.history.HistoryManager object>, *a=(None,), **kw={})
47 pass
48
49 def __enter__(self, *args, **kwargs):
50 pass
51
52 def __exit__(self, *args, **kwargs):
53 pass
54
55
56 @decorator
57 def needs_sqlite(f, self, *a, **kw):
58 """return an empty list in the absence of sqlite"""
59 if sqlite3 is None or not self.enabled:
60 return []
61 else:
---> 62 return f(self, *a, **kw)
f = <function new_session at 0x86dfe64>
self = <IPython.core.history.HistoryManager object at 0x882980c>
a = (None,)
kw = {}
63
64
65 if sqlite3 is not None:
66 DatabaseError = sqlite3.DatabaseError
67 else:
68 class DatabaseError(Exception):
69 "Dummy exception when sqlite could not be imported. Should never occur."
70
71 @decorator
72 def catch_corrupt_db(f, self, *a, **kw):
73 """A decorator which wraps HistoryAccessor method calls to catch errors from
74 a corrupt SQLite database, move the old database out of the way, and create
75 a new one.
76 """
77 try:
/export/home/buildbot/build/sage/hawk-1/hawk_suncc/build/sage-5.7.beta1/local/lib/python/site-packages/IPython/core/history.pyc in new_session(self=<IPython.core.history.HistoryManager object>, conn=<sqlite3.Connection object>)
476
477 The profile parameter is ignored, but must exist for compatibility with
478 the parent class."""
479 profile_dir = self.shell.profile_dir.location
480 return os.path.join(profile_dir, 'history.sqlite')
481
482 @needs_sqlite
483 def new_session(self, conn=None):
484 """Get a new session number."""
485 if conn is None:
486 conn = self.db
487
488 with conn:
489 cur = conn.execute("""INSERT INTO sessions VALUES (NULL, ?, NULL,
490 NULL, "") """, (datetime.datetime.now(),))
--> 491 self.session_number = cur.lastrowid
self.session_number = 4
cur.lastrowid = 4
492
493 def end_session(self):
494 """Close the database session, filling in the end time and line count."""
495 self.writeout_cache()
496 with self.db:
497 self.db.execute("""UPDATE sessions SET end=?, num_cmds=? WHERE
498 session==?""", (datetime.datetime.now(),
499 len(self.input_hist_parsed)-1, self.session_number))
500 self.session_number = 0
501
502 def name_session(self, name):
503 """Give the current session a name in the history database."""
504 with self.db:
505 self.db.execute("UPDATE sessions SET remark=? WHERE session==?",
506 (name, self.session_number))
OperationalError: database is locked
***************************************************************************
History of session input:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment