On 8/16/10 5:05 AM, Roman Rakus wrote: > On 08/13/2010 03:55 PM, ordcoder wrote: >> Configuration Information [Automatically generated, do not change]: >> Machine: x86_64 >> OS: linux-gnu >> Compiler: gcc >> Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' >> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' >> -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/locale' >> -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include >> -I./lib -march=x86-64 -mtune=generic -O2 -pipe >> uname output: Linux ordtop 2.6.34-ARCH #1 SMP PREEMPT Wed Aug 11 >> 00:23:15 CEST 2010 x86_64 Intel(R) Pentium(R) Dual CPU T3400 @ 2.16GHz >> GenuineIntel GNU/Linux >> Machine Type: x86_64-unknown-linux-gnu >> Bash Version: 4.1 >> Patch Level: 7 >> Release Status: release >> Description: >> Bash quietly segfaults (exit status 139) when trying to unset >> associative array which was incorrectly declared (however it didn't >> complain when declaring it) >> Bash compiled from sources crashed (exit status 134) under the >> same circumstances with the following output: >> >> malloc: hashlib.c:306: assertion botched >> free: called with unallocated block argument >> last command: unset foo >> Aborting...Aborted >> >> Repeat-By: >> # Execute the following two commands at interactive prompt or >> put them in file and execute it: >> >> declare -A foo=bar >> unset foo >> > Already reported. So far, not patched. > http://www.mail-archive.com/bug-bash@gnu.org/msg06014.html
Andreas posted the straightforward patch back in April. If you want my imprimatur, here it is. This will be part of the next set of bash-4.1 patches. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/
*** ../bash-4.1-patched/builtins/declare.def 2009-11-25 19:42:00.000000000 -0500 --- builtins/declare.def 2010-05-30 18:25:21.000000000 -0400 *************** *** 513,517 **** /* let bind_{array,assoc}_variable take care of this. */ if (assoc_p (var)) ! bind_assoc_variable (var, name, "0", value, aflags); else bind_array_variable (name, 0, value, aflags); --- 519,523 ---- /* let bind_{array,assoc}_variable take care of this. */ if (assoc_p (var)) ! bind_assoc_variable (var, name, savestring ("0"), value, aflags); else bind_array_variable (name, 0, value, aflags);