[MERGE] use apport to get richer detail in bug reports.

Robert Collins robertc at robertcollins.net
Wed Nov 8 05:28:29 GMT 2006


On Wed, 2006-11-08 at 15:22 +1100, Martin Pool wrote:

> Ok, +1.

Thanks. If its ok as-is, I'll merge it with a bug report to do more
later - mid-sprint is not a good time for extensive hacking.

> > When apport is not present, the old interface is used. I think it would
> > be a good idea to change that to a file-writing interface as well, but
> > wasn't sure if that would get universal agreement or not ;).
> 
> Ok with me as long as -Derror still sends them to stderr.

What is 'them' here ? The backtrace ?
Should -Derror disable the apport usage ? (which it can do by setting
bzrlib.trace._use_apport to False).

> >  # configure convenient aliases for output routines
> > @@ -279,7 +281,7 @@
> >          # specific, but there are too many cases at the moment.
> >          report_user_error(exc_info, err_file)
> >      else:
> > -        report_bug(exc_info, err_file)
> > +        return report_bug(exc_info, err_file)
> 
> This now returns two values if it's a bug but none otherwise, which
> seems hard on callers who want to unpack the result...

It only returns the tuple for testing, so I'm inclined to say 'meh.'. We
can always change it later.

> > +    exc_type, exc_object, exc_tb = exc_info
> > +    err_file.write(
> > +        "bzr: ERROR: %s.%s: %s\n" % (
> > +        exc_type.__module__, exc_type.__name__, exc_object)
> > +        )
> > +    report = problem_report.ProblemReport()
> > +    report_file, report_filename = tempfile.mkstemp(
> > +        suffix='.txt', prefix='bzr-crash-', dir='/tmp')
> > +    python_report_file = os.fdopen(report_file, 'w')
> > +    try:
> > +        report['CommandLine'] = ' '.join(sys.argv)
> > +        # assume we are packaged as bzr.
> > +        apport_utils.report_add_package_info(report, 'bzr')
> 
> What if bzr is installed but we're not running the installed copy?

Good catch. We should output the paths to bzr and the bzrlib module too,
as well as the version details for bzr. I'll put the need to do this in
a bug report.


> > +        err_file.write(
> > +            'This is an unexpected error within bzr and we would appreciate a bug report.\n'
> > +            '\n'
> > +            'bzr has written a crash report file that will assist our debugging of this\n'
> > +            'in the file %s\n'
> > +            '\n'
> > +            'This is a plain text file, whose contents you can check if you have privacy\n'
> > +            'concerns. We gather the package data about bzr, your command line, plugins\n'
> > +            'And the backtrace from within bzr. If you had a password in the URL you\n'
>                 ^ should be lowercase.

Yup. 
> ...> +            'Alternatively you can email bazaar-ng at lists.canonical.com with the same\n'
> > +            'description and attach the bzr-crash file to the email.\n' %
> > +                report_filename
> > +            )
> 
> Can't we use this text whether we have apport or not?

I was preserving the old interface. As we have agreement in principle to
always generate a file, we can use the entire text, and apport will
simply control the amount of detail we get, not user interface.

Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061108/a767327f/attachment.pgp 


More information about the bazaar mailing list