Zstd: tests fail on gnu hurd

Created on 29 Nov 2017  路  7Comments  路  Source: facebook/zstd

tests/Makefile defines FUZZERTEST ?= -T200s which is passed then to fuzzer tool.
fuzzer -T200s just never finishes.
By running fuzzer -v -T200s on a hurd system I see incrementing count of test.
Test runs for more than 18 hours:

tests# ./fuzzer -v -T200s
Starting zstd tester (32-bits, 1.3.2)
Seed = 7043
<skip>
test 84 : testing ZSTD error code strings : OK 
1289184 

i386 system:

test 84 : testing ZSTD error code strings : OK
3746 fuzzer tests completed

I guess that on hurd a condition in the loop is never met for whatever reason.
Could you please also document -T flag? What -T200s does?
Thank you.

test issue

Most helpful comment

I confirm that tests work now.

All 7 comments

-T200s or -T200 means "run the test for 200 seconds, then exit".
So indeed, it shouldn't run more than 18 hours.

There is likely something wrong with time measurement on Hurd.
It will require a Hurd platform to reproduce the issue and observe.

Does the benchmark code work and terminate?

zstd -b1

If so, does GNU Hurd trigger this macro? If that works, we can replace the standard C timing functions in the fuzzers with the ones in util.h.

Yes, this could be attempted.

zstd -b1 works and successfully terminates. The macro is also triggered.
I've added a const to the macro and could see it after compiling in gdb info variables output.
What would be the proper way to see that macros is triggered ?
Thanks.

@@ -168,6 +168,7 @@ static int g_utilDisplayLevel;
     }
 #elif (PLATFORM_POSIX_VERSION >= 200112L)
     #include <time.h>
+    static int PLATFORM_POSIX_VERSION_200112L;
     typedef struct timespec UTIL_freq_t;
     typedef struct timespec UTIL_time_t;
     UTIL_STATIC UTIL_time_t UTIL_getTime(void)

gdb ./zstd

(gdb) info variables POSIX
File util.h:
static int PLATFORM_POSIX_VERSION_200112L;

Cool, then we have a way forward. Thanks! I'll update the timing code for the fuzzer tests.

To test a macro triggers, I just add invalid code as;dlfkajsdf;lka; to the branch I want to test, and make sure compilation fails.

@mestia do the tests pass now that -ftrapv has been removed?

I confirm that tests work now.

Was this page helpful?
0 / 5 - 0 ratings