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-04 Thread Chet Ramey
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

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/
*** ../bash-4.4.18/lib/readline/display.c   2016-07-28 14:49:33.0 
-0400
--- lib/readline/display.c  2018-02-03 19:19:35.0 -0500
***
*** 772,776 
wadjust = (newlines == 0)
  ? prompt_invis_chars_first_line
! : ((newlines == prompt_lines_estimate) ? wrap_offset : 
prompt_invis_chars_first_line);
  
/* fix from Darin Johnson  for prompt string with
--- 788,794 
wadjust = (newlines == 0)
  ? prompt_invis_chars_first_line
! : ((newlines == prompt_lines_estimate)
!   ? (wrap_offset - prompt_invis_chars_first_line)
!   : 0);
  
/* fix from Darin Johnson  for prompt string with


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

2018-02-03 Thread Egmont Koblinger
Hi,

I can reproduce this problem with 4.4.12 on Ubuntu Artful (in
gnome-terminal, xterm, urxvt - so it doesn't seem to matter). I cannot
reproduce with devel bash.

(Sorry if this email doesn't show up nicely in the thread index, I
have no clue how to properly reply to an email just by seeing it in
the web archives.)


cheers,
egmont



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: Long Directory Name with EM Dash character in Graphical Terminal

2018-02-02 Thread Chet Ramey
On 2/1/18 5:48 PM, Kieran Grant wrote:
> 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)

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.)

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



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