[CRIU] [PATCH 1/5] socket-tcp: ignore SIGPIPE

Mike Rapoport rppt at linux.ibm.com
Thu Nov 29 10:26:14 MSK 2018


On Wed, Nov 28, 2018 at 11:21:23PM -0800, Andrei Vagin wrote:
> On Wed, Nov 28, 2018 at 09:35:04AM +0200, Mike Rapoport wrote:
> > On Tue, Nov 27, 2018 at 08:45:41PM +0300, Andrei Vagin wrote:
> > > In this tests, we are trying to read from closed sockets.
> > 
> > And? ;-)
> > 
> > A few more words would be really nice.
> 
> Actually we are trying to write into a closed socket and the kernel
> sends SIGPIPE in this case.

"which is perfectly normal and should not fail the test"

;-)
 
> >  
> > > Signed-off-by: Andrei Vagin <avagin at gmail.com>
> > > ---
> > >  test/zdtm/static/socket-tcp-closed.c  | 2 ++
> > >  test/zdtm/static/socket-tcp-reseted.c | 2 ++
> > >  2 files changed, 4 insertions(+)
> > > 
> > > diff --git a/test/zdtm/static/socket-tcp-closed.c b/test/zdtm/static/socket-tcp-closed.c
> > > index 0447e95b2..a51f9b96d 100644
> > > --- a/test/zdtm/static/socket-tcp-closed.c
> > > +++ b/test/zdtm/static/socket-tcp-closed.c
> > > @@ -23,6 +23,7 @@ const char *test_author = "Andrey Vagin <avagin at openvz.org";
> > >  #include <signal.h>
> > >  #include <netinet/tcp.h>
> > >  #include <arpa/inet.h>
> > > +#include <signal.h>
> > > 
> > >  static int port = 8880;
> > > 
> > > @@ -43,6 +44,7 @@ int main(int argc, char **argv)
> > >  #endif
> > > 
> > >  	test_init(argc, argv);
> > > +	signal(SIGPIPE, SIG_IGN);
> > > 
> > >  	sk = socket(ZDTM_FAMILY, SOCK_STREAM, 0);
> > >  	if (sk < 0) {
> > > diff --git a/test/zdtm/static/socket-tcp-reseted.c b/test/zdtm/static/socket-tcp-reseted.c
> > > index ce52e1148..07ad36009 100644
> > > --- a/test/zdtm/static/socket-tcp-reseted.c
> > > +++ b/test/zdtm/static/socket-tcp-reseted.c
> > > @@ -5,6 +5,7 @@
> > >  #include <arpa/inet.h>  /* for sockaddr_in and inet_ntoa() */
> > >  #include <stdlib.h>
> > >  #include <sys/wait.h>
> > > +#include <signal.h>
> > > 
> > >  #ifdef ZDTM_IPV4V6
> > >  #define ZDTM_FAMILY AF_INET
> > > @@ -38,6 +39,7 @@ int main(int argc, char **argv)
> > >  	char cmd[4096], buf[10];
> > > 
> > >  	test_init(argc, argv);
> > > +	signal(SIGPIPE, SIG_IGN);
> > > 
> > >  	if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
> > >  		pr_err("initializing server failed\n");
> > > -- 
> > > 2.14.4
> > > 
> > > _______________________________________________
> > > CRIU mailing list
> > > CRIU at openvz.org
> > > https://lists.openvz.org/mailman/listinfo/criu
> > > 
> > 
> > -- 
> > Sincerely yours,
> > Mike.
> > 
> 

-- 
Sincerely yours,
Mike.



More information about the CRIU mailing list