Re: set isearch-terminators "\r" in .inputrc causes malloc assert fails/death

2016-05-08 Thread Chet Ramey
On 5/4/16 1:43 PM, Britton Kerin wrote:
> I tried with export INPUTRC=test_inputrc, where test_inputrc contains
> just this:
> 
> set isearch-terminators "\r"
> 
> this causes bash to sometimes spit out things like this:

I can't reproduce this with bash-4.3.42 on RHEL 7, and there's independent
confirmation that it's not reproducible in the latest devel version.  I'm
going to call it fixed in bash-4.4.

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/



Re: set isearch-terminators "\r" in .inputrc causes malloc assert fails/death

2016-05-08 Thread Piotr Grzybowski

On 5 May 2016, at 13:48, Eduardo A. Bustamante López wrote:

> I'm able to replicate with the master branch. [..]

 yes, it appeared on the master with:

commit ac50fbac377e32b98d2de396f016ea81e8ee9961
Date:   Wed Feb 26 09:36:43 2014 -0500
Bash-4.3 distribution sources and documentation

at the following it is still fine:

commit 4539d736f1aff232857a854fd2a68df0c98d9f34
Date:   Tue Feb 25 20:36:50 2014 -0500
prep for bash-4.3 release

at the same time on bash-4.3-testing right to the end it is fine, including:

commit b6e23235f28b1c85e18e9a2b7ba8c6b6c46aecbc
Date:   Wed Jan 29 17:00:07 2014 -0500
bash-4.3-rc2 overlay

so I guess that diff b6e23235f28b1c85e18e9a2b7ba8c6b6c46aecbc 
ac50fbac377e32b98d2de396f016ea81e8ee9961 holds the key to this secret.
 At the current devel it is not present.
 Also, for those who would like to reproduce it, I was only able to do it with 
unset HISTCONTROL, and also for some reasons only under login shell (i.e. after 
actual chsh).

cheers,
pg




Re: set isearch-terminators "\r" in .inputrc causes malloc assert fails/death

2016-05-05 Thread Eduardo A . Bustamante López
On Thu, May 05, 2016 at 10:30:04AM +0200, Piotr Grzybowski wrote:
> hi,
> 
>  I cannot replicate it in anyway on mac os x or linux.
>  Could you please define "sometimes", and supply the exact version of bash 
> that shows this behavior, and the version you refer to as "my old bash"? I 
> have a distinct feeling that it is something different than my old bash.
> 
> cheers,
> pg
> 

I'm able to replicate with the master branch.

|  dualbus@yaqui ...src/gnu/bash % INPUTRC=/dev/fd/3 gdb --batch ./bash -ex r 
3<<<'set isearch-terminators "\r"'
|  dualbus@yaqui:~/local/src/gnu/bash$ ls
|  
|  malloc: unknown:0: assertion botched
|  malloc: block on free list clobbered
|  last command: ls
|  Aborting...
|  Program received signal SIGABRT, Aborted.
|  0x7763a107 in __GI_raise (sig=sig@entry=6) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56
|  56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
|  
|  
|  Program received signal SIGABRT, Aborted.
|  0x7763a107 in __GI_raise (sig=sig@entry=6) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56
|  56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
|  (gdb) bt
|  #0  0x7763a107 in __GI_raise (sig=sig@entry=6) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56
|  #1  0x7763b4e8 in __GI_abort () at abort.c:89
|  #2  0x00447470 in programming_error (format=0x4f9bf0 "malloc: block 
on free list clobbered") at error.c:176
|  #3  0x004d8bc2 in xbotch (mem=0x8a2e08, e=0, s=0x4f9bf0 "malloc: 
block on free list clobbered", file=0x4dcd68 "make_cmd.c", line=100) at 
malloc.c:319
|  #4  0x004d9516 in internal_malloc (n=3, file=0x4dcd68 "make_cmd.c", 
line=100, flags=1) at malloc.c:801
|  #5  0x004d9ee2 in sh_malloc (bytes=3, file=0x4dcd68 "make_cmd.c", 
line=100) at malloc.c:1187
|  #6  0x004882e6 in sh_xmalloc (bytes=3, file=0x4dcd68 "make_cmd.c", 
line=100) at xmalloc.c:183
|  #7  0x0042fd5a in make_bare_word (string=0x72b0a8 "ls") at 
make_cmd.c:100
|  #8  0x004464b7 in copy_word (w=0x731d28) at copy_cmd.c:61
|  #9  0x004464f5 in copy_word_list (list=0x731788) at copy_cmd.c:75
|  #10 0x0046543e in expand_word_list_internal (list=0x731788, 
eflags=31) at subst.c:9656
|  #11 0x00464a5e in expand_words (list=0x731788) at subst.c:9280
|  #12 0x0043b3cc in execute_simple_command (simple_command=0x733a88, 
pipe_in=-1, pipe_out=-1, async=0, fds_to_close=0x731d08) at execute_cmd.c:4000
|  #13 0x00435829 in execute_command_internal (command=0x733a48, 
asynchronous=0, pipe_in=-1, pipe_out=-1, fds_to_close=0x731d08) at 
execute_cmd.c:787
|  #14 0x00434e8a in execute_command (command=0x733a48) at 
execute_cmd.c:390
|  #15 0x00420d00 in reader_loop () at eval.c:160
|  #16 0x0041eb21 in main (argc=1, argv=0x7fffe528, 
env=0x7fffe538) at shell.c:756
|  
|  dualbus@yaqui ...src/gnu/bash % INPUTRC=/dev/fd/3 gdb --batch ./bash -ex 'b 
' -ex r  3<<<'set isearch-terminators "\n"'
|  No default breakpoint address now.
|  dualbus@yaqui:~/local/src/gnu/bash$ ls
|  
|  malloc: make_cmd.c:100: assertion botched
|  malloc: block on free list clobbered
|  last command: ls
|  Aborting...
|  Program received signal SIGABRT, Aborted.
|  0x7763a107 in __GI_raise (sig=sig@entry=6) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56
|  56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
|  dualbus@yaqui ...src/gnu/bash % INPUTRC=/dev/fd/3 gdb --batch ./bash -ex 'b 
' -ex r  3<<<'set isearch-terminators "a"' 
|  No default breakpoint address now.
|  dualbus@yaqui:~/local/src/gnu/bash$ ls
|  
|  malloc: /usr/src/local/bash/bash-4.3-patched/parse.y:6226: assertion botched
|  malloc: block on free list clobbered
|  last command: ls
|  Aborting...
|  Program received signal SIGABRT, Aborted.
|  0x7763a107 in __GI_raise (sig=sig@entry=6) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56
|  56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
|  dualbus@yaqui ...src/gnu/bash % INPUTRC=/dev/fd/3 gdb --batch ./bash -ex 'b 
' -ex r  3<<<'set isearch-terminators "123"'
|  No default breakpoint address now.
|  dualbus@yaqui:~/local/src/gnu/bash$ ls
|  
|  malloc: make_cmd.c:100: assertion botched
|  malloc: block on free list clobbered
|  last command: ls
|  Aborting...
|  Program received signal SIGABRT, Aborted.
|  0x7763a107 in __GI_raise (sig=sig@entry=6) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56
|  56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.

Forgive the extraneus -ex 'b ' on gdb, I'm lazy and I left it :-D

I can't reproduce it in devel.

-- 
Eduardo Bustamante
https://dualbus.me/



Re: set isearch-terminators "\r" in .inputrc causes malloc assert fails/death

2016-05-05 Thread Piotr Grzybowski
hi,

 I cannot replicate it in anyway on mac os x or linux.
 Could you please define "sometimes", and supply the exact version of bash that 
shows this behavior, and the version you refer to as "my old bash"? I have a 
distinct feeling that it is something different than my old bash.

cheers,
pg


On 4 May 2016, at 19:43, Britton Kerin wrote:

> I tried with export INPUTRC=test_inputrc, where test_inputrc contains
> just this:
> 
> set isearch-terminators "\r"
> 
> this causes bash to sometimes spit out things like this:
> 
> bkerin@debian:~$ ls
> 
> malloc: .././variables.c:2497: assertion botched
> malloc: block on free list clobbered
> last command: ls
> Aborting...Aborted
> 
> also sometimes it just dies and takes the terminal with it.
> 
> I'm not sure if this is specific to using \r as an isearch terminator but I
> suspect it is since hitting return normaly causes bash to fire off the command
> you're searching for.  Not sure though.
> 
> My old bash didn't do this, if anyone cares enough to ask I can bring
> that computer back up and check the bash/readline version to narrow
> down the search where this bug crept in.
> 
> I'm really hoping for a fix as reverse search followed by enter to
> bring a command back onto the command line for subsequent editing is
> deeply ingrained for me, I keep re-executing old commands.
> 
> Here is my debian system info:
> 
> -- System Information:
> Debian Release: 8.3
>  APT prefers stable-updates
>  APT policy: (500, 'stable-updates'), (500, 'stable')
> Architecture: amd64 (x86_64)
> 
> Kernel: Linux 4.4.5.emp3 (SMP w/8 CPU cores)
> Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/bash
> Init: systemd (via /run/systemd/system)
> 
> Versions of packages bash depends on:
> ii  base-files   8+deb8u3
> ii  dash 0.5.7-4+b1
> ii  debianutils  4.4+b1
> ii  libc62.19-18+deb8u3
> ii  libncurses5  5.9+20140913-1+b1
> ii  libtinfo55.9+20140913-1+b1
> 
> Versions of packages bash recommends:
> ii  bash-completion  1:2.1-4
> 
> Versions of packages bash suggests:
> pn  bash-doc  
> 
> -- no debconf information
> 
> 
> Thanks,
> Britton
>