These are chat archives for Snaipe/Criterion

29th
Sep 2016
Ben Turrubiates
@bturrubiates
Sep 29 2016 00:35
what is the —debug option supposed to do if TYPE is not provided?
the -h output seems to indicate that it’s optional
Franklin Mathieu
@Snaipe
Sep 29 2016 10:52
@bturrubiates it chooses a debugging server appropriately depending on the compiler used
gcc/icc make it use gdbserver, clang makes it use lldb-server
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:08
Oh, that makes sense. The system I’m working on has clang but not lldb. So I’m getting something like:
bturrubi at blade11 :: ./src/usnic-av-tests -j1 --debug
[----] Criterion v2.3.0-rc1
[====] Running 2 tests from bind_ep:
criterion: Could not spawn test instance: No such file or directory
[1]    23360 abort      ./src/usnic-av-tests -j1 --debug
Franklin Mathieu
@Snaipe
Sep 29 2016 17:09
Ah, I thought I made the "No such file or directory" message a bit clearer, but I must've forgot
It should definitely print that the debugging server could not be found
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:11
Cool, I don’t think lldb-server works on Linux yet
Franklin Mathieu
@Snaipe
Sep 29 2016 17:12
I'm on archlinux, and it works quite well on my end
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:13

Oh, weird. I was going off of this paragraph:

LLDB is improving on Linux. While the debugserver has not been ported (to enable remote debugging) Linux is nearing feature completeness with Darwin to debug x86_64 programs, and is partially working with i386 programs. ARM architectures on Linux are untested. For more details, see the Features by OS section below.

Found here: http://lldb.llvm.org/status.html

Franklin Mathieu
@Snaipe
Sep 29 2016 17:14
It's probably bleeding edge, as Arch is doing rolling releases
I did not realize that the debugging server wasn't quite ready yet
perhaps it would be better to fallback to gdbserver if lldb-server isn't there
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:15
Yeah probably. I used to use Arch, having access to the most up-to-date packages was really nice.
Also, has Criterion always created *.sock files in the tests working directory? Or is that new?
Franklin Mathieu
@Snaipe
Sep 29 2016 17:17
it's a side effect of nanomsg, so it's new
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:17
Whenever I get that abort due to lldb-server not being found, I also get left with a criterion_$pid.sock
Franklin Mathieu
@Snaipe
Sep 29 2016 17:17
there's a pull request pending to put them in /tmp
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:17
oh neat. what is nanomsg used for? IPC?
Franklin Mathieu
@Snaipe
Sep 29 2016 17:18
on 2.2.x and earlier criterion used pipe() to communicate with the tests, but it caused problems when the pipe buffer overflowed
with nanomsg, the library uses a unix socket for that
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:19
is nanomsg in active development right now?
i remember reading something a while ago about nanomsg being a dead project.
Franklin Mathieu
@Snaipe
Sep 29 2016 17:20
Yes. It had a bit of a "dead" period near january because of internal disagreements and the maintainer stepping down
but he stepped up again about 3 months ago iirc
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:20
oh, so they found a new maintainer?
oh, that’s good.
Franklin Mathieu
@Snaipe
Sep 29 2016 17:20
Well we expected someone to step up, but no one did and the project was considered "dead"
I was considering changing for something else at that time, but surprisingly there wasn't any good fit
ZeroMQ is mainly C++ and I'd like the project to remain C-only (plus it wasn't fork-safe, whereas I made a patch for nanomsg to make it fork-safe)
I have a bit more liberty with regards to switching libraries now though, as the new sandbox code calls exec() and doesn't require fork safety
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:24
when you say sandbox are you referring to boxfort?
Franklin Mathieu
@Snaipe
Sep 29 2016 17:24
yes
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:24
oh cool, i saw that but haven’t looked very much into it. looks interesting though
Franklin Mathieu
@Snaipe
Sep 29 2016 17:24
BoxFort was designed to completely rewrite the sandboxing code of criterion (which consisted of fork() on unices and a reimplementation of fork() on windows)
because it was a real hassle to maintain
BoxFort, on the other hand, provides a solid API for creating sandboxes with copy-on-write data sharing
so not only it is safer & more maintainable, it's also quite fast
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:28
oh nice, i’ll take a better look sometime. a while ago i tried looking into mimic, but then realized that a lot of the functions i wanted to mock were static inline
Franklin Mathieu
@Snaipe
Sep 29 2016 17:30
ah, yes, that's a shame. I'd like to be able to mock static functions in the future by looking up non-dynamic symbols and patching them, but I'm a bit reluctant as this feature would probably be ELF-only
It's a complete shame that MSVC doesn't export a symbol table for its executables
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:32
i have very little experience developing on Windows, but i’ve seen a lot of the changes being made to one of the projects i contribute to as they port it to Windows and it looks frustrating
sometimes you don’t realize how many features are GCC extensions
(by very little i meant none)
Franklin Mathieu
@Snaipe
Sep 29 2016 17:33
Maintaining API compatibility with MSVC is quite hard on that aspect, yes
I'm still wondering why people aren't using clang-cl these days
it would solve all of these problems
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:34
i actually haven’t heard of clang-cl before
oh, looks like it can even be used from inside visual studio. that does sound like a better alternative...
Franklin Mathieu
@Snaipe
Sep 29 2016 17:35
Its quite recent, I stumbled upon it a few months ago
and yes, the big plus is the visual studio integration
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:35
well sometimes you interact with windows projects where their main build system is visual studio files committed to a repoo
repo* and it feels kinda…dirty?
Franklin Mathieu
@Snaipe
Sep 29 2016 17:36
This is encouraged by the VCS plugin for visual studio though
it versions the projects files with the sources
so for people not using the command line, this is the default behaviour
Ben Turrubiates
@bturrubiates
Sep 29 2016 17:36
yeah, it seems pretty normal for VS + Windows development
just seems strange to someone not used to that workflow