LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 07-13-2012, 03:07 AM   #1
Andy Alkaline
Member
 
Registered: Jun 2004
Location: Minnesota, USA
Distribution: Slackware32-stable, Debian-wheezy-amd64, LFS 7.1
Posts: 355

Rep: Reputation: 33
Bash semi-crash


My nephew was aimlessly typing into his gnome-terminal (logged into his account on my computer) and accidentally caused my Mint desktop to almost freeze. I told him try it on my Debian Squeeze desktop feeling pretty confident I'd be able to break out of it. It started causing a slow down as my RAM was getting used up and swap partition getting full.

So I was able to prevent things from going to far, but wanted to replicate what he did so I'd know the exact cause.

Code:
echo I like applesauce!
Hit enter. Then held the "!" key down so it would fill up about three lines and then hit enter. Then press the up arrow, hit enter again. It seems to increase the command exponentially, so it only takes a few times of hitting the up arrow and hitting enter before your shell is inundated.

Had some slowdown afterward anytime I opened a new shell or logged out because my ~/.bash_history was 384 megabytes, apparently. On Mint, I couldn't even move the mouse until I was able to kill the process through ssh (took a minute to connect over the LAN, usually instantaneous).

This happened on
GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu)
GNU bash, version 4.2.20(1)-release (i486-pc-linux-gnu)

Anyway to build bash and configure it to limit the length of the command line?

Here's a sample:

Quote:
andy@dimensionE310:~ (0 jobs) $ echo I like applesauce!
I like applesauce!

andy@dimensionE310:~ (0 jobs) $ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!
I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!

andy@dimensionE310:~ (0 jobs) $ echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!
echo I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauce!
I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauceecho I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce!echo I like applesauce! I like applesauce!
andy@dimensionE310:~ (0 jobs) $
 
Old 07-13-2012, 03:52 AM   #2
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad W520
Posts: 4,681

Rep: Reputation: 1240Reputation: 1240Reputation: 1240Reputation: 1240Reputation: 1240Reputation: 1240Reputation: 1240Reputation: 1240Reputation: 1240
Quote:
Originally Posted by Andy Alkaline View Post
Anyway to build bash and configure it to limit the length of the command line?
No AFAIK as it depend on the kernel, not bash. To know the actual value:
Code:
getconf ARG_MAX
To know more, see here.

So my advise would be to configure your keyboard in such a way as it doesn't repeat a key-press, or not too fast
 
1 members found this post helpful.
Old 07-14-2012, 02:44 AM   #3
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 670

Rep: Reputation: 134Reputation: 134
I think you are batter off limiting bash_history size and not command line size (yes, command line size limit belong to kernel)

See 'man bash' and scroll to HISTFILESIZE
 
1 members found this post helpful.
Old 07-14-2012, 11:44 PM   #4
Andy Alkaline
Member
 
Registered: Jun 2004
Location: Minnesota, USA
Distribution: Slackware32-stable, Debian-wheezy-amd64, LFS 7.1
Posts: 355

Original Poster
Rep: Reputation: 33
HISTFILESIZE is the best solution I've come across so far, thanks for confirming.

So I created /etc/profile.d/histfilesize.sh

Quote:
root@dimensionE310 (0 jobs):~# cat /etc/profile.d/histfilesize.sh
export HISTFILESIZE=0
And my nephew is a pretty good kid, so I don't think I'll have to worry about this issue further.
 
  


Reply

Tags
bash


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: crash of transcode within script Thora Programming 8 01-10-2008 12:04 PM
Semi-New Member RoMan65 LinuxQuestions.org Member Intro 2 01-08-2006 02:38 PM
Crash, Crash, Crash, Crash and You Guessed it Crash! little_penguin Suse/Novell 8 07-04-2005 10:34 AM
Another (semi) Newbie TheMaxPower LinuxQuestions.org Member Intro 1 05-28-2005 09:02 PM
xmms crash xine crash mplayer crash paledread Linux - Software 9 03-09-2004 08:09 AM


All times are GMT -5. The time now is 08:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration