Hard-wrapped commands are displayed incorrectly after READLINE_LINE is changed

2016-03-11 Thread Lauri Ranta
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: darwin14.5.0
Compiler: clang
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='darwin14.5.0' -DCONF_MACHTYPE='x86_64-apple-darwin14.5.0' 
-DCONF_VENDOR='apple' -DLOCALEDIR='/usr/local/Cellar/b$
uname output: Darwin Lauris-iMac-3.local 14.0.0 Darwin Kernel Version 14.0.0: 
Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Machine Type: x86_64-apple-darwin14.5.0

Bash Version: 4.3
Patch Level: 42
Release Status: release

With for example `bind -x '"\ea":READLINE_LINE='` and `PS1='$ '`, if the width 
of a shell window is 20 characters so that the 30 character command

$ aa


is displayed on two lines, after pressing `\ea`, the command is displayed as

$ aa
$

if the point is on the second line or as

$


if the point is on the first line.




Combination of ERR, EXIT, DEBUG traps causes segmentation fault on Bash 4.3.11

2016-03-11 Thread self
The following script cause Segmentation fault. I cleaned up the source, so 
removing any line "fixes" the problem.


$ ./sandbox.sh 
Segmentation fault (core dumped)


$ cat sandbox.sh 
#!/usr/bin/env bash

set -o errtrace
set -o functrace

SESSION="$( mktemp -d session.XX )"

on_exit() {
rm -r "$SESSION"
}

on_error() {
foo="$( echo 'bar' )"
return 0
}

on_debug() {
return 0
}

trap 'on_error' ERR
trap 'on_exit'  EXIT
trap 'on_debug' DEBUG

false


$ bash --version
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


$ gdb bash
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from bash...(no debugging symbols found)...done.
(gdb) run sandbox.sh
Starting program: /bin/bash sandbox.sh

Program received signal SIGSEGV, Segmentation fault.
0x004b435a in ?? ()
(gdb) bt
#0  0x004b435a in ?? ()
#1  0x004436a6 in ?? ()
#2  0x00444daf in cleanup_the_pipeline ()
#3  0x00444e43 in start_pipeline ()
#4  0x00446a3f in make_child ()
#5  0x00434796 in ?? ()
#6  0x00435ff0 in execute_command_internal ()
#7  0x00435cdb in execute_command_internal ()
#8  0x00438ddf in ?? ()
#9  0x00435299 in ?? ()
#10 0x00435ff0 in execute_command_internal ()
#11 0x0047879f in parse_and_execute ()
#12 0x0045acca in run_exit_trap ()
#13 0x0042090c in exit_shell ()
#14 0x0041f764 in main ()
(gdb) 


Re: Combination of ERR, EXIT, DEBUG traps causes segmentation fault on Bash 4.3.11

2016-03-11 Thread Chet Ramey
On 3/11/16 9:25 AM, s...@kr41.net wrote:
> The following script cause Segmentation fault. I cleaned up the source, so 
> removing any line "fixes" the problem.

Thanks for the report.  This was fixed last August, and the fix was in
bash-4.4-beta.


-- 
``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/