From ab8562fdad7bf1a56189f3ae491aceaa49a510fb Mon Sep 17 00:00:00 2001 From: brarcher Date: Sat, 28 Sep 2013 03:10:42 +0000 Subject: [PATCH] Print an error if nothing is read from punpack() There is some issue with MinGW-w64 builds run on wine, if multiple unit test programs are run concurrently. Sometimes they will fail to get something from punpack. It may be a failure to read the file, or the file, or some other issue. When this happens, later in receive_test_result the rmesg is free'd, but only by freeing its elements first, which causes a segfault. Instead of crashing, check should error out gracefully. git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@813 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- src/check_msg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/check_msg.c b/src/check_msg.c index fcb6352..a011c3d 100644 --- a/src/check_msg.c +++ b/src/check_msg.c @@ -121,6 +121,12 @@ TestResult *receive_test_result (int waserror) eprintf ("Error in call to get_pipe",__FILE__, __LINE__ - 2); rewind(fp); rmsg = punpack (fileno(fp)); + + if(rmsg == NULL) + { + eprintf ("Error in call to punpack",__FILE__, __LINE__ - 4); + } + teardown_pipe(); setup_pipe(); -- 2.40.0