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.
634 questions
3 votes
2 answers
147 views
How can restart_syscall restart syscalls that are not restartable?
Let's read man 2 restart_syscall: restart_syscall() is used for restarting only those system calls that, when restarted, should adjust their time-related parameters—namely poll(2) (since Linux 2.6.24)...
9 votes
4 answers
666 views
How can we get tar to respect SIGKILL like it used to?
From time to time I need to do a quick check of contents of an Ultrium tape, which can store even 6TB of data. To avoid reading the entire tape, I used to perform following procedure (in a loop): $ ...
4 votes
0 answers
237 views
Confused about SIGINT trap
I am confused about the processing of SIGINT and EXIT traps in Bash scripts. I wrote this script to test: #!/usr/bin/env bash set -e exit_trap() { printf "In exit_trap \$?=$?\n" exit 0 ...
0 votes
0 answers
37 views
Signal handling in debugger in linux
I am working on a debugger and found an issue. I start at the beginning of the dynamic linker (this is a low-level debugger). At this address, I set it so that for a particular signal, the process ...
4 votes
1 answer
261 views
Why SIGTSTP (^Z/Ctrl-Z/suspend) doesn't work when process blocked redirecting write into a FIFO/pipe not open for reading yet? And what to do then?
Sometimes, a command is stalled attempting to write to a FIFO/pipe that no other process is currently reading from, but typing Ctrl-Z to put the process to the background by sending it the SIGTSTP ...
1 vote
2 answers
70 views
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. ...
2 votes
1 answer
133 views
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 ...
3 votes
2 answers
211 views
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 ...
2 votes
1 answer
337 views
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 ...
2 votes
1 answer
94 views
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 := &...
1 vote
2 answers
192 views
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, ...
0 votes
1 answer
200 views
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 (...
0 votes
0 answers
68 views
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 ...
1 vote
1 answer
99 views
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 ...
1 vote
2 answers
134 views
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 ...