Bug#333004: bash fails badly with long brace expansion.

2005-10-09 Thread John Darrah
Package: bash
Version: 3.0-16
Severity: normal


The following brace expansion:
  echo 
{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}

Fails with the following error:
  bash: xmalloc: ../bash/make_cmd.c:167: cannot allocate 8 bytes (0 bytes 
allocated)

And then the shell dies (crash).

I'm quite sure that on older versions of the shell this worked OK.

I used pdksh to execute the same command and see if it was running
out of memory, but it worked fine.


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.8-2-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages bash depends on:
ii  base-files3.1.7  Debian base system miscellaneous f
ii  libc6 2.3.5-6GNU C Library: Shared libraries an
ii  libncurses5   5.4-9  Shared libraries for terminal hand
hi  passwd1:4.0.3-35 change and administer password and

bash recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#333004: bash fails badly with long brace expansion.

2005-10-09 Thread Justin Pryzby
On Sun, Oct 09, 2005 at 04:15:22PM -0700, John Darrah wrote:
 The following brace expansion: echo
 {0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
 
 Fails with the following error: bash: xmalloc:
 ../bash/make_cmd.c:167: cannot allocate 8 bytes (0 bytes allocated)
 
 And then the shell dies (crash).
Do you see high memory usage beforehand?  (I don't know if linux
malloc/realloc EVER fail initially, but they can fail after the
fact, with OOM killer).

 I'm quite sure that on older versions of the shell this worked OK.
Do you know when or what versions?

I don't know if this is a bug; I was able to duplicate the error, but
with high memory usage.  If bash's implementation requires high memory
usage, then its not a bug (though a wishlist to not require such
large ammounts of memory would certainly be legitimate). 

-- 
Clear skies,
Justin


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#333004: bash fails badly with long brace expansion.

2005-10-09 Thread xyllyx
On Sun, Oct 09, 2005 at 07:37:23PM -0400, Justin Pryzby wrote:
 On Sun, Oct 09, 2005 at 04:15:22PM -0700, John Darrah wrote:
  The following brace expansion: echo
  {0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
  
  Fails with the following error: bash: xmalloc:
  ../bash/make_cmd.c:167: cannot allocate 8 bytes (0 bytes allocated)
  
  And then the shell dies (crash).
 Do you see high memory usage beforehand?  (I don't know if linux
 malloc/realloc EVER fail initially, but they can fail after the
 fact, with OOM killer).

Shouldn't I see the result of an OOM using dmesg or does the 
kernel just kill the process silently??

I answered my own question using pdksh on a huge brace 
expansion. yes OOM is reported in a dmesg... so in 
conclusion bash is failing before memory exhaustion. I have 
2G of swap and it takes a while to get there with pdksh, but 
with bash it fails just after a few seconds.

 
  I'm quite sure that on older versions of the shell this worked OK.
 Do you know when or what versions?
No... but I'm sure it was the 2.x shell i'm refering to because it's been
a while since i've used brace expansion to generate large lists.

 
 I don't know if this is a bug; I was able to duplicate the error, but
 with high memory usage.  If bash's implementation requires high memory
 usage, then its not a bug (though a wishlist to not require such
 large ammounts of memory would certainly be legitimate). 
I still think there is something funny going on here.

 
 -- 
 Clear skies,
 Justin


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]