Re: Crash on completion

2010-05-05 Thread Knirch
Fix for above bug, would seem that the while loop has fallen out of
the globword: sections if (state == 0).. since I'm unsure what'll
happen with my reply formatting etc the patch below is without
whitespace changes, someone else can do a proper formatting of it :)

kni...@traktor:/tmp/bash-4.1$ diff -w -u bashline.c{.orig,}
--- bashline.c.orig 2010-03-09 10:21:14.0 +0100
+++ bashline.c  2010-03-09 10:49:35.0 +0100
@@ -1698,7 +1698,6 @@

  if (glob_matches[1]  rl_completion_type == TAB) /* multiple
matches are bad */
return ((char *)NULL);
-   }

   while (val = glob_matches[local_index++])
 {
@@ -1714,6 +1713,7 @@
}
  free (val);
 }
+   }

   glob_ignore_case = old_glob_ignore_case;
   return ((char *)NULL);


Re: Crash on completion

2010-05-05 Thread Chet Ramey
On 3/9/10 7:52 AM, Knirch wrote:
 Fix for above bug, would seem that the while loop has fallen out of
 the globword: 

I posted a patch for this a while ago.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/




Crash on completion

2010-03-09 Thread Jan Schampera
Hello list,
hello Chet.

Bug reported on freenode's IRC #bash by: Satgi

There is a crash somewhere in completion (the last commandline is
completed using TAB):

  echo $BASH_VERSION
  4.1.2(1)-release
  mkdir -p the/?/directory
  ./the/\?/Segmentation fault (core dumped)

These completions DO NOT crash there (maybe that's a hint for you):
  cd the/\?/directory/
  cd ./the\?/directory/

Bash was invoked with the --norc option.

Tested versions:
- 4.1.2: SEGV
- 4.1 alpha: SEGV
- 4.0.0: SEGV
- 3.2.39: OK
- 3.2.25: OK

So it looks like this was introduced with 4.0. Here's a backtrace I got
from a coredump:

#0  0x00460fde in command_word_completion_function
(hint_text=0x16cd028 ./the/\\?/, state=1) at bashline.c:1692
#1  0x0048c7cb in rl_completion_matches (text=0x16cd028
./the/\\?/,
entry_function=0x460ad0 command_word_completion_function) at
complete.c:1887
#2  0x004617a2 in bash_default_completion (text=0x16cd028
./the/\\?/, start=0, end=9, qc=0, compflags=1)
at bashline.c:1414
#3  0x00462bba in attempt_shell_completion (text=0x16cd028
./the/\\?/, start=0, end=9) at bashline.c:1363
#4  0x0048c867 in gen_completion_matches (text=0x16cd028
./the/\\?/, start=207, end=0,
our_func=0x48bff0 rl_filename_completion_function,
found_quote=-808464433, quote_char=1) at complete.c:1023
#5  0x0048db70 in rl_complete_internal (what_to_do=9) at
complete.c:1746
#6  0x00485c63 in _rl_dispatch_subseq (key=9, map=0x6d8d80,
got_subseq=0) at readline.c:769
#7  0x00486447 in readline_internal_char () at readline.c:548
#8  0x0048685d in readline (prompt=value optimized out) at
readline.c:575
#9  0x004292ea in yy_readline_get () at
/Users/chet/src/bash/src/parse.y:1314
#10 0x00423708 in shell_getc (remove_quoted_newline=1) at
/Users/chet/src/bash/src/parse.y:1247
#11 0x00425d45 in read_token (command=value optimized out) at
/Users/chet/src/bash/src/parse.y:2727
#12 0x0042985e in yyparse () at
/Users/chet/src/bash/src/parse.y:2360
#13 0x00421102 in parse_command () at eval.c:228
#14 0x004211e6 in read_command () at eval.c:272
#15 0x00421434 in reader_loop () at eval.c:137
#16 0x00420f56 in main (argc=1, argv=0x7fff6ad3f768,
env=0x7fff6ad3f778) at shell.c:741


Jan





Bash 4.0.0 crash on completion

2009-03-30 Thread André Johansen
Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.10
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc'
-DCONF_OSTYPE='solaris2.10' -DCONF_MACHTYPE='sparc-sun-solaris2.10'
-DCONF_VENDOR='sun' -DLOCALEDIR='/usr/site/bash-4.0/share/locale'
-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -DSOLARIS   -I.  -I.
-I./include -I./lib -I./lib/intl
-I/apps/bash-4.0/src/bash-4.0/lib/intl  -g -O2
uname output: SunOS oss621 5.10 Generic_137137-09 sun4u sparc SUNW,Sun-Fire-V245
Machine Type: sparc-sun-solaris2.10

Bash Version: 4.0
Patch Level: 0
Release Status: release

Description:
When using tab-completion, Bash crashes.
I'm using the bash_completion package from
http://www.caliban.org/bash/index.shtml#completion.

=[1] restore_token_state(ts = 0xee471), line 1631 in parse.y
  [2] restore_parser_state(ps = 0xffbfe588), line 5560 in parse.y
  [3] gen_compspec_completions(cs = 0x107548, cmd = 0x1cca88 cd
natcon, word = 0x1cca68 natcon, start = 0, end = 9), line 1043 in
pcomplete.c
  [4] programmable_completions(cmd = 0x1a5aa8 cd, word = 0x1cca68
natcon, start = 0, end = 9, foundp = 0xffbfe6a4), line 1444 in
pcomplete.c
  [5] attempt_shell_completion(text = 0x1cca68 natcon, start = 3,
end = 9), line 1334 in bashline.c
  [6] gen_completion_matches(text = 0x1cca68 natcon, start = 3, end
= 9, our_func = 0x9cf28 = rl_filename_completion_function(register
const char *text, register int state), found_quote = 0, quote_char =
0), line 1023 in complete.c
  [7] rl_complete_internal(what_to_do = 9), line 1746 in complete.c
  [8] _rl_dispatch_subseq(key = 9, map = 0xeaf40, got_subseq = 0),
line 769 in readline.c
  [9] readline_internal_char(), line 548 in readline.c
  [10] readline(prompt = 0xed400 ), line 575 in readline.c
  [11] yy_readline_get(), line 1314 in parse.y
  [12] yy_getc(), line 1247 in parse.y
  [13] shell_getc(remove_quoted_newline = 1), line 2094 in parse.y
  [14] read_token(command = 0), line 2727 in parse.y
  [15] yyparse(), line 2360 in parse.y
  [16] parse_command(), line 228 in eval.c
  [17] read_command(), line 272 in eval.c
  [18] reader_loop(), line 137 in eval.c
  [19] main(argc = 1, argv = 0xffbff7fc, env = 0xffbff804), line 741
in shell.c

Repeat-By:
Press tab to get a completion; if Bash enters a programmed completion
(i.e. not a simple file name or variable name expansion), Bash
crashes.




Re: Bash 4.0.0 crash on completion

2009-03-30 Thread Roman Rakus

André Johansen wrote:

Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: solaris2.10
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc'
-DCONF_OSTYPE='solaris2.10' -DCONF_MACHTYPE='sparc-sun-solaris2.10'
-DCONF_VENDOR='sun' -DLOCALEDIR='/usr/site/bash-4.0/share/locale'
-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -DSOLARIS   -I.  -I.
-I./include -I./lib -I./lib/intl
-I/apps/bash-4.0/src/bash-4.0/lib/intl  -g -O2
uname output: SunOS oss621 5.10 Generic_137137-09 sun4u sparc SUNW,Sun-Fire-V245
Machine Type: sparc-sun-solaris2.10

Bash Version: 4.0
Patch Level: 0
Release Status: release

Description:
When using tab-completion, Bash crashes.
I'm using the bash_completion package from
http://www.caliban.org/bash/index.shtml#completion.

=[1] restore_token_state(ts = 0xee471), line 1631 in parse.y
  [2] restore_parser_state(ps = 0xffbfe588), line 5560 in parse.y
  [3] gen_compspec_completions(cs = 0x107548, cmd = 0x1cca88 cd
natcon, word = 0x1cca68 natcon, start = 0, end = 9), line 1043 in
pcomplete.c
  [4] programmable_completions(cmd = 0x1a5aa8 cd, word = 0x1cca68
natcon, start = 0, end = 9, foundp = 0xffbfe6a4), line 1444 in
pcomplete.c
  [5] attempt_shell_completion(text = 0x1cca68 natcon, start = 3,
end = 9), line 1334 in bashline.c
  [6] gen_completion_matches(text = 0x1cca68 natcon, start = 3, end
= 9, our_func = 0x9cf28 = rl_filename_completion_function(register
const char *text, register int state), found_quote = 0, quote_char =
0), line 1023 in complete.c
  [7] rl_complete_internal(what_to_do = 9), line 1746 in complete.c
  [8] _rl_dispatch_subseq(key = 9, map = 0xeaf40, got_subseq = 0),
line 769 in readline.c
  [9] readline_internal_char(), line 548 in readline.c
  [10] readline(prompt = 0xed400 ), line 575 in readline.c
  [11] yy_readline_get(), line 1314 in parse.y
  [12] yy_getc(), line 1247 in parse.y
  [13] shell_getc(remove_quoted_newline = 1), line 2094 in parse.y
  [14] read_token(command = 0), line 2727 in parse.y
  [15] yyparse(), line 2360 in parse.y
  [16] parse_command(), line 228 in eval.c
  [17] read_command(), line 272 in eval.c
  [18] reader_loop(), line 137 in eval.c
  [19] main(argc = 1, argv = 0xffbff7fc, env = 0xffbff804), line 741
in shell.c

Repeat-By:
Press tab to get a completion; if Bash enters a programmed completion
(i.e. not a simple file name or variable name expansion), Bash
crashes.


  

Update to patch level 10. It's fixed there.
RR




Re: Bash 4.0.0 crash on completion

2009-03-30 Thread Richard Leeden


André Johansen wrote:
 
 Description:
 When using tab-completion, Bash crashes.
 I'm using the bash_completion package from
 http://www.caliban.org/bash/index.shtml#completion.
 
 ...
 
 Repeat-By:
 Press tab to get a completion; if Bash enters a programmed completion
 (i.e. not a simple file name or variable name expansion), Bash
 crashes.
 

Apply the patches (ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/ ). 
I believe this was fixed by patch 002.

-- 
View this message in context: 
http://www.nabble.com/Bash-4.0.0-crash-on-completion-tp22783625p22784131.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.