diff --git a/utest/test_fork.c b/utest/test_fork.c index 558026031b..44a619349a 100644 --- a/utest/test_fork.c +++ b/utest/test_fork.c @@ -33,6 +33,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #include #include "openblas_utest.h" @@ -41,7 +42,7 @@ static void* xmalloc(size_t n) void* tmp; tmp = malloc(n); if (tmp == NULL) { - fprintf(stderr, "You are about to die\n"); + fprintf(stderr, "Failed to allocate memory for the testcase.\n"); exit(1); } else { return tmp; @@ -103,6 +104,7 @@ exit(0); fork_pid = fork(); if (fork_pid == -1) { + perror("fork"); CTEST_ERR("Failed to fork process."); } else if (fork_pid == 0) { // Compute a DGEMM product in the child process to check that the @@ -113,7 +115,8 @@ exit(0); // recursively fork_pid_nested = fork(); if (fork_pid_nested == -1) { - CTEST_ERR("Failed to fork process."); + perror("fork"); + CTEST_ERR("Failed to fork nested process."); exit(1); } else if (fork_pid_nested == 0) { check_dgemm(a, b, d, c, n); diff --git a/utest/test_post_fork.c b/utest/test_post_fork.c index 6d640aebb6..d6e87f2ba2 100644 --- a/utest/test_post_fork.c +++ b/utest/test_post_fork.c @@ -33,6 +33,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #include #ifdef USE_OPENMP #include @@ -44,7 +45,7 @@ static void* xmalloc(size_t n) void* tmp; tmp = malloc(n); if (tmp == NULL) { - fprintf(stderr, "You are about to die\n"); + fprintf(stderr, "Failed to allocate memory for the test payload.\n"); exit(1); } else { return tmp; @@ -114,7 +115,11 @@ exit(0); fork_pid = fork(); if (fork_pid == -1) { - CTEST_ERR("Failed to fork process."); + perror("fork"); + CTEST_ERR("Failed to fork subprocesses in a loop."); +#ifdef USE_OPENMP + CTEST_ERR("Number of OpenMP threads was %d in this attempt.",i); +#endif } else if (fork_pid == 0) { // Just pretend to do something, e.g. call `uname`, then exit exit(0);