zsh-workers
 help / color / mirror / code / Atom feed
* zsh frozen after typing Ctrl-Z then bg
@ 2015-06-27 22:04 Vincent Lefevre
  2015-06-27 22:51 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Lefevre @ 2015-06-27 22:04 UTC (permalink / raw)
  To: zsh-workers

I started emacs from zsh 5.0.8, then wanted to put it in background.
So, I did Ctrl-Z, then bg. But instead of getting the prompt back,
zsh is frozen. Ctrl-C has no effect. Here's the backtrace:

__lll_lock_wait_private ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
95      ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: No such file or directory.
(gdb) bt
#0  __lll_lock_wait_private ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1  0x00007fc1c05b352a in _L_lock_10381 () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007fc1c05b1065 in __GI___libc_malloc (bytes=8) at malloc.c:2887
#3  0x0000000000451660 in zalloc (size=<optimized out>, size@entry=8)
    at ../../Src/mem.c:900
#4  0x000000000044516b in addbgstatus (pid=pid@entry=27181, status=148)
    at ../../Src/jobs.c:2015
#5  0x00000000004739d5 in wait_for_processes () at ../../Src/signals.c:532
#6  0x0000000000474105 in zhandler (sig=17) at ../../Src/signals.c:594
#7  <signal handler called>
#8  _int_malloc (av=0x7fc1c08d8620 <main_arena>, bytes=304) at malloc.c:3389
#9  0x00007fc1c05b1070 in __GI___libc_malloc (bytes=304) at malloc.c:2891
#10 0x0000000000422ea2 in zcontext_save_partial (parts=parts@entry=7)
    at ../../Src/context.c:56
#11 0x0000000000422f3a in zcontext_save () at ../../Src/context.c:78
#12 0x0000000000449d40 in parse_subscript (s=0x7fc1c142c68e "1]", 
    sub=sub@entry=1, endchar=endchar@entry=93) at ../../Src/lex.c:1615
#13 0x000000000045a243 in isident (s=s@entry=0x7fc1c142c688 "psvar[1]")
    at ../../Src/params.c:1076
#14 0x0000000000460dee in assignsparam (s=s@entry=0x7fc1c142c688 "psvar[1]", 
    val=val@entry=0x12012d0 "0", flags=flags@entry=0)
    at ../../Src/params.c:2691
#15 0x0000000000424871 in addvars (state=0x7ffc6952e5d0, pc=<optimized out>, 
    addflags=addflags@entry=0) at ../../Src/exec.c:2317
#16 0x000000000042d291 in execsimple (state=state@entry=0x7ffc6952e5d0)
    at ../../Src/exec.c:1117
#17 0x000000000042ad30 in execlist (state=state@entry=0x7ffc6952e5d0, 
    dont_change_job=dont_change_job@entry=1, exiting=exiting@entry=0)
    at ../../Src/exec.c:1274
#18 0x000000000042b300 in execode (p=p@entry=0xfc41a0, 
    dont_change_job=dont_change_job@entry=1, exiting=exiting@entry=0, 
    context=context@entry=0x48eb37 "shfunc") at ../../Src/exec.c:1074
#19 0x000000000042be01 in runshfunc (prog=0xfc41a0, wrap=0x0, 
    name=0x7fc1c142c660 "precmd") at ../../Src/exec.c:5167
#20 0x000000000042c466 in doshfunc (shfunc=0xfc9690, 
    doshargs=doshargs@entry=0x0, noreturnval=noreturnval@entry=1)
    at ../../Src/exec.c:5037
#21 0x0000000000483771 in callhookfunc (name=0x497b3f "precmd", lnklst=0x0, 
    arrayp=1, retval=0x0) at ../../Src/utils.c:1332
#22 0x000000000048b953 in preprompt () at ../../Src/utils.c:1416
#23 0x000000000043d1c3 in loop (toplevel=toplevel@entry=1, 
    justonce=justonce@entry=0) at ../../Src/init.c:129
#24 0x00000000004404de in zsh_main (argc=<optimized out>, argv=<optimized out>)
    at ../../Src/init.c:1674
#25 0x00007fc1c0556b45 in __libc_start_main (main=0x40fc90 <main>, argc=1, 
    argv=0x7ffc6952eca8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7ffc6952ec98) at libc-start.c:287
#26 0x000000000040fcbe in _start ()

When I typed Ctrl-\, zsh quit.

Also reported at:

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790282

-- 
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: zsh frozen after typing Ctrl-Z then bg
  2015-06-27 22:04 zsh frozen after typing Ctrl-Z then bg Vincent Lefevre
@ 2015-06-27 22:51 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2015-06-27 22:51 UTC (permalink / raw)
  To: zsh-workers

On Jun 28, 12:04am, Vincent Lefevre wrote:
}
} I started emacs from zsh 5.0.8, then wanted to put it in background.
} So, I did Ctrl-Z, then bg. But instead of getting the prompt back,
} zsh is frozen. Ctrl-C has no effect.

Sigh.  Every time we rearrange part of this, we lose signal queuing scope.

diff --git a/Src/context.c b/Src/context.c
index 1b8741f..2dc8d3b 100644
--- a/Src/context.c
+++ b/Src/context.c
@@ -53,6 +53,8 @@ zcontext_save_partial(int parts)
 {
     struct context_stack *cs;
 
+    queue_signals();
+
     cs = (struct context_stack *)malloc(sizeof(struct context_stack));
 
     if (parts & ZCONTEXT_HIST) {
@@ -67,6 +69,8 @@ zcontext_save_partial(int parts)
 
     cs->next = cstack;
     cstack = cs;
+
+    unqueue_signals();
 }
 
 /* save context in full */

-- 
Barton E. Schaefer


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

end of thread, other threads:[~2015-06-27 22:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-27 22:04 zsh frozen after typing Ctrl-Z then bg Vincent Lefevre
2015-06-27 22:51 ` Bart Schaefer

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