zsh-workers
 help / color / mirror / code / Atom feed
From: Mathias Fredriksson <mafredri@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: Deadlock when receiving kill-signal from child process
Date: Thu, 6 Aug 2015 00:49:07 +0300	[thread overview]
Message-ID: <CA+=GgY7cg9aDJxN--wcX=+MSD9dd2To3fSm9ecsd=tF1zg=zbQ@mail.gmail.com> (raw)
In-Reply-To: <150805132014.ZM7746@torch.brasslantern.com>

On Wed, Aug 5, 2015 at 11:20 PM, Bart Schaefer wrote:
}
} Dang.  Not sure there's much we can do about that one, that's the stdio
} library deadlocking internally on a mutex because a signal arrived.
} It'd be pretty ugly for us to try to wrap every stdio call with signal
} blocking.

Oh, interesting how this is only a problem on some systems.

}
} Yet another one of these.  We may have to resort to treating all signals
} the way we treat WINCH, that is, having them constantly queued except
} for specific moments when we unqueue them.

Ah, that explains why I have been able to work around this issue with WINCH.

}
} diff --git a/Src/parse.c b/Src/parse.c

Still locks up, interesting though is that this patch allows Ctrl+C to
exit the program even though it's frozen, the previous patch disabled
Ctrl+C, the one before that enabled Ctrl+C and before that it didn't
work either. Sorry for rambling, just trying to provide any additional
information I can.

forked child:

#0  0x00007fff8abf95da in syscall_thread_switch ()
#1  0x00007fff853a982d in _OSSpinLockLockSlow ()
#2  0x00007fff896e16d9 in szone_force_lock ()
#3  0x00007fff896e15e6 in _malloc_fork_prepare ()
#4  0x00007fff82cb8097 in fork ()
#5  0x000000010b9f6638 in zfork ()
#6  0x000000010b9fa0c5 in execcmd ()
#7  0x000000010b9f5128 in execpline ()
#8  0x000000010b9f46d2 in execlist ()
#9  0x000000010b9f44fa in execode ()
#10 0x000000010b9f80ff in runshfunc ()
#11 0x000000010b9f7bea in doshfunc ()
#12 0x000000010ba3c867 in dotrapargs ()
#13 0x000000010ba3b9ca in handletrap ()
#14 0x000000010ba3b2c8 in zhandler ()
#15 <signal handler called>
#16 0x00007fff896ddfc7 in small_free_list_add_ptr ()
#17 0x00007fff896d9ccf in szone_free_definite_size ()
#18 0x000000010ba2bc12 in bld_eprog ()
#19 0x000000010ba0cc3c in loop ()
#20 0x000000010ba0fa94 in zsh_main ()
#21 0x00007fff8610c5c9 in start ()

no fork:

#0  0x00007fff8abf95da in syscall_thread_switch ()
#1  0x00007fff853a982d in _OSSpinLockLockSlow ()
#2  0x00007fff896d98d6 in szone_free_definite_size ()
#3  0x000000010663c351 in freejob ()
#4  0x000000010663bd9d in printjob ()
#5  0x000000010663b0f2 in update_job ()
#6  0x0000000106665593 in wait_for_processes ()
#7  0x00000001066652be in zhandler ()
#8  <signal handler called>
#9  0x00007fff896d9e25 in szone_free_definite_size ()
#10 0x0000000106666885 in dotrapargs ()
#11 0x00000001066659ca in handletrap ()
#12 0x00000001066652c8 in zhandler ()
#13 0x000000010661fa29 in execpline ()
#14 0x000000010661e6d2 in execlist ()
#15 0x000000010661e4fa in execode ()
#16 0x0000000106636e43 in loop ()
#17 0x0000000106639a94 in zsh_main ()
#18 0x00007fff8610c5c9 in start ()


  reply	other threads:[~2015-08-05 21:49 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 11:25 Mathias Fredriksson
2015-08-03 15:52 ` Bart Schaefer
2015-08-03 20:36   ` Mathias Fredriksson
2015-08-03 20:58     ` Bart Schaefer
2015-08-04 21:52       ` Mathias Fredriksson
2015-08-05  0:05         ` Mathias Fredriksson
2015-08-05  6:53         ` Bart Schaefer
2015-08-05 10:37           ` Mathias Fredriksson
2015-08-05 15:52             ` Bart Schaefer
2015-08-05 16:05               ` Mathias Fredriksson
2015-08-05 18:52                 ` Bart Schaefer
2015-08-05 19:11                   ` Mathias Fredriksson
2015-08-05 20:20                     ` Bart Schaefer
2015-08-05 21:49                       ` Mathias Fredriksson [this message]
2015-08-06  5:06                         ` Bart Schaefer
2015-08-06  8:24                           ` Mathias Fredriksson
2015-08-06 15:54                             ` Bart Schaefer
2015-08-07  0:45                               ` Mathias Fredriksson
2015-08-07  5:39                                 ` Bart Schaefer
2015-08-09 13:53                                   ` Mathias Fredriksson
2015-08-09 23:42                                     ` Bart Schaefer
2015-08-10  0:02                                       ` Mikael Magnusson
2015-08-10  0:16                                         ` Mathias Fredriksson
2015-08-10  1:47                                           ` Bart Schaefer
2015-08-10  2:02                                             ` Mikael Magnusson
2015-08-10 15:59                                               ` Bart Schaefer
2015-08-10 17:30                                                 ` Mathias Fredriksson
2015-08-10  0:36                                         ` Bart Schaefer
2015-08-10  0:29                                       ` Bart Schaefer
2015-08-10 19:34                                     ` Bart Schaefer
2015-08-10 21:17                                       ` Mathias Fredriksson
2015-08-10 22:53                                         ` Mathias Fredriksson
2015-08-11  0:53                                           ` Bart Schaefer
2015-08-11 12:17                                             ` Mathias Fredriksson
2015-08-11 14:38                                               ` Mathias Fredriksson
2015-08-11 15:07                                               ` Bart Schaefer
2015-08-11 15:22                                                 ` Mathias Fredriksson
2015-08-11  4:06                                           ` Running commands in a zpty worker Bart Schaefer
2015-08-11 13:14                                             ` Mathias Fredriksson
2015-08-11 14:35                                               ` Mathias Fredriksson
2015-08-11 14:37                                               ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+=GgY7cg9aDJxN--wcX=+MSD9dd2To3fSm9ecsd=tF1zg=zbQ@mail.gmail.com' \
    --to=mafredri@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).