command-not-found crashes when interpreted as python -S /usr/lib/command-not-found

Bug #209137 reported by [redacted]
4
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: command-not-found

Version:
command-not-found:
  Installed: 0.2.8ubuntu2
  Candidate: 0.2.8ubuntu2
  Versiontable:
 *** 0.2.8ubuntu2 0
        500 http://nl.archive.ubuntu.com gutsy/main Packages
        100 /var/lib/dpkg/status

Description: KUbuntu 7.10
Release: 7.10

I was displaying a binary (attached) with cat (stupid me)
and it said all things:

import site' failed; use -v for traceback

'import site' failed; use -v for traceback

KABOOOM!!!

Whoops, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/ubuntu/+source/command-not-found
Please include the following information with the report:
No module named CommandNotFound
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 10, in <module>
    from CommandNotFound import CommandNotFound
ImportError: No module named CommandNotFound
Python version: 2.5.1 final 0

'import site' failed; use -v for traceback

KABOOOM!!!

Whoops, command-not-found has crashed! Please file a bug report at:

https://bugs.launchpad.net/ubuntu/+source/command-not-found
Please include the following information with the report:
No module named CommandNotFound
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 10, in <module>
    from CommandNotFound import CommandNotFound
ImportError: No module named CommandNotFound

Python version: 2.5.1 final 0

'import site' failed; use -v for traceback

KABOOOM!!!

Whoops, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/ubuntu/+source/command-not-found
Please include the following information with the report:
No module named CommandNotFound
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 10, in <module>
    from CommandNotFound import CommandNotFound
ImportError: No module named CommandNotFound
Python version: 2.5.1 final 0
'import site' failed; use -v for traceback

KABOOOM!!!

Whoops, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/ubuntu/+source/command-not-found
Please include the following information with the report:
No module named CommandNotFound
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 10, in <module>
    from CommandNotFound import CommandNotFound
ImportError: No module named CommandNotFound
Python version: 2.5.1 final 0
bash: 2c1: opdracht niet gevonden
bash: 2c1: opdracht niet gevonden
bash: 2c1: opdracht niet gevonden

'import site' failed; use -v for traceback

KABOOOM!!!

Whoops, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/ubuntu/+source/command-not-found
Please include the following information with the report:
No module named CommandNotFound
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 10, in <module>
    from CommandNotFound import CommandNotFound
ImportError: No module named CommandNotFound
Python version: 2.5.1 final 0

Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 5, in <module>
    BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/+source/command-not-found"
KeyboardInterrupt

'import site' failed; use -v for traceback

KABOOOM!!!

Whoops, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/ubuntu/+source/command-not-found
Please include the following information with the report:
No module named CommandNotFound
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 10, in <module>
    from CommandNotFound import CommandNotFound
ImportError: No module named CommandNotFound
Python version: 2.5.1 final 0
'import site' failed; use -v for traceback

KABOOOM!!!

Whoops, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/ubuntu/+source/command-not-found
Please include the following information with the report:
No module named CommandNotFound
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 10, in <module>
    from CommandNotFound import CommandNotFound
ImportError: No module named CommandNotFound
Python version: 2.5.1 final 0
'import site' failed; use -v for traceback

KABOOOM!!!

Whoops, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/ubuntu/+source/command-not-found

Revision history for this message
[redacted] (frozenfire-deactivatedaccount) wrote :

Here is the binary

Revision history for this message
Daniel T Chen (crimsun) wrote : Re: Repeated crashes when cat:ting a binary file in terminal

Is this symptom still reproducible in 8.10 or 9.04?

Changed in command-not-found:
status: New → Incomplete
Revision history for this message
Sean Stoops (brutimus) wrote :

Can anything really be done about catting a binary? From anything I've seen, the results are fairly unpredictable. For instance, try catting /bin/cat. In my opinion, command-not-found should not necessarily need to handle this behavior.

Revision history for this message
era (era) wrote :

Sean Stoops: any program crash is a bug. Until you have a proper analysis, it might even be a security vulnerability for all we know. The precise circumstances under which the input ends up in command-not-found are of secondary importance. You could end up with similar behavior when accidentally pasting random text in the terminal, for example. Catting is just a special case of that (and technically I believe fairly similar, in terms of what probably ends up crashing command-not-found).

Revision history for this message
era (era) wrote :

I was unable to repro on 8.10 in Terminal. (Good old xterm seems more robust against this to begin with.)

Revision history for this message
Michael Vogt (mvo) wrote :

I think this is a problem that got fixed in jaunty with:

command-not-found (0.2.33ubuntu1) jaunty; urgency=low

  * debian/rules:
    - update debian/rules to the new python way of installing
      packages
  * command-not-found:
    - remove "-S" from "#!/usr/bin/python"

 -- Michael Vogt <email address hidden> Mon, 02 Mar 2009 09:15:48 +0100

Zygmunt Krynicki (zyga)
Changed in command-not-found (Ubuntu):
status: Incomplete → Fix Released
summary: - Repeated crashes when cat:ting a binary file in terminal
+ command-not-found crashes when interpreted as python -S
+ /usr/lib/command-not-found
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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