unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#68087: Signal handlers not called after ‘primitive-fork’
@ 2023-12-28 17:16 Ludovic Courtès
  2024-01-05 18:14 ` bug#68087: [PATCH] Stop signal thread before forking, restart it afterwards Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2023-12-28 17:16 UTC (permalink / raw)
  To: 68087

In 3.0.9 and current ‘main’, I get this:

--8<---------------cut here---------------start------------->8---
$ cat sigaction-fork.scm
(use-modules (ice-9 match))

;; This call spawns the signal delivery thread as a side effect.
(sigaction SIGALRM
  (lambda (signal)
    (pk 'got-signal! signal)))

(match (primitive-fork)
  (0
   (pk 'child (getpid))
   (sigaction SIGALRM
     (lambda (signal)
       ;; This handler is never called!
       (pk 'got-signal-child! signal)))
   (kill 0 SIGALRM)
   (pk 'alarm-sent))
  (_
   (primitive-exit 0)))
$ guile sigaction-fork.scm

;;; (child 30308)

;;; (alarm-sent)
--8<---------------cut here---------------end--------------->8---

Everything works fine if we remove the pre-fork ‘sigaction’ call.

Ludo’.





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

end of thread, other threads:[~2024-01-24 10:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-28 17:16 bug#68087: Signal handlers not called after ‘primitive-fork’ Ludovic Courtès
2024-01-05 18:14 ` bug#68087: [PATCH] Stop signal thread before forking, restart it afterwards Ludovic Courtès
2024-01-24 10:34   ` bug#68087: Signal handlers not called after ‘primitive-fork’ Ludovic Courtès

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 read-only IMAP folder(s) and NNTP newsgroup(s).