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
3
votes
6 answers

SIGPIPE (OSX) and disconnected sockets?

I'm working on an app which connects to a server via TCP. If the socket for whatever reason is closed, I end up in the SIGPIPE handler. What do I do so that recv and send just returns an error on a disconnected/closed socket? Thanks
user1884325
  • 2,530
  • 1
  • 30
  • 49
3
votes
5 answers

How to catch sigpipe in iphone app?

How can i catch sigpipe in iphone/objective-c? thanks
Shay
  • 2,595
  • 3
  • 25
  • 35
3
votes
3 answers

Preventing SIGPIPE

Let's consider the following example. I have a parent process that creates a pipe, spawns a child and read the child's standard output using this pipe. At some point, the parent process is no longer interested in the child's output, and closes the…
user500944
2
votes
1 answer

Postgresql initdb - Segmentation fault (core dumped)

I did some changes of pgsql source code, such as adding a new system catalog. Then I wanted to init the database by using initdb -D PG_DATA_PATH. But it came to this problem: The files belonging to this database system will be owned by user…
2
votes
1 answer

PHP how to simulate SIGPIPE?

My environment: Ubuntu 18.04 LTS PHP 7.2.2 ZTS no-debug I have a big application where sometimes Broken pipe error is happening. I want to handle it but for this I need to simulate this error for development. How can I do that ? I have…
Mikael
  • 1,209
  • 1
  • 16
  • 47
2
votes
1 answer

What is server side socket best practice to handle multithread broken pipe case on Linux?

considering being new to C language on Linux, I've walked through socket programing scenarios where you have to handle that SIGPIPE issues and I've faced the fllowing cases: 1- catch sigaction for the process then continue, which equals ignoring the…
2
votes
1 answer

Ignoring/blocking SIGPIPE signals in multi-threaded linux program

I have the following situation: Thread 1: Forks a child and the child, say A in turn forks again and executes a process. B Thread 2: Listens for commands over a Unix Domain Socket and kills the process, B that has been forked by child, A in Thread…
HackX123
  • 107
  • 1
  • 9
2
votes
0 answers

EPIPE (Broken pipe) with spark pipe action

I am trying to run a spark application with yarn. The application uses the pipe() action to run a local php program. The wired thing is that every time the PHP process is started, it will receive a SIGPIPE signal about 1 minute later (after a few…
Bill
  • 41
  • 3
2
votes
1 answer

write on closed connection doesn't generate sigpipe immediately

I've this problem with my server/client on C. If I close the server socket after a SIGINT, and then I try to write on this closed connection from the client, I've to do write two times before than client generates SIGPIPE. Shouldn't it generate it…
testermaster
  • 1,031
  • 6
  • 21
  • 40
2
votes
1 answer

SIGPIPE error on IOS 6.0 even when ignoring SIGPIPE signal

In my sample app it shows SIGPIPE error even though I ignored that signal on my main.m file #import #import "AppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { signal(SIGPIPE, SIG_IGN); return…
Tahlil
  • 2,680
  • 6
  • 43
  • 84
2
votes
1 answer

How to avoid SIG_PIPE crashing in IOS

I have been facing the SIGPIPE crashing frequently, I know its because of connection problem, one of my socket is trying to write after lost connection, but problem is I don't have here control over the socket descriptors (Got tcp class as .a), to…
Newbee
  • 3,231
  • 7
  • 42
  • 74
2
votes
1 answer

Linux SIGPIPE Crashing Server

So at the start of my application I call signal(SIGPIPE, SIG_IGN); which I thought would have my application ignore SIGPIPE. However I still got a SIGPIPE crash with the following code: write(fd, outgoingStr->c_str(), size); where fd is an int…
Josh Brittain
  • 2,162
  • 7
  • 31
  • 54
2
votes
1 answer

Perl writing to file stream causing unexpected SIGPIPE error

I have the following perl code which tries to write a string to a newly created file: open(OUT, ">$file") or die "file out error!\n"; print OUT $string; Normally, this code works fine. If we do not have write permissions to the directory where…
jcee14
  • 908
  • 3
  • 15
  • 28
1
vote
2 answers

How to tell if a downstream process in a Unix pipe has crashed

I have a Linux process (let's call it the main process) whose standard output is piped to another process (called the downstream process) by means of the shell's pipe operator (|). The main process is set up to receive SIGPIPE signals if the…
Randall Cook
  • 6,728
  • 6
  • 33
  • 68
1
vote
1 answer

Broken pipe with built_in command like echo

I have some issue in my program. I have a school homework where I have to reproduce some features of bash The homework is almost done however I have an issue with built_in command and pipes indeed I have a broken pipe error whenever a built_in…
dieri
  • 23
  • 6