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
5
votes
1 answer

iOS SWIFT application - How to ignore SIGPIPE signal globally?

I am trying to ignore SIGPIPE signal that is thrown by a third party SDK I am using in my Swift application. How do I make my application ignore SIGPIPE signal globally?
Natasha
  • 53
  • 4
5
votes
3 answers

Check for a broken pipe before trying to write to it?

Is it possible to check if a pipe is broken before trying to write/read to it, so I can just skip it and continue with the program? I'm utilizing a while loop to write to pipes communicating from the Parent to multiple Children. Over the course of…
LazyBear
  • 343
  • 1
  • 7
  • 23
5
votes
3 answers

Writing on a TCP socket closed by the peer

I have a client-server application where each side communicate with the other via TCP socket. I properly establish the connection and then I crash the server BEFORE any data is written on the socket by the client. What I see is that the first…
JustTrying
  • 592
  • 4
  • 9
  • 23
4
votes
1 answer

`last` while reading file from external command crashes perl

I have the following code: #!/usr/bin/env perl use 5.0360; use warnings FATAL => 'all'; use autodie ':default'; use Devel::Confess 'color'; # not essential, but better error reporting open my $view, "zcat a.big.file.vcf.gz|"; # zcat or…
con
  • 5,767
  • 8
  • 33
  • 62
4
votes
1 answer

Python - How to catch a broken pipe

I have just learned about SIGPIPE, and then read about how to handle these in Python. Among other sources, I have read: How to handle a broken pipe (SIGPIPE) in python? Let's say that the pipe reading script exits, then all the answers suggest that…
Mads Skjern
  • 5,648
  • 6
  • 36
  • 40
4
votes
1 answer

SIGPIPE crash when switching background task

I'm experiencing a weird crash when sending my app into the background, loading a new app, switching the device into sleep mode, waking up the device, closing the new app and then opening my app from the background tasks. A black screen will appear…
laurence
  • 41
  • 1
  • 3
4
votes
2 answers

TCP client-server SIGPIPE

I am designing and testing a client server program based on TCP sockets(Internet domain). Currently , I am testing it on my local machine and not able to understand the following about SIGPIPE. *. SIGPIPE appears quite randomly. Can it be…
footloose
  • 167
  • 1
  • 4
  • 18
4
votes
1 answer

Network code stopping with SIGPIPE

I am developing in iOS. The App call the function in library , and send the packet via wifi. When the App is running , I push the power button(not home button) on iPhone 5C and push again to open it. But it crash... And it did not show which line…
Martin
  • 2,813
  • 11
  • 43
  • 66
4
votes
2 answers

C++ & OpenSSL: SIGPIPE when writing in closed pipe

I'm coding a C++ SSL Server for TCP Connections on Linux. When the program uses SSL_write() to write into a closed pipe, a SIGPIPE-Exception gets thrown which causes the program to shut down. I know that this is normal behaviour. But the program…
Bobface
  • 2,782
  • 4
  • 24
  • 61
4
votes
3 answers

Broken pipe (EPIPE) on connection to loopback address

I'm currently testing my networking code. This involves making a connection via the IPv4 loopback address (127.0.0.1). Unfortunately the program often (not always) gives an EPIPE error on sending data. I am using Berkeley network sockets and…
Matthew Mitchell
  • 5,293
  • 14
  • 70
  • 122
4
votes
2 answers

In Linux crontab, stderr of my program must be redirected, why?

I write a program, which can output to stderr. When I run it by Linux crontab, I must redirect the stderr. if not, the program will exit with a SIGPIPE. Why? NOT OK 45 10 * * * /home/sandy/test > /home/sandy/test.log & OK 45 10 * * *…
sandy
  • 41
  • 1
3
votes
1 answer

SIGPIPE With Running Program

I have two daemons, and A is speaking to B. B is listening on a port, and A opens a tcp connection to that port. A is able to open a socket to B, but when it attempts to actually write said socket, I get a SIGPIPE, so I'm trying to figure out where…
dbeer
  • 6,963
  • 3
  • 31
  • 47
3
votes
1 answer

How to avoid SIGPIPE (due to a timeout?) when debugging an X11 program?

Sometimes, when I'm debugging my Qt program on X11, I need to have a breakpoint at a point when the program has created a window (QWidget), but no window has yet been shown. In this case, when I resume the program from this breakpoint after some…
Ruslan
  • 18,162
  • 8
  • 67
  • 136
3
votes
0 answers

python3: SIGPIPE missing from my signal lib

I have a program that previously used the following declaration at the top of it. # no idea what this does but maybe it stops a SIGPIPE broken error from occuring. from signal import signal, SIGPIPE, SIG_DFL signal(SIGPIPE,SIG_DFL) The program…
Zac
  • 75
  • 2
  • 15
3
votes
1 answer

Why doesn't my SIGPIPE print the message?

$ perl5.8 -w -e 'if (my $pid=open(my $P, "|-")) { kill("SIGKILL",$pid); sleep(2); print $P "test1:$pid\n";}; ' Broken pipe Now I'm trying to catch that broken pipe $ perl5.8 -w -e '$SIG{PIPE} = sub {print "SIGPIPE\n";return 1}; if (my…
DVK
  • 126,886
  • 32
  • 213
  • 327