Arnaud Giersch [Wed, 5 Apr 2023 15:28:29 +0000 (17:28 +0200)]
Regenerate tesh files (one more time).
Arnaud Giersch [Wed, 5 Apr 2023 14:26:27 +0000 (16:26 +0200)]
Examine all opened_states_ to find the best candidate.
We cannot use a std::multiset, nor a std::priority_queue as before since
the value for the priority may change, even for states already stored in
opeened_states_.
Citing mlaurent:
"Le problème c'est que dans run() la partie gestion de "persistent set" peut
modifier des acteurs de State déjà dans opened_states_ en les passant à Todo.
Et ça, ça peut modifier la valeur renvoyée par next_transition_guided()."
Arnaud Giersch [Sun, 2 Apr 2023 09:43:45 +0000 (11:43 +0200)]
Cosmetics.
Arnaud Giersch [Tue, 4 Apr 2023 12:02:40 +0000 (14:02 +0200)]
Rename MC_NEED_PTRACE -> SIMGRID_MC_NEED_PTRACE for consistency.
Arnaud Giersch [Thu, 30 Mar 2023 12:58:09 +0000 (14:58 +0200)]
Centralize definitions for the name of environment variables used by the MC.
Arnaud Giersch [Wed, 5 Apr 2023 12:09:45 +0000 (14:09 +0200)]
Sonar smells; remove redundant mentions of std::shared_ptr<State>.
Martin Quinson [Wed, 5 Apr 2023 19:40:32 +0000 (21:40 +0200)]
Fix make distcheck, stupid bummer
Martin Quinson [Wed, 5 Apr 2023 19:27:39 +0000 (21:27 +0200)]
Enforce the ns3 timings for the latest version of ns3, and just execute older versions
Martin Quinson [Wed, 5 Apr 2023 06:13:55 +0000 (08:13 +0200)]
Make strsignal(SIGSEGV) return the same string across all architectures
Martin Quinson [Tue, 4 Apr 2023 22:03:40 +0000 (00:03 +0200)]
Use the fast SOCK_SEQPACKET where available
Maybe SOCK_SEQPACKET is not faster than SOCK_STREAM per se, I don't
know, but streams force us to re-bufferize the data that we receive in
excess, leading to many useless data copies.
Martin Quinson [Tue, 4 Apr 2023 21:45:27 +0000 (23:45 +0200)]
Make the MC protocol work on top of STREAM sockets
MacOSX does not have AF_UNIX + SOCK_SEQPACKET so we need SOCK_STREAM
for that architecture. I'll make it SEQPACKET on Linux+FreeBSD and
STREAM on Mac in the next commit, but I wanted to code and debug the
SOCK_STREAM version locally.
The problem with the SOCK_STREAM version is that messages are not
segmented anymore: each recv() gets everything that got posted on the
socket already, so I have to implement a buffer in which I can
reinject the extraneous bytes received, so that they can be used in
the next recv(). The real fun begins when I have half of the expected
message in buffer and the other half must be taken from the network.
Or even better: the second half was not posted yet so reading from the
network is blocking for ever. This can happen when I receive any
message in a 512-bytes buffer, but I already had a full but shorter
message in buffer. I have to try reading from the socket with the
DONT_WAIT flag, detect that there is nothing to read, and use the
buffer content only.
Arnaud Giersch [Tue, 4 Apr 2023 15:24:07 +0000 (17:24 +0200)]
Regenerate tesh files.
Arnaud Giersch [Tue, 4 Apr 2023 15:12:25 +0000 (17:12 +0200)]
Use a multiset to handle opened states, and ensures a reproductible order on different systems.
From cppreference: The order of the elements that compare equivalent is the order of insertion and does not change.
(since C++11)
Arnaud Giersch [Tue, 4 Apr 2023 15:08:57 +0000 (17:08 +0200)]
An integer seems good enough to handle priorities, and is not subject to rounding errors.
Martin Quinson [Mon, 3 Apr 2023 19:13:58 +0000 (21:13 +0200)]
Don't die at compilation when activating stateless MC on non-ptrace architectures
Martin Quinson [Mon, 3 Apr 2023 19:10:10 +0000 (21:10 +0200)]
Remove a file generated by cmake
Martin Quinson [Mon, 3 Apr 2023 12:40:47 +0000 (14:40 +0200)]
Ensure in tests that the ns3 timings remain unchanged
Arnaud Giersch [Mon, 3 Apr 2023 14:38:48 +0000 (16:38 +0200)]
Revert "Treat ECONNRESET like a normal connection close."
This reverts commit
2fbcc71ab230e6a05e64189f6bd7c49c1df31907.
It was erroneously pushed before testing. Sorry for the noise.
[ci-skip]
Arnaud Giersch [Mon, 3 Apr 2023 14:13:42 +0000 (16:13 +0200)]
Treat ECONNRESET like a normal connection close.
Also return immediately with EAGAIN, or handle_message() will fail with size == -1.
Martin Quinson [Sun, 2 Apr 2023 21:26:20 +0000 (23:26 +0200)]
Kill another override-to-same-content
Martin Quinson [Sun, 2 Apr 2023 20:44:08 +0000 (22:44 +0200)]
Cosmetics in cmake
- use ON/OFF instead of 1/0
- display all MC related options together
- mark some crufy variables as advanced to hide them
Martin Quinson [Sun, 2 Apr 2023 20:25:21 +0000 (22:25 +0200)]
Don't override a method to the same content
Martin Quinson [Sun, 2 Apr 2023 10:33:24 +0000 (12:33 +0200)]
Don't use ucontextes on Apple hosts
Martin Quinson [Sun, 2 Apr 2023 10:27:47 +0000 (12:27 +0200)]
Cast a printf parameter to please MacOS X
Martin Quinson [Sun, 2 Apr 2023 10:24:15 +0000 (12:24 +0200)]
Disable MC stateful API when not running in MC
This is a better fix for the null-dereference found by the sanitizers
since 2 nights. Instead of hiding the problem on these builds (as done
in previous commit), fix it for every builds.
Martin Quinson [Sun, 2 Apr 2023 10:10:08 +0000 (12:10 +0200)]
MC stateful API is only needed when stateful MC is compiled in
Martin Quinson [Sun, 2 Apr 2023 08:04:10 +0000 (10:04 +0200)]
Don't use CLOEXEC
In one case (Checker->App), we were removing it after setup so we
don't need it.
In the other case (App->App), it was just to be tiddy but it's not
really useful: Forking applications are barely supported anyway.
Martin Quinson [Sat, 1 Apr 2023 22:34:25 +0000 (00:34 +0200)]
Ensure that the clang optimizer does not swallow the segfault I'm expecting
Instead of actually dereferencing the null pointer (which drives the
static analyzers nuts), simply send myself a SIGSEGV.
Martin Quinson [Sat, 1 Apr 2023 21:45:32 +0000 (23:45 +0200)]
Ignore empty replay path + hide a global (to avoid init fiasco)
I was observing that the model_checking_mode global did not had the
same value when compiling with or without optimizations.
Maybe I had a sort of race condition on model_checking_mode during
initialization, or maybe the config element of the replay path was
either called before or after the initialization of the library, thus
replacing the model_checking_mode to REPLAY even if it was supposed to
be APP_SIDE in my case.
It's fixed now, but I'm not completely sure of which of these change
was the right one (probably the replay path). Both seem legit, so commit both.
Martin Quinson [Sat, 1 Apr 2023 18:03:42 +0000 (20:03 +0200)]
More logs around the configuration of the MC variants
Martin Quinson [Sat, 1 Apr 2023 17:54:30 +0000 (19:54 +0200)]
Really diplay cmake parameters in the jenkins logs
Martin Quinson [Sat, 1 Apr 2023 17:46:07 +0000 (19:46 +0200)]
Jenkins: display cmake parameters in the logs
Martin Quinson [Sat, 1 Apr 2023 17:45:46 +0000 (19:45 +0200)]
Option model-checking OFF by default
Martin Quinson [Sat, 1 Apr 2023 15:56:56 +0000 (17:56 +0200)]
Don't qwack when the default empty string is passed as a replay path
Martin Quinson [Sat, 1 Apr 2023 10:20:48 +0000 (12:20 +0200)]
Revert "Also valgrind childs in CI, to valgrind MC apps"
This is already done in Tests.cmake (note so in my_valgrind.pl)
This reverts commit
ee681140d428f4adb2cbfde207a04a4fc5a84b95.
Martin Quinson [Sat, 1 Apr 2023 09:45:54 +0000 (11:45 +0200)]
Fix an initialization race around the AppSide
Martin Quinson [Sat, 1 Apr 2023 00:42:18 +0000 (02:42 +0200)]
Fix make distcheck
Martin Quinson [Sat, 1 Apr 2023 00:32:40 +0000 (02:32 +0200)]
Also valgrind childs in CI, to valgrind MC apps
Martin Quinson [Sat, 1 Apr 2023 00:30:43 +0000 (02:30 +0200)]
Only compile stateless MC when libevent is found
Martin Quinson [Fri, 31 Mar 2023 22:58:56 +0000 (00:58 +0200)]
Rename SIMGRID_HAVE_MC into SIMGRID_HAVE_STATEFUL_MC (so that MC can be optional again)
Martin Quinson [Fri, 31 Mar 2023 22:21:16 +0000 (00:21 +0200)]
Fix non-MC builds when MC-only dependencies are missing
Martin Quinson [Fri, 31 Mar 2023 21:48:26 +0000 (23:48 +0200)]
Compile the safe part of MC in default mode too
Safety properties (with no checkpointing) are not requiring anything
weird nowadays. Liveness properties, communication determinism and
state-equality reductions are not considered safe as they still need
some memory introspection black magic.
Martin Quinson [Fri, 31 Mar 2023 16:33:59 +0000 (18:33 +0200)]
Try to please the ultramodern clang running on FreeBSD by properly giving a copy operator to the abstract class too
We should stop using the copy operator, and use a nice and clean
clone() call instead. Mathieu's on it.
Martin Quinson [Fri, 31 Mar 2023 14:41:39 +0000 (16:41 +0200)]
Fix doc on how to select the compiler before compiling
Martin Quinson [Fri, 31 Mar 2023 15:59:36 +0000 (15:59 +0000)]
Merge branch 'master' into 'master'
Guiding Backtrack in DFSExplorer
See merge request simgrid/simgrid!143
Arnaud Giersch [Fri, 31 Mar 2023 14:56:04 +0000 (16:56 +0200)]
[gitlab-ci] Run "make distcheck-configure" for merge requests.
Arnaud Giersch [Fri, 31 Mar 2023 14:48:02 +0000 (16:48 +0200)]
Allow to skip some stages of "make distcheck".
Now:
* "make distcheck-archive" only checks the archive
* "make distcheck-configure" also runs cmake et checks the file MANIFEST.in
* "make distcheck" depends on the previous stages, and runs the full build+install+tests
Martin Quinson [Fri, 31 Mar 2023 14:39:21 +0000 (16:39 +0200)]
Correctly select the clang compiler on gitlab CI
Martin Quinson [Fri, 31 Mar 2023 13:58:32 +0000 (15:58 +0200)]
Gitlab CI: Use clang on modelchecker builds, for MRs
Martin Quinson [Fri, 31 Mar 2023 13:55:42 +0000 (15:55 +0200)]
Fix clang builds
Martin Quinson [Wed, 29 Mar 2023 08:00:25 +0000 (10:00 +0200)]
Add a small implementation note in MC
Martin Quinson [Fri, 31 Mar 2023 11:54:08 +0000 (11:54 +0000)]
Merge branch 'master' into 'master'
Add battery plugin and fix DAG doc
See merge request simgrid/simgrid!142
Adrien [Fri, 31 Mar 2023 11:54:07 +0000 (11:54 +0000)]
Add battery plugin and fix DAG doc
mlaurent [Thu, 30 Mar 2023 20:15:33 +0000 (22:15 +0200)]
Merge branch 'master' of https://framagit.org/simgrid/simgrid
mlaurent [Thu, 30 Mar 2023 20:09:31 +0000 (22:09 +0200)]
Rename guide as strategy and fix counter-example display with recipe
mlaurent [Thu, 30 Mar 2023 13:04:28 +0000 (15:04 +0200)]
Replace state copy with recipe: list of transition to replay a state
Arnaud Giersch [Wed, 29 Mar 2023 10:32:40 +0000 (12:32 +0200)]
Cosmetics (help project_description.sh) [ci-skip].
Arnaud Giersch [Wed, 29 Mar 2023 09:01:22 +0000 (11:01 +0200)]
[jenkins] Remove stale sockets from simgrid-mc.
mlaurent [Wed, 29 Mar 2023 08:27:18 +0000 (10:27 +0200)]
Add missing file
mlaurent [Tue, 28 Mar 2023 11:55:17 +0000 (13:55 +0200)]
Change opened states for a priority queue
mlaurent [Mon, 27 Mar 2023 20:43:54 +0000 (22:43 +0200)]
Abide by both compiler warnings
mlaurent [Mon, 27 Mar 2023 18:19:28 +0000 (20:19 +0200)]
Now handle random transition and multiple times transitions
mlaurent [Mon, 27 Mar 2023 08:24:38 +0000 (10:24 +0200)]
Merge branch 'master' of https://framagit.org/simgrid/simgrid
Martin Quinson [Mon, 27 Mar 2023 07:00:50 +0000 (09:00 +0200)]
Activate the stdobject test now that it works
Martin Quinson [Mon, 27 Mar 2023 07:00:25 +0000 (09:00 +0200)]
Don't set a really short timeout on sendsend now that this test works
Martin Quinson [Sun, 26 Mar 2023 20:01:11 +0000 (22:01 +0200)]
Revert "Revalidate tesh files now that safety checking is based on reforks"
We can revert this, as we don't re-initialize again and again the
application in refork mode. Instead, we fork a pre-initialized app.
This reverts commit
b2a9ee8e090af818cca9e72cd0e44fa1b91586b0.
Martin Quinson [Sun, 26 Mar 2023 19:56:46 +0000 (21:56 +0200)]
Implement reforks by forking the application, to save the app exec time
Instead of forking from the checker and exec()ing the application, we
now fork+exec an application that we use as a proxy to the real
application process.
When we need a new application process, we fork it from the proxy,
which is much faster as it's already initialized.
The extra complexity is when the socket closes abruptly on the Checker
side, which means that the application died. We cannot waitpid() on
the app directly, as it's our grandchild. So, we have to ask the proxy
to do the waitpid for us and return the status.
Martin Quinson [Sun, 26 Mar 2023 19:43:31 +0000 (21:43 +0200)]
Allow up to 30 elements in ENUM_CLASS
Martin Quinson [Sat, 25 Mar 2023 15:33:06 +0000 (16:33 +0100)]
memset 0 the memory that is sent over the network
Martin Quinson [Sat, 25 Mar 2023 15:06:56 +0000 (16:06 +0100)]
MC protocol: rename INITIAL_ADDRESSES msg to NEED_MEMINFO
Martin Quinson [Sat, 25 Mar 2023 14:36:41 +0000 (15:36 +0100)]
Actually, now that the appside is not ptraced, there is no point killing it
Closing the socket is enough; it will exit on its self.
Also, there is no point waitpid()ing it, as the libevent loop is
already doing so.
Martin Quinson [Sat, 25 Mar 2023 11:17:28 +0000 (12:17 +0100)]
Invert another logic error: we need ptrace when we need mem_info, not the opposite
Martin Quinson [Sat, 25 Mar 2023 10:24:06 +0000 (11:24 +0100)]
This test is always false, as we asserted so just above
Martin Quinson [Sat, 25 Mar 2023 10:18:58 +0000 (11:18 +0100)]
Do not ask for memory info when restarting in refork mode
Martin Quinson [Fri, 24 Mar 2023 22:33:21 +0000 (23:33 +0100)]
Use a portable name for SIGABRT
Martin Quinson [Fri, 24 Mar 2023 22:32:59 +0000 (23:32 +0100)]
That test seems to pass nowadays
Martin Quinson [Fri, 24 Mar 2023 22:10:43 +0000 (23:10 +0100)]
Try to use the same test file for non-linux now that we don't use ptrace
Martin Quinson [Fri, 24 Mar 2023 22:06:32 +0000 (23:06 +0100)]
MC: disable personality() as it fails on CI and is not mandatory
Martin Quinson [Fri, 24 Mar 2023 21:06:47 +0000 (22:06 +0100)]
Revalidate tesh files now that safety checking is based on reforks
Martin Quinson [Fri, 24 Mar 2023 21:06:04 +0000 (22:06 +0100)]
Fix the refork feature by not ptracing App so that it dies properly
Martin Quinson [Fri, 24 Mar 2023 21:00:34 +0000 (22:00 +0100)]
More explicit error message
Martin Quinson [Thu, 23 Mar 2023 23:00:53 +0000 (00:00 +0100)]
Fix another sonar warning
Arnaud Giersch [Fri, 24 Mar 2023 13:54:41 +0000 (14:54 +0100)]
Delete redundant blank lines at the start of a code blocks (CodeFactor).
mlaurent [Fri, 24 Mar 2023 15:23:47 +0000 (16:23 +0100)]
Add copy constructor to state, so we can backtrack different ways
Arnaud Giersch [Fri, 24 Mar 2023 13:02:57 +0000 (14:02 +0100)]
Strengthen debug messages on channel send/recv.
Arnaud Giersch [Thu, 23 Mar 2023 11:10:25 +0000 (12:10 +0100)]
Simplify member initialization.
Arnaud Giersch [Mon, 20 Mar 2023 10:31:24 +0000 (11:31 +0100)]
Fix test: program needs exactly 2 processes.
Arnaud Giersch [Thu, 16 Mar 2023 16:28:51 +0000 (17:28 +0100)]
Reduce scope for variable.
Arnaud Giersch [Mon, 20 Feb 2023 18:24:23 +0000 (19:24 +0100)]
Simplify loop.
Arnaud Giersch [Mon, 20 Feb 2023 18:19:19 +0000 (19:19 +0100)]
Determine n_transitions on receiving side (and remove it from the message).
Arnaud Giersch [Mon, 20 Feb 2023 18:15:17 +0000 (19:15 +0100)]
There's no need to compute the total transition count anymore.
Arnaud Giersch [Mon, 20 Feb 2023 18:07:25 +0000 (19:07 +0100)]
Remove superfluous test, and reduce depth of nested statements.
Arnaud Giersch [Mon, 20 Feb 2023 18:07:07 +0000 (19:07 +0100)]
Merge loops and get rid of the "probes" temporary vector.
mlaurent [Fri, 24 Mar 2023 09:16:12 +0000 (10:16 +0100)]
Merge branch 'master' of https://framagit.org/simgrid/simgrid
Martin Quinson [Thu, 23 Mar 2023 21:38:38 +0000 (22:38 +0100)]
Dont use handle_waitpid after we killed the App, as this function may report this as an error
Martin Quinson [Thu, 23 Mar 2023 20:58:46 +0000 (21:58 +0100)]
Actually, read()=0 is not an issue in the AppSide
it simply means that the checker closed the socket on its side, so we
should quit ASAP without complaining.
mlaurent [Thu, 23 Mar 2023 08:58:49 +0000 (09:58 +0100)]
Merge branch 'master' of https://framagit.org/simgrid/simgrid
mlaurent [Thu, 23 Mar 2023 08:50:33 +0000 (09:50 +0100)]
try to fix stack handling
Martin Quinson [Wed, 22 Mar 2023 22:04:28 +0000 (23:04 +0100)]
Fix some easy sonar smells
const-ness, try_emplace, attribute noreturn, ...
The most important one is the TransitionObjectAccess one, where a
field in the subclass was hiding a field of the same name in the
superclass. Maybe the bug I was experiencing in that area was related.
Martin Quinson [Wed, 22 Mar 2023 21:35:16 +0000 (22:35 +0100)]
Fix two sonar bugs
- don't throw from the destructor
- don't slice objects (downcast objects instead of downcasting
references). I suspect that this one is a false positive but the
tests still pass this way so let's go.