Re: SIGSEGV: rl_redisplay: Long Directory Name with EM Dash character in Graphical Terminal

2018-02-04 Thread Kieran Grant
Yep, that solved it :D

On 05/02/18 07:53, Chet Ramey wrote:
> On 2/2/18 8:57 PM, Kieran Grant wrote:
>> On 03/02/18 00:25, Chet Ramey wrote:
>>> I can't reproduce it on Mac OS X or Red Hat, even when using the Debian
>>> prompt. What is your $PS1? (The value of `prompt' in the call to readline()
>>> in the trace looks kind of sketchy.)
>>>
>>
>> PS1=\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$
> 
> Try the attached patch; it should fix it.
> 
> Chet
> 



Re: SIGSEGV: rl_redisplay: Long Directory Name with EM Dash character in Graphical Terminal

2018-02-02 Thread Kieran Grant
He he, I love that on the mailing list archive it replaces my host details with
"address@hidden", kinda ruins the calculations though... and it is in my 
screenshots.
:D



Re: SIGSEGV: rl_redisplay: Directory with EM Dash

2018-02-02 Thread Kieran Grant
> I'm Re-sending using bashbug (though sent through Thunderbird :/) after I've 
> subscribed to mailing-list, appears my first message didn't go through
Nope, I was wrong. :/ Just was very much delayed



SIGSEGV: rl_redisplay: Long Directory Name with EM Dash character in Graphical Terminal

2018-02-01 Thread Kieran Grant
Hi All,

Found an interesting bug today,

GNU bash, version 4.4.18(4)-release (x86_64-unknown-linux-gnu)

When running in a graphical terminal (xterm, mate-terminal, gnome-terminal) set 
to 80x24.
I get a SIGSEGV in rl_redisplay doing the following: (Haven't managed to do it 
on a Virtual Console)

mkdir 
/tmp/XX–X
cd 
/tmp/XX–X

NOTE: That is an EN Dash, not a hyphen.

Building from git (CFLAGS=-g ./configure --enable-static-link) run under gdb in 
such a terminal:
$ gdb ./bash
GNU gdb (Ubuntu 8.0.1-0ubuntu1) 8.0.1
...
(gdb) run
$ mkdir 
/tmp/XX–X
$ cd 
/tmp/XX–X

Program received signal SIGSEGV, Segmentation fault.
0x004bd03b in rl_redisplay () at display.c:823
823   inv_lbreaks[++newlines] = temp;
(gdb) bt
#0  0x004bd03b in rl_redisplay () at display.c:823
#1  0x004a858c in readline_internal_setup () at readline.c:443
#2  0x004a8a1f in readline_internal () at readline.c:669
#3  0x004a8452 in readline (prompt=0x872208 "j\001") at readline.c:376
#4  0x00407987 in yy_readline_get () at 
/usr/homes/chet/src/bash/src/parse.y:1456
#5  0x00407a9c in yy_readline_get () at 
/usr/homes/chet/src/bash/src/parse.y:1487
#6  0x004078d2 in yy_getc () at 
/usr/homes/chet/src/bash/src/parse.y:1390
#7  0x004087c6 in shell_getc (remove_quoted_newline=1) at 
/usr/homes/chet/src/bash/src/parse.y:2299
#8  0x00409d31 in read_token (command=0) at 
/usr/homes/chet/src/bash/src/parse.y:3115
#9  0x004092c9 in yylex () at /usr/homes/chet/src/bash/src/parse.y:2675
#10 0x00404425 in yyparse () at y.tab.c:1834
#11 0x00403fd8 in parse_command () at eval.c:261
#12 0x004040be in read_command () at eval.c:305
#13 0x00403cee in reader_loop () at eval.c:149
#14 0x004017c6 in main (argc=1, argv=0x7fffddc8, 
env=0x7fffddd8) at shell.c:792

My host is Ubuntu 17.10, 64-bit Ubuntu shipped kernel 4.13.0-32-generic.

Regards,
Kieran



SIGSEGV: rl_redisplay: Directory with EM Dash

2018-02-01 Thread Kieran Grant
Hi, 

I'm Re-sending using bashbug (though sent through Thunderbird :/) after I've 
subscribed to mailing-list, appears my first message didn't go through

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/local/share/locale' -DPACKAGE='bash' 
-DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib  -I/home/kieran/include 
-I/usr/local/include -g -Wno-parentheses -Wno-format-security
uname output: Linux kieran-desktop 4.13.0-32-generic #35-Ubuntu SMP Thu Jan 25 
09:13:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu

Bash Version: 4.4
Patch Level: 18
Release Status: release

Description:
When running in a graphical terminal (xterm, mate-terminal, gnome-terminal)
when set to 80x24.
I get a SIGSEGV in rl_redisplay when changing to a long path name with an
EN/EM Dash in it.
It doesn't have to be one long directoy, just seems the total path has to
match length (including "/tmp/" and have an EN Dash or EM Dash

mkdir /tmp/X\
X\
–X
cd /tmp/X\
X\
–X

Built from git tree with CFLAGS=-g ./configure --enable-static-link.
Running under gdb:
$ gdb ./bash
GNU gdb (Ubuntu 8.0.1-0ubuntu1) 8.0.1
...
(gdb) run
$ mkdir 
/tmp/XX–X
$ cd 
/tmp/XX–X

Program received signal SIGSEGV, Segmentation fault.
0x004bd03b in rl_redisplay () at display.c:823
823   inv_lbreaks[++newlines] = temp;
(gdb) bt
#0  0x004bd03b in rl_redisplay () at display.c:823
#1  0x004a858c in readline_internal_setup () at readline.c:443
#2  0x004a8a1f in readline_internal () at readline.c:669
#3  0x004a8452 in readline (prompt=0x872208 "j\001") at readline.c:376
#4  0x00407987 in yy_readline_get () at 
/usr/homes/chet/src/bash/src/parse.y:1456
#5  0x00407a9c in yy_readline_get () at 
/usr/homes/chet/src/bash/src/parse.y:1487
#6  0x004078d2 in yy_getc () at 
/usr/homes/chet/src/bash/src/parse.y:1390
#7  0x004087c6 in shell_getc (remove_quoted_newline=1) at 
/usr/homes/chet/src/bash/src/parse.y:2299
#8  0x00409d31 in read_token (command=0) at 
/usr/homes/chet/src/bash/src/parse.y:3115
#9  0x004092c9 in yylex () at /usr/homes/chet/src/bash/src/parse.y:2675
#10 0x00404425 in yyparse () at y.tab.c:1834
#11 0x00403fd8 in parse_command () at eval.c:261
#12 0x004040be in read_command () at eval.c:305
#13 0x00403cee in reader_loop () at eval.c:149
#14 0x004017c6 in main (argc=1, argv=0x7fffddc8, 
env=0x7fffddd8) at shell.c:792

Repeat-By:
Open Graphical Termianl to 80x24 in size.
mkdir /tmp/X\
X\
–X
cd /tmp/X\
X\
–X