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
1
vote
1 answer

App crashes with SIGPIPE exception after doing a wrong connection to FTP server

I try to make an app that can make a connection into a FTP server. I've use Chilkat library to do this connection. The problem is, I want to test my app and make a wrong connection. So i make a connection into my FTP server, but using SSL connection…
R. Dewi
  • 4,141
  • 9
  • 41
  • 66
1
vote
1 answer

How to ensure popen()ed process runs destructors on exit?

If I have a pipe to run some command, the piped command needs to do some cleanup, however, if the processes that started the pipe has an error, the piped command is not cleaning up. Is the piped command getting SIGPIPE in this case? How can I…
WilliamKF
  • 41,123
  • 68
  • 193
  • 295
1
vote
1 answer

JVM not killed on SIGPIPE

What is the reason for the JVM handling SIGPIPE the way it does? I would've expected for java foo | head -10 with public class Foo { public static void main(String[] args){ Stream.iterate(0, n -> n + 1).forEach(System.out::println); …
leyren
  • 524
  • 6
  • 20
1
vote
1 answer

Why does python generate sigpipe exception on closing a fifo file?

TL;DR: Why does closing a fifo file (named pipe) that received a SIGPIPE exception generate another SIGPIPE exception? My python script is writing bytes to another process, which is a subprocess of my python process, through a FIFO file. (There are…
Zhiyao
  • 4,152
  • 2
  • 12
  • 21
1
vote
1 answer

Run two functions at the same time in Python

This is a simple code for multi threading in python. p1 = multiprocessing.Process(target=f1, args=('f1')) p2 = multiprocessing.Process(target=f2, args=('f2')) p1.start() # starting process 2 p2.start() # wait until process 1 is finished…
1
vote
0 answers

Python subprocess.run CalledProcessError while running rsh

I am running a script on a remote machine as: subprocess.run( ["rsh", self.target] + shlex.split(cmd), check=True ) The command always runs successfully on the remote machine, but as soon as it finishes on the remote machine, I get a…
Ojas
  • 483
  • 1
  • 4
  • 11
1
vote
2 answers

Does any of the TCP Settings impact SIGPIPE?

I tested the same testcode (Server - Client) on two systems. In one I am getting a SIGPIPE, in another I am not getting SIGPIPE. The Test Scenario is something like below: Client Connect to a Server Receive Data from Server Send Data Close the…
Jay
  • 24,173
  • 25
  • 93
  • 141
1
vote
1 answer

SIGPIPE error in iOS4 when app is running background and lock screen

I use BSD socket in my app to send and receive data on iphone4(iOS4.1),there are three situations in my app: app is running in foreground and screen locks, it's fine. app is running in background and screen does't lock, it's fine too(I use NSStream…
Joe Qian
  • 493
  • 6
  • 13
1
vote
1 answer

Why is OpenSSL causing a sigpipe @ SSL_connect?

int sfd = socket(AF_INET6, SOCK_STREAM, 0); if (sfd < 0) continue; struct timeval timeout; timeout.tv_sec = 60; timeout.tv_usec = 0; setsockopt(sfd, SOL_SOCKET, SO_RCVTIMEO, (char *) &timeout, sizeof(timeout)); …
JavaProphet
  • 931
  • 14
  • 29
1
vote
2 answers

What 's the meaning of the number 1 in SIG_IGN macro definition?

#define SIG_IGN (void (*)(int))1 #define SIG_HOLD (void (*)(int))5 #define SIG_ERR ((void (*)(int))-1) I know what (void (*)(int)) means: cast unknown_name into pointer to function (int) returning void. But what's the meaning of the…
Andy Hu
  • 97
  • 1
  • 7
1
vote
1 answer

C signal (sigpipe, sighup) via Socket

I've to handle the SIGHUP and the SIGPIPE signal in order to avoid that a CLIENT, connected via Socket TCP, closing the terminal (The [X] of the GUI) hadn't to close or crash the SERVER. I've set on the client a sigup handler like this void…
1
vote
0 answers

411 response results in exception in Session.send

UPDATE: The kind folks developing Requests.py are on the case. We're interacting (testing) with a HTTP service that responds with a 411 (Length Required) status code when no Content-Length request header has been supplied in the presence of a…
Ben Crowhurst
  • 8,204
  • 6
  • 48
  • 78
1
vote
1 answer

Cannot catch SIGPIPE signal in Ubuntu

I met a SIGPIPE crash issue and I would like to log it and try to exist. But I could not catch SIGPIPE via follow code. I try to use "kill -s signal process" to verify my code, it works with signal SIGINT, SIGSTOP, SIGSEGV and SIGALRM. But failed…
Evan Lin
  • 1,272
  • 1
  • 12
  • 25
1
vote
1 answer

Trap SIGPIPE when trying to write without reader

I am trying to implement a named-pipe communication solution between two processes in Bash. The first process writes something to the named pipe: send(){ echo 'something' > $NAMEDPIPE } And the second script is supposed to read the named pipe…
Matt
  • 162
  • 2
  • 11
1
vote
2 answers

writing to a close socket didn't raise a SIGPIPE as expected

I've already read about how to prevent SIGPIPE, then I write a small program to test it. Here is the code. server.c #include #include #include #include #include #include #include…
jfly
  • 7,715
  • 3
  • 35
  • 65