From 92f230e22054626e1c462e58ada303559b08891b Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Wed, 6 Jun 2018 12:56:27 +0200 Subject: [PATCH] fixed a bug when compiling with -DNDEBUG --- src/external/libCuba/src/common/Fork.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/external/libCuba/src/common/Fork.c b/src/external/libCuba/src/common/Fork.c index 82e21349..358cefdc 100644 --- a/src/external/libCuba/src/common/Fork.c +++ b/src/external/libCuba/src/common/Fork.c @@ -95,9 +95,16 @@ Extern void SUFFIX(cubafork)(Spin **pspin) for( core = -spin->spec.naccel; core < spin->spec.ncores; ++core ) { int fd[2]; pid_t pid; + //as35 the next two if's fix the crash when compiling with -DNDEBUG + if (socketpair(AF_LOCAL, SOCK_STREAM, 0, fd) == -1) + assert(0); + if ((pid = fork()) == -1) + assert(0); + /*//as35 see comment just above assert( socketpair(AF_LOCAL, SOCK_STREAM, 0, fd) != -1 && (pid = fork()) != -1 ); + */ if( pid == 0 ) { close(fd[0]); free(spin);