Bash itself won't crash on extraordinarily input, but the little utilitarian tool crashes.
With the ulimit set in /etc/bash.bashrc, the crash info is graceful as seen below. However, it ended up crashing my computer out. (Actually it took my computer into the pitfall of swap, as I found out later. That means, it consumes too much MEMORY, not cpu time.)
The source code seems as if the spelling error candidates are O(n^2). (Although actually it is, at least.)
Possibly a denial of service attack on computer without good config on ulimit :)
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard
callback()
File "/usr/lib/command-not-found", line 90, in main
if not cnf.advise(args[0], options.ignore_installed) and not options.no_failure_msg:
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 267, in advise
self.print_spelling_suggestion(command)
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 143, in print_spelling_suggestion
for w in similar_words(word):
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 102, in similar_words
replaces = [a + c + b[1:] for a, b in s for c in alphabet if b]
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 102, in <listcomp>
replaces = [a + c + b[1:] for a, b in s for c in alphabet if b]
MemoryError
Bash itself won't crash on extraordinarily input, but the little utilitarian tool crashes.
With the ulimit set in /etc/bash.bashrc, the crash info is graceful as seen below. However, it ended up crashing my computer out. (Actually it took my computer into the pitfall of swap, as I found out later. That means, it consumes too much MEMORY, not cpu time.)
The source code seems as if the spelling error candidates are O(n^2). (Although actually it is, at least.)
Possibly a denial of service attack on computer without good config on ulimit :)
~# `printf '=%.0s' {1..10000}` /bugs.launchpad .net/command- not-found/ +filebug
Sorry, command-not-found has crashed! Please file a bug report at:
https:/
Please include the following information with the report:
command-not-found version: 0.3
Python version: 3.5.2 final 0
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
Exception information:
Traceback (most recent call last): python3/ dist-packages/ CommandNotFound /util.py" , line 24, in crash_guard command- not-found" , line 90, in main ignore_ installed) and not options. no_failure_ msg: python3/ dist-packages/ CommandNotFound /CommandNotFoun d.py", line 267, in advise print_spelling_ suggestion( command) python3/ dist-packages/ CommandNotFound /CommandNotFoun d.py", line 143, in print_spelling_ suggestion words(word) : python3/ dist-packages/ CommandNotFound /CommandNotFoun d.py", line 102, in similar_words python3/ dist-packages/ CommandNotFound /CommandNotFoun d.py", line 102, in <listcomp>
File "/usr/lib/
callback()
File "/usr/lib/
if not cnf.advise(args[0], options.
File "/usr/lib/
self.
File "/usr/lib/
for w in similar_
File "/usr/lib/
replaces = [a + c + b[1:] for a, b in s for c in alphabet if b]
File "/usr/lib/
replaces = [a + c + b[1:] for a, b in s for c in alphabet if b]
MemoryError