Questions tagged [signals]
A signal is a message which can be sent to a running process. Signals can be initiated by programs, users, or administrators.
630 questions
1vote
2answers
33views
Why a signal that is blocked not shown up in SigPnd of /proc/pid/status when it is sent
Fact A signal may be blocked, which means that it will not be delivered until it is later unblocked. Between the time when it is generated and when it is delivered a signal is said to be pending. ...
2votes
1answer
62views
Detectng missed SIGWINCH in Bash extension, when apparent terminal size has not changed
I maintain an extension for the Bash environment called Basta. Basta provides a scroll-protected status line at the bottom of your ANSI/VT100 terminal. When Basta sets itself up, the effective number ...
3votes
2answers
112views
Why does the linux manual say nothing about generating a SIGCHLD signal when the child resumes execution?
I am using linux (ubuntu). When I type man 7 signal (manual 2020-12-21) in my terminal, I find the following for the SIGCHLD: SIGCHLD P1990 Ign Child stopped or terminated So, it states ...
2votes
1answer
193views
Why does the SIGCHLD generated by process continuation not activate the trap?
I am using linux (Ubuntu) and bash. I made a simple Go program. Literally infinite for-loop that prints text every 20 seconds. package main import ( "fmt" "time" ) func ...
2votes
1answer
58views
Why does the termination of the parent terminate the child when it is in the suspend (T) state?
I am using Ubuntu (linux). I have the following two simple programs. Parent: package main import ( "fmt" "syscall" "time" ) func main() { attr := &...
1vote
2answers
91views
Why does the kill command not work for SIGTSTP, but works for some other signals (SIGSTOP/SIGINT etc.)?
I have the following two simple programs. Parent: package main import ( "fmt" "syscall" ) func main() { attr := &syscall.ProcAttr{ Files: []uintptr{0, 1, ...
0votes
1answer
86views
Why does a SIGTSTP signal not handled by the parent move the entire group to the background (contrary to written in TTY demystified)?
I started learning about linux tty(s) and signals and ran into some trouble. I am reading and using The TTY demystified as a reference. I made two simple golang programs. Parent: package main import (...
0votes
0answers
43views
Why does sudo change process session id using setsid()?
I've been writing a script that spawns a child process as a different user via sudo then I realized that my script is not getting SIGINT as opposed to when I run it without sudo. As suspected strace ...
1vote
1answer
57views
Hit a strange signal settings of a kernel thread in Linux
I am working on an embedded Linux system (kernel-5.10.24), and using busybox as init. Now I hit a strange problem about signal settings of a kernel thread in system. The kernel thread is from a device ...
1vote
2answers
53views
Failed to core dump with send_sig(task, SIGSEGV, 1) from Linux kernel
I am working in an embedded Linux system, and now I want to trigger a core dump from within kernel by using send_sig(task, SIGSEGV, 1). There is a process A having 10 threads, occasionally, there is a ...
1vote
1answer
43views
Prevent SIGINT propagation from subshell to parent shell in Zsh
I need to prevent SIGINT (Ctrl-C) from propagating from a subshell to its parent shell functions in Zsh. Here's a minimal example: function sox-record { local output="${1:-$(mktemp).wav}"...
1vote
1answer
106views
Is there a race condition in bash when terminating a script with a subprocess with a signal?
#!/bin/bash ( sleep 10; echo foo; ) echo bar start to run the code during the sleep, send SIGINT (Ctrl+C) is there a chance of ever seeing "bar" on the output? The reasoning being: () ...
13votes
3answers
934views
Inconsistent “unzip -l … | grep -q …” results with pipefail
The following Bash function gave inconsistent results: # $1 Path to ZIP archive. # Exits with 0 status iff it contains a “.mp3” or “.flac” file. mp3_or_flac_in_zip() { local archive=${1:?No ...
1vote
1answer
135views
A few potential race conditions with signals and PIDs
I'm aware that because of PID-reuse on Unix-like kernels, signals can be delivered to the wrong process if they are sent after the PID has already been reaped. Discussion of what follows will probably ...
0votes
0answers
28views
EINTR implementation in the kernel sources - statfs & newfstatat
I'm trying to locate where in the kernel source files does statfs and newfstatat syscalls might fail with EINTR (due to a pending signal). The man pages list EINTR as one of the possible errors these ...