zsh-workers
 help / color / mirror / code / Atom feed
* Ctrl-\ during completion makes zsh quit
@ 2020-08-01 15:10 Vincent Lefevre
  2020-08-02  2:33 ` Daniel Shahaf
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Lefevre @ 2020-08-01 15:10 UTC (permalink / raw)
  To: zsh-workers

Ctrl-\ during completion makes zsh quit. To reproduce the problem
with "zsh -f" under Debian/unstable:

Run the following commands:

zstyle ':completion:*' menu select=long
autoload -U compinit
compinit

Then ';' followed by [Tab]. I get:

zsh: do you wish to see all 6124 possibilities (3062 lines)? 

Type [Tab] again, then Ctrl-\. I get:

[...]
_gem                                lnstat                            
_generic  ^\zsh: quit (core dumped)  zsh -f

The backtrace:

Core was generated by `zsh -f'.
Program terminated with signal SIGQUIT, Quit.
#0  0x00007fbddaddaef3 in __GI___libc_write (fd=10, 
    buf=0x561d9de07240 <shoutbuf>, nbytes=8192)
    at ../sysdeps/unix/sysv/linux/write.c:26
26      ../sysdeps/unix/sysv/linux/write.c: No such file or directory.
(gdb) bt
#0  0x00007fbddaddaef3 in __GI___libc_write (fd=10, 
    buf=0x561d9de07240 <shoutbuf>, nbytes=8192)
    at ../sysdeps/unix/sysv/linux/write.c:26
#1  0x00007fbddad6c625 in _IO_new_file_write (f=0x561d9e7b12c0, 
    data=0x561d9de07240 <shoutbuf>, n=8192) at fileops.c:1176
#2  0x00007fbddad6b996 in new_do_write (fp=fp@entry=0x561d9e7b12c0, 
    data=0x561d9de07240 <shoutbuf> "lp\033[27m", ' ' <repeats 32 times>, "\033[27m\033[J\n_history_modifiers\033[27m", ' ' <repeats 16 times>, "\033[27m  \033[27m\033[Jlp_solve\033[27m", ' ' <repeats 26 times>, "\033[27m\033[J\n_host\033[27m", ' ' <repeats 29 times>, "\033[27m  \033[27"..., to_do=to_do@entry=8192)
    at libioP.h:948
#3  0x00007fbddad6d6c9 in _IO_new_do_write (to_do=8192, data=<optimized out>, 
    fp=0x561d9e7b12c0) at fileops.c:423
#4  _IO_new_do_write (fp=fp@entry=0x561d9e7b12c0, data=<optimized out>, 
    to_do=8192) at fileops.c:423
#5  0x00007fbddad6db9f in _IO_new_file_overflow (f=0x561d9e7b12c0, ch=32)
    at fileops.c:765
#6  0x00007fbdda6413a9 in clprintm (g=g@entry=0x561d9ea8e3a0, 
    mp=mp@entry=0x561d9ea847d0, mc=mc@entry=1, ml=ml@entry=645, 
    lastc=lastc@entry=1, width=36) at ../../../Src/Zle/complist.c:1886
#7  0x00007fbdda642a5e in compprintlist (showall=<optimized out>)
    at ../../../Src/Zle/complist.c:1621
#8  complistmatches (dummy=<optimized out>, dat=<optimized out>)
    at ../../../Src/Zle/complist.c:2098
#9  0x00007fbddabe847e in list_matches (dummy=<optimized out>, 
    dummy2=<optimized out>) at ../../../Src/Zle/compresult.c:2317
#10 0x00007fbddac1de06 in zrefresh () at ../../../Src/Zle/zle_refresh.c:1769
#11 0x00007fbddac10f36 in zlecore () at ../../../Src/Zle/zle_main.c:1186
#12 0x00007fbddac11dcc in zleread (lp=<optimized out>, rp=<optimized out>, 
    flags=<optimized out>, context=<optimized out>, 
    init=0x7fbddac3041d "zle-line-init", 
    finish=0x7fbddac3040d "zle-line-finish")
    at ../../../Src/Zle/zle_main.c:1350
#13 0x0000561d9dd84558 in zleentry (cmd=cmd@entry=1) at ../../Src/init.c:1627
#14 0x0000561d9dd85ac1 in inputline () at ../../Src/input.c:295
#15 ingetc () at ../../Src/input.c:228
#16 0x0000561d9dd85c2f in ingetc () at ../../Src/input.c:196
#17 0x0000561d9dd7d7a7 in ihgetc () at ../../Src/hist.c:408
#18 0x0000561d9dd8f2f6 in gettok () at ../../Src/lex.c:611
#19 zshlex () at ../../Src/lex.c:275
#20 0x0000561d9dd9008e in zshlex () at ../../Src/lex.c:268
#21 0x0000561d9ddaf4a6 in parse_event (endtok=endtok@entry=37)
    at ../../Src/parse.c:581
#22 0x0000561d9dd80e79 in loop (toplevel=toplevel@entry=1, 
    justonce=justonce@entry=0) at ../../Src/init.c:150
#23 0x0000561d9dd84b7e in zsh_main (argc=<optimized out>, argv=<optimized out>)
    at ../../Src/init.c:1781
#24 0x00007fbddad12cca in __libc_start_main (main=0x561d9dd48d40 <main>, 
    argc=2, argv=0x7ffc3568ef38, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7ffc3568ef28)
    at ../csu/libc-start.c:308
#25 0x0000561d9dd48d7a in _start ()

BTW, in addition to the SIGQUIT issue, it shouldn't be that easy to
generate so much output for the completions (I did that by mistake).

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Ctrl-\ during completion makes zsh quit
  2020-08-01 15:10 Ctrl-\ during completion makes zsh quit Vincent Lefevre
@ 2020-08-02  2:33 ` Daniel Shahaf
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Shahaf @ 2020-08-02  2:33 UTC (permalink / raw)
  To: Vincent Lefevre; +Cc: zsh-workers

Vincent Lefevre wrote on Sat, 01 Aug 2020 17:10 +0200:
> Then ';' followed by [Tab]. I get:
> 
> zsh: do you wish to see all 6124 possibilities (3062 lines)? 
> 
> Type [Tab] again, then Ctrl-\. I get:
> 
> [...]
> _gem                                lnstat                            
> _generic  ^\zsh: quit (core dumped)  zsh -f
> 

And what's the bug?  It's quite normal for SIGQUIT to kill programs
even when SIGINT does not.  If anything, I'd say the bug here is that
SIGINT doesn't cause the listing to be aborted immediately, not that
SIGQUIT does exactly what it's supposed to do.

> BTW, in addition to the SIGQUIT issue, it shouldn't be that easy to
> generate so much output for the completions (I did that by mistake).

It's not easy.  There was an explicit prompt which you had to affirm.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-02  2:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-01 15:10 Ctrl-\ during completion makes zsh quit Vincent Lefevre
2020-08-02  2:33 ` Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).