From: brarcher Date: Sat, 28 Sep 2013 03:10:42 +0000 (+0000) Subject: Print an error if nothing is read from punpack() X-Git-Tag: 0.10.0~401 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab8562fdad7bf1a56189f3ae491aceaa49a510fb;p=check 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 --- 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();