~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/crash.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-10-07 12:45:51 UTC
  • mfrom: (5459.4.1 561061-ssh-protocol)
  • Revision ID: pqm@pqm.ubuntu.com-20101007124551-zfqhlkqdegiy7otp
(vila) Don't force openssh to use protocol=2 (Neil Martinsen-Burrell)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
A crash is an exception propagated up almost to the top level of Bazaar.
21
21
 
22
22
If we have apport <https://launchpad.net/apport/>, we store a report of the
23
 
crash using apport into it's /var/crash spool directory, from where the user
 
23
crash using apport into its /var/crash spool directory, from where the user
24
24
can either manually send it to Launchpad.  In some cases (at least Ubuntu
25
25
development releases), Apport may pop up a window asking if they want
26
26
to send it.
33
33
In principle apport can run on any platform though as of Feb 2010 there seem
34
34
to be some portability bugs.
35
35
 
36
 
To force this off in bzr turn set APPORT_DISBLE in the environment or 
 
36
To force this off in bzr turn set APPORT_DISABLE in the environment or 
37
37
-Dno_apport.
38
38
"""
39
39
 
143
143
    exc_type, exc_object, exc_tb = exc_info
144
144
 
145
145
    pr = Report()
146
 
    # add_proc_info gets the executable and interpreter path, which is needed,
147
 
    # plus some less useful stuff like the memory map
 
146
    # add_proc_info gives you the memory map of the process, which is not so
 
147
    # useful for Bazaar but does tell you what binary libraries are loaded.
 
148
    # More importantly it sets the ExecutablePath, InterpreterPath, etc.
148
149
    pr.add_proc_info()
149
150
    pr.add_user_info()
150
151
 
165
166
    pr['PythonLoadedModules'] = _format_module_list()
166
167
    pr['BzrDebugFlags'] = pprint.pformat(debug.debug_flags)
167
168
 
 
169
    # actually we'd rather file directly against the upstream product, but
 
170
    # apport does seem to count on there being one in there; we might need to
 
171
    # redirect it elsewhere anyhow
 
172
    pr['SourcePackage'] = 'bzr'
 
173
    pr['Package'] = 'bzr'
 
174
 
 
175
    # tell apport to file directly against the bzr package using 
 
176
    # <https://bugs.launchpad.net/bzr/+bug/391015>
 
177
    #
 
178
    # XXX: unfortunately apport may crash later if the crashdb definition
 
179
    # file isn't present
 
180
    pr['CrashDb'] = 'bzr'
 
181
 
168
182
    tb_file = StringIO()
169
183
    traceback.print_exception(exc_type, exc_object, exc_tb, file=tb_file)
170
184
    pr['Traceback'] = tb_file.getvalue()