Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests fail on gnu hurd #935

Closed
mestia opened this issue Nov 29, 2017 · 7 comments · Fixed by #938
Closed

tests fail on gnu hurd #935

mestia opened this issue Nov 29, 2017 · 7 comments · Fixed by #938
Assignees

Comments

@mestia
Copy link

mestia commented Nov 29, 2017

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.

@Cyan4973
Copy link
Contributor

Cyan4973 commented Nov 29, 2017

-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.

@terrelln
Copy link
Contributor

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.

@Cyan4973
Copy link
Contributor

Yes, this could be attempted.

@mestia
Copy link
Author

mestia commented Nov 29, 2017

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;

@terrelln
Copy link
Contributor

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.

@terrelln terrelln self-assigned this Nov 29, 2017
@terrelln
Copy link
Contributor

terrelln commented Dec 4, 2017

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

@mestia
Copy link
Author

mestia commented Dec 5, 2017

I confirm that tests work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants