Closed do11 closed 8 years ago
There is intermittent error on FreeBSD 10.
Pipe-based Context Switching -- 1 copy ==> "/mnt/xxx/byte-unixbench/UnixBench/pgms/context1" 10 2>&1 >> "/mnt/xxx/byte-unixbench/UnixBench/results/test-2016-01-12-03.log" #### Pass 1 # COUNT0: 1653905 # COUNT1: 1 # COUNT2: lps # ERROR: slave read failed: No such file or directory # elapsed: 10.034850 # pid: 2346 # status: 0
src/context1.c: if (read(p1[0], (char *)&check, sizeof(check)) != sizeof(check)) { if ((errno != 0) && (errno != EINTR)) perror("slave read failed"); exit(1); }
You incorrectly check return value of read(). errno should be checked only if read() returns -1, otherwise it may contain garbage (as it occurs on Freebsd 10).
errno
-1
This is fixed in commit 64c45b4
There is intermittent error on FreeBSD 10.
Hack:
Additional note:
You incorrectly check return value of read().
errno
should be checked only if read() returns-1
, otherwise it may contain garbage (as it occurs on Freebsd 10).