Questions tagged [sigpipe]

SIGPIPE is the signal sent to a process when it attempts to write to a pipe without a process connected to the other end.

On POSIX-compliant platforms, SIGPIPE is the signal sent to a process when it attempts to write to a pipe without a process connected to the other end. The symbolic constant for SIGPIPE is defined in the header file signal.h. Symbolic signal names are used because signal numbers can vary across platforms.

95 questions
296
votes
10 answers

How to prevent SIGPIPEs (or handle them properly)

I have a small server program that accepts connections on a TCP or local UNIX socket, reads a simple command and (depending on the command) sends a reply. The problem is that the client may have no interest in the answer and sometimes exits early. …
jkramer
  • 15,440
  • 5
  • 47
  • 48
117
votes
10 answers

IOError: [Errno 32] Broken pipe when piping: `prog.py | othercmd`

I have a very simple Python 3 script: f1 = open('a.txt', 'r') print(f1.readlines()) f2 = open('b.txt', 'r') print(f2.readlines()) f3 = open('c.txt', 'r') print(f3.readlines()) f4 = open('d.txt',…
JOHANNES_NYÅTT
  • 3,215
  • 7
  • 20
  • 24
48
votes
5 answers

Program received signal SIGPIPE, Broken pipe

I write a client program based on posix sockets. The program creates multiple threads and is going to lock the server. But during debug in gdb time the program gives an info (error) (gdb) n Program received signal SIGPIPE, Broken pipe. [Switching…
user1886376
28
votes
5 answers

Ignoring Bash pipefail for error code 141

Setting the bash pipefail option (via set -o pipefail) allows the script to fail if a non-zero error is caught where there is a non-zero error in any step of a pipe. However, we are running into SIGPIPE errors (error code 141), where data is written…
Alex Reynolds
  • 95,983
  • 54
  • 240
  • 345
16
votes
4 answers

Why does this C program generate SIGPIPE later than expected?

This program generates SIGPIPE after piping it to "head -n 1", after a random time. I understand that because we're feeding more to "head -n 1" after the first line, we would expect it to generate SIGPIPE, but instead it will make it to a random…
Bim Sala
  • 163
  • 4
9
votes
2 answers

Piping a command's output to ':' command

I am updating an old script and came across a pattern I am unfamiliar with: # NOTE The | : always returns true so the doesn't fail | : I've only ever seen this pattern used in a fork bomb example. If someone were to ask me how to…
aka
  • 93
  • 4
9
votes
1 answer

What does this UWSGI error mean? " SIGPIPE: writing to a closed pipe/socket/fd "

There are a few questions related to this issue, but none of them actually help me understand what is going on. The full error: SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request
Mitchell van Zuylen
  • 3,905
  • 4
  • 27
  • 64
8
votes
0 answers

subprocess.CalledProcessError died with

I'm using a python package with python subprocessing command. When I qsub several jobs in parallel, it shows the error: subprocess.CalledProcessError: died with multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File…
Simon Niu
  • 91
  • 5
7
votes
1 answer

SIGPIPE exception in iOS Project With BUMP API Integrated

I am experiencing a SIGPIPE error in my Xcode Project. This error has been started showing since one week before. If I commented this method call : [self configureBump]; everything works fine. I had integrated BUMP API in my project. This API is…
jay
  • 3,517
  • 5
  • 26
  • 44
6
votes
3 answers

Can writes to a datagram socket ever raise SIGPIPE?

I'm working with some code that needs to be safe against killing the caller due to SIGPIPE, but the only socket writes it's performing are going to datagram sockets (both UDP and Unix domain datagram sockets). Do I need to worry about SIGPIPE? I'm…
R.. GitHub STOP HELPING ICE
  • 208,859
  • 35
  • 376
  • 711
5
votes
1 answer

Using signals and sigpipe

I'm working on an assignment that involves writing a program to process data (calculate pi) using fork (processes), signals and select. I'm working right now on the signals and what I think I want to do is to use SIGPIPE so if the programs catches…
andrepcg
  • 1,301
  • 7
  • 26
  • 45
5
votes
2 answers

AsyncUDPSocket broken pipe after locking phone with application suspended in background

I'm using the AsyncUDPSocket third party library in my iPhone app and for the most part it works great. I have a singleton instance of an AsyncUDPSocket that I use for all my network traffic. My app is registered for location tracking in the…
Kongress
  • 2,244
  • 3
  • 20
  • 30
5
votes
1 answer

Python subprocess.Popen PIPE and SIGPIPE

While I browsed posts, I ran into this example below on here, It is saying proc1.stdout.close() is needed to be called for appropriate exit of proc1, generating SIGPIPE. import subprocess proc1 = subprocess.Popen(['ps', 'cax'],…
SangminKim
  • 8,358
  • 14
  • 69
  • 125
5
votes
2 answers

Handling SIGPIPE error in snakemake

The following snakemake script: rule all: input: 'test.done' rule pipe: output: 'test.done' shell: """ seq 1 10000 | head > test.done """ fails with the following error: snakemake -s…
dariober
  • 8,240
  • 3
  • 30
  • 47
5
votes
3 answers

Disable SIGPIPE signal on write(2) call in library

Question Is it possible to disable the raising of a signal (SIGPIPE) when writing to a pipe() FD, without installing my own signal handler or disabling/masking the signal globally? Background I'm working on a small library that occasionally creates…
Cloud
  • 18,753
  • 15
  • 79
  • 153
1
2 3 4 5 6 7