A fatal signal on a worker thread ends only that thread
Les mainteneurs répondent en général sous 2 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 68/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- c, linux
- Domaine
- operating-systems
Piste de recherche
Read src/syscall/signal.c and src/syscall/proc.c to trace how a Term or Core default action stops a vCPU, then compare the main-thread and worker paths in src/core/launch.c and src/runtime/forkipc.c. Add the worker-only SIGTERM reproduction described in the issue and extend test-rlimit-cpu for worker-only SIGXCPU. Done means either signal ends the whole thread group with the expected signal status.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
When a worker thread dequeues a signal whose default action is Term or Core, elfuse ends that worker and leaves the rest of the thread group running. On Linux, get_signal in kernel/signal.c calls do_group_exit for a fatal signal, so every thread in the group exits regardless of which one took it.
signal_deliver in src/syscall/signal.c returns -1 for a Term or Core default action and sets the exit code, but it does not request a group exit. The run loop in src/syscall/proc.c stops the vCPU on that -1. What happens next depends on the thread: the main thread's path in src/core/launch.c calls proc_request_exit_group whenever its run loop returns, while a worker's path in src/runtime/forkipc.c discards the return value of vcpu_run_loop, runs its robust-list and clear-child-tid cleanup, and exits alone.
RLIMIT_CPU (#475) is the case that exposes it: the sampler queues one SIGKILL at the hard limit and then returns, so if a worker dequeues it, the remaining threads run past the hard limit with nothing left to send it again. A default-action SIGXCPU at the soft limit has the same gap.
Reproduction: the main thread creates a spinning worker, then blocks SIGTERM with pthread_sigmask, sleeps, and sends kill(getpid(), SIGTERM). Only the worker can take the signal. On Linux the process dies with SIGTERM. Reading the code, elfuse ends only the worker and the main thread keeps running.
Follow-ups
- Request the group exit in delivery: a Term or Core default action taken on any thread ends the whole thread group with that signal's status, as
do_group_exitdoes on Linux. - Add a test with the reproduction above: a process-directed SIGTERM that only a worker can take ends the process with SIGTERM.
- Extend
test-rlimit-cpuwith a worker-only case: the main thread blocks SIGXCPU and spins, a worker spins with SIGXCPU at its default action, and the process ends with SIGXCPU at the soft limit. A SIGKILL case cannot force the worker, since SIGKILL cannot be blocked.
- Langage dominant
- C
- Étoiles
- 278
- Forks
- 31
- Merge moyen
- 2 j 18 h
- PR mergées (30 j)
- 16
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de sysprog21/elfuse
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
Les mainteneurs répondent en général sous 2 jours
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 2 jours
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de sysprog21/elfuse
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 79/100
Les mainteneurs répondent en général sous 2 jours
-
BUG: linalg.bandwidth: misses the upper band in a wide matrix's last rowPeut-être pris @ilayn l’a pris il y a 205 jours. Ouvertedefect scipy.linalg
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
scipy/scipy#26579 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 80/100
Les mainteneurs répondent en général sous 1 jour