command-not-found is hiding exception/backtrace when crashing

Bug #926577 reported by Michael Basse
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

command-not-found is telling the user to report a bug but is hiding the usefull informations.

i have a case where i can crash the crash dumper of "command-not-found"

LANG=en (instead of LANG=en_EN.UTF-8)

this is crashing the crash dumper and command-not-found can not get that informations to display it (should also affect other situations where crash dumper is crashed before)

LANG=en

vii foo

Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/command-not-found/+filebug
Please include the following information with the report:

command-not-found version: 0.2.44

for the wrong version-output there is already https://bugs.launchpad.net/ubuntu/+source/command-not-found/+bug/925678

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: command-not-found 0.2.46ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-12.21-generic 3.2.2
Uname: Linux 3.2.0-12-generic i686
ApportVersion: 1.91-0ubuntu1
Architecture: i386
Date: Sat Feb 4 11:04:15 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110426)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 LANG=en
 SHELL=/bin/bash
SourcePackage: command-not-found
UpgradeStatus: Upgraded to precise on 2011-12-04 (61 days ago)

Revision history for this message
Michael Basse (michael-alpha-unix) wrote :
Revision history for this message
Alistair Buxton (a-j-buxton) wrote :

The problem is that the crash_guard tries to do (basically) this:

print "Python version: %d.%d.%d %s %d" % sys.version_info

This fails. Then the outer try: block catches and hides the exception that this produces before exiting.

I'm not sure if this is a python bug or change or what, but the following code works instead:

print "Python version: %d.%d.%d %s %d" % (sys.version_info.major, sys.version_info.minor, sys.version_info.micro, sys.version_info.releaselevel, sys.version_info.serial)

or indeed:

print "Python version: %s" % sys.version

Changed in command-not-found (Ubuntu):
status: New → Confirmed
Revision history for this message
Zygmunt Krynicki (zyga) wrote : Re: [Bug 926577] Re: command-not-found is hiding exception/backtrace when crashing

On 02/04/2012 11:39 AM, Alistair Buxton wrote:
> The problem is that the crash_guard tries to do (basically) this:
>
> print "Python version: %d.%d.%d %s %d" % sys.version_info
>
> This fails. Then the outer try: block catches and hides the exception
> that this produces before exiting.
>
> I'm not sure if this is a python bug or change or what, but the
> following code works instead:
>
> print "Python version: %d.%d.%d %s %d" % (sys.version_info.major,
> sys.version_info.minor, sys.version_info.micro,
> sys.version_info.releaselevel, sys.version_info.serial)
>
> or indeed:
>
> print "Python version: %s" % sys.version
>
> ** Changed in: command-not-found (Ubuntu)
> Status: New => Confirmed
>

I have a somewhat unfinished branch that fixes this and tries to work
around most of the "I connected with putty and ubuntu does not work" issues.

Thanks
ZK

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.