These are chat archives for Snaipe/Criterion

1st
Nov 2018
dramforever
@dramforever
Nov 01 2018 09:17

Hi, I just tried Criterion 2.3.2 and samples/simple.c compiles fine, but when run just gives criterion: Could not spawn test instance: Protocol error then aborts. Anything I can do to diagnose this problem further before reporting it?

(I just did gcc -o sample sample.c -lcriterion then ./sample)

#include <criterion/criterion.h>

Test(misc, failing) {
    cr_assert(0);
}

Test(misc, passing) {
    cr_assert(1);
}
I don't think the exact tests are relevant though...
Franklin Mathieu
@Snaipe
Nov 01 2018 09:19
Mmh, what platform are you on?
(& what's your version of GCC)
dramforever
@dramforever
Nov 01 2018 09:22
I have GCC 7.3.0, and I'm on x64 Linux
I'm using NixOS which has a bit of a non-standard setup
Franklin Mathieu
@Snaipe
Nov 01 2018 09:23
Oh, nice, I like test cases like these
dramforever
@dramforever
Nov 01 2018 09:23
So I'm asking here for further diagnosing instructions
Anything I can do?
Franklin Mathieu
@Snaipe
Nov 01 2018 09:25
Can you print the contents of /dev/shm? the Protocol Error bit means that something went wrong when Criterion/Boxfort tried to re-exec itself as a sandboxed worker
dramforever
@dramforever
Nov 01 2018 09:25
Oh, I tried both the binary package and the source tarball. Same behavior
Franklin Mathieu
@Snaipe
Nov 01 2018 09:25
I would also be interested for a strace -f dump
dramforever
@dramforever
Nov 01 2018 09:25
$ ls /dev/shm
total 12
-rw------- 1 dram users 154 Nov  1 08:22 bxfi_29689
-rw------- 1 dram users 154 Nov  1 08:23 bxfi_29736
-rw------- 1 dram users 154 Nov  1 08:23 bxfi_29752
Franklin Mathieu
@Snaipe
Nov 01 2018 09:26
Cool, the shared mem seems to at least be created
dramforever
@dramforever
Nov 01 2018 09:26
$ xxd /dev/shm/bxfi_29689
00000000: 9a00 0000 0000 0000 f091 0000 0000 0000  ................
00000010: 0000 0000 0000 0000 f973 0000 0000 0000  .........s......
00000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000030: 0c00 0000 0000 0000 5200 0000 0000 0000  ........R.......
00000040: 0000 0000 0000 0000 2f6e 6978 2f73 746f  ......../nix/sto
00000050: 7265 2f6a 736b 3667 6e73 6939 336d 6c78  re/jsk6gnsi93mlx
00000060: 346b 617a 3736 6e38 6c64 306b 3676 6134  4kaz76n8ld0k6va4
00000070: 6a34 672d 6372 6974 6572 696f 6e2d 322e  j4g-criterion-2.
00000080: 332e 322f 6c69 622f 6c69 6263 7269 7465  3.2/lib/libcrite
00000090: 7269 6f6e 2e73 6f2e 3300                 rion.so.3.
Is this useful...?
Franklin Mathieu
@Snaipe
Nov 01 2018 09:27
Oh also before I go too deep into this, can you try to see if the fix/247 and bleeding branches respectively fix the problem?
yes the contents of the shmem are useful, thanks
dramforever
@dramforever
Nov 01 2018 09:30
Okay, trying
BTW I also asked the same thing on IRC a while before this. Just disregard that.
Franklin Mathieu
@Snaipe
Nov 01 2018 09:36
Gitter has somewhat more intrusive notifications :smile:
Plus I woke up about an hour ago and did not check irc
dramforever
@dramforever
Nov 01 2018 09:37
haha
@Snaipe Is it okay that I just build without make install, and use gcc -I and LD_LIBRARY_PATH to load criterion?
Franklin Mathieu
@Snaipe
Nov 01 2018 09:39
Sure, you can even use -Wl,-rpath,the_library_dir when compiling the sample
dramforever
@dramforever
Nov 01 2018 09:44
Same behavior on bleeding
fix/247 building
It's fine on fix/247
[----] sample.c:4: Assertion failed: The expression 0 is false.
[FAIL] misc::failing: (0.00s)
[====] Synthesis: Tested: 2 | Passing: 1 | Failing: 1 | Crashing: 0
Franklin Mathieu
@Snaipe
Nov 01 2018 09:47
Oh, geez, so it was #247. Good to know it's not only clang that's affected
I'm going to release 2.3.3 with these changes probably this evening or at worst at the end of the week, would you mind remaining on fix/247 for the time being?
dramforever
@dramforever
Nov 01 2018 09:48
Not at all. I'm just trying Criterion out.
Franklin Mathieu
@Snaipe
Nov 01 2018 09:49
Great! Thanks for the report :smile:
dramforever
@dramforever
Nov 01 2018 09:49
I think I'll go add a comment there.
Oh, and one question: how do I build a source tarball?
So I don't have to git clone halfway through building
Franklin Mathieu
@Snaipe
Nov 01 2018 09:52
Does the tarball from the release page work? I know the github-generated ones are not working because they are missing submodules
dramforever
@dramforever
Nov 01 2018 09:52
Yes I mean the 'release page' kind of tarballs, but I want one for fix/247 :smile:
Nix doesn't really like networking in builds
Franklin Mathieu
@Snaipe
Nov 01 2018 09:54
Ah, you'd have to make one yourself then, CMake has been consistently unhelpful about this. Check out the .cmake directory, there should be a copy-source script to do just that
dramforever
@dramforever
Nov 01 2018 09:54
Cool, thanks :smile:
Franklin Mathieu
@Snaipe
Nov 01 2018 09:55
although I think that the commit hash for BoxFort in copy-source is not up-to date, you'll need to change it to use the tip commit
dramforever
@dramforever
Nov 01 2018 09:55
Got that