Commit Graph

872 Commits

Author SHA1 Message Date
e63f7376f8 JobClient: connect to IPv4 endpoints only
As long as the JobServer only listens on IPv4 endpoints, it makes no
sense to attempt a connect to an IPv6 endpoint on the client side.

(However, it's 2018 and we should also be capable of using IPv6 on
both the client and server side ...)

Change-Id: I9c3916466c350ce74a31cef3b6ae0e7ac56367c7
2018-07-24 09:16:33 +02:00
c5e0825c6f Database: reduce varchar cols to fit MyISAM indexes
MyISAM indexes are limited to 1000 bytes per index.  Recently, Linux
distros (e.g. Debian 9) started to default MariaDB installations to
utf8mb4, which can use up to 4 bytes per character.  Hence, two
varchar columns indexed in a single key have a total maximum length of
250.  Instead, we use some lower, round numbers.

Change-Id: I4b53bc217912bc7070102a0af4938763e61b041d
2018-07-24 09:16:33 +02:00
ff3a5fb498 move to LLVM 3.9
This change removes support for earlier LLVM versions; making them
work as well is simply too tedious.

Change-Id: I372a151279ceb2bfd6de101c9e0c15f0a4b18c03
2018-07-24 09:15:33 +02:00
baaa6c3ce8 JobClient/Server fixes
- Retain original CLIENT_RETRY_COUNT semantics after Boost::Asio
  switch
- JobClient is C++11 now, too
- Message reception copy/paste error fixes

Change-Id: I19c474b2a79cd2ac8657e8d58d6170202d096fb0
2018-05-09 17:43:28 +02:00
9272c5cbed Move JobClient to Boost::asio as well
I did this mainly so server and client use a common networking API
IMO, using Boost::asio results in nicer name-lookup code.
Since no longer needed, I removed the SocketComm stuff.
The client is still synchronous; I see no benefit in having it
asynchronous.

I'm not super happy with the random backoff by the clients, if they
can't connect to the server. It makes the code really messy, 3 retries
is totally arbitrary, as is the backup windows. I believe launching
the server and clients in the correct order should be handled by a
launch script
Change-Id: Ifea64919fc228aa530c90449686f51bf63eb70e7
2018-05-09 17:41:52 +02:00
9ae8123433 JobServer: fix C++14 dependency
The recent Boost.Asio overhaul requires C++14 features, not only C++11.

Change-Id: I6decf0e6532956f7061d8a9021ec2c8406679266
2018-05-03 16:28:26 +02:00
6f41ad73d3 util: MemoryMap test failure more verbose
Change-Id: Ie42e1983d8cc5658b7e88d59cdbe689e6aefe9f2
2018-05-03 15:24:52 +02:00
6c120004eb Use boost-asio to improve FAIL* server performance
This patch overhauls the FAIL* server code to leverage Boost asio to be able to
handle a large number of clients (>4000). In this implementation the server is
now single threaded. I've not encountered any problems with this for up to
about 10k clients. Boost ASIO can also be used multithreaded, but I assume the
FAIL* internal data structures (Synchronized*) will become a bottleneck first.

The code now additionally depends on Boost Coro and Boost Context, as well as
a C++ 14 compiler, although the only C++14 feature required is a lambda capture
with initializer, such as [ x = std::move(x) ]. gcc-4.9.2 does this.

The code could (and probably should) be cleaned up more. Comments are wordy,
code is unnecessary now (multiple server threads), code is not self-contained
(headers spread dependencies), many ifdef's (server performance measuring
should be runtime rather than a compile time option), and much more. But for
this patch I was going for a minimal changeset the get the functionality in,
to have an easier review. Alas, FAIL* has no Unit-test suite to run the changes
against.

To handle such a large number of clients more changes were necessary, for
example server status output is now performed every 1s, instead for every
request.

The class Minion was removed completely; the only thing it was doing was
encapsulate an int.

The server has now a runtime-configurable port, or it can select a free port on
its own if none is specified. This requires the CampaignManager to add a port
argument and instantiate the JobServer dynamically.

Change-Id: Iad9238972161f95f5802bd2251116f8aeee14884
2017-09-15 06:26:14 +02:00
3ad42e270c fixes for Debian 9
- search for libdwarf.h in new locations (e.g., /usr/include/libdwarf/)
- build Bochs with -std=gnu++98 (gnu++14 is default since GCC 6.1)
- specify "proto2" syntax for protobuf messages
- minor build-system and C++ namespace fixes

Change-Id: I16dbc622c797ef8e936fe3c0fb9b03029d27529d
2017-08-01 14:12:03 +02:00
d0d62de3f4 sal: remove perf dependency to watchpoints/breakpoints
This change removes the hard compile-time dependency from the
performance-improving dedicated listener-list implementation
(core/sal/perf/) to basic watchpoints / breakpoints being enabled in
the cmake config.  This allows to keep the CONFIG_FAST_* switches
enabled in practically every experiment.

The primary reason for this change was the recent insight that enabled
breakpoints with disabled CONFIG_FAST_BREAKPOINTS can massively slow
down an experiment even if the latter does not use a single breakpoint
itself.

Change-Id: I5e3f5c1632ed1ee98a3ec887f18b174fa0e15773
2016-12-03 17:49:07 +01:00
3c6502a111 ecos_kernel_test: check if addr_errors_corrected is mapped before access
Change-Id: I08e751feeffc41a51312b8a9ad4b28a57a45a487
2016-09-09 11:26:07 +02:00
85844b86cc ecos_kernel_test: compare serial output for coptermock benchmark
Change-Id: Ic4f13035d55c811bda7fa020114141b816a11ed8
2016-08-29 10:50:35 +01:00
436930de71 rampage: fix integer overflow
Change-Id: I18ee65335efd0207c27da9524d74be5d5a575329
2016-08-01 16:39:42 +02:00
2aeded20be rampage: link correctly with Bochs
Change-Id: I7a0231c6b6e8983f86b94c2bfde78d2524dbfc8d
2016-08-01 16:36:17 +02:00
d3d2faf680 globally rename Fail* to FAIL*
Change-Id: Ief2cb687cc69dd92c2e04f9314f0f1347e0a84ed
2016-07-26 17:41:32 +02:00
449ac1a692 DatabaseExperiment: local debug helper code
Change-Id: Ibf42c93df26f6123edc867147621a011665e9c43
2016-03-11 20:59:01 +01:00
39b120f7ca GenericExperiment: record output during complete runtime
Before this change, the GenericExperiment only recorded port 0xe9 output
*after* the fault was injected.  When a fault was injected during the
workload's output loop, the output data before that point in time was
missing, and the experiment outcome was wrongly classified as SDC.

This change moves the logging activation to before the fast-forwarding
step (DatabaseExperiment::cb_before_fast_forward).  It also makes sure the
DatabaseExperiment only clears its own listeners instead of also touching
the SerialOutputLogger's one.

Change-Id: I66bda4ee318d271ddda6f7ade4e817bf9d14cf46
2016-03-11 20:59:01 +01:00
5bd7c4a9c5 GenericExperiment: limit output logger buffer
Limit the serial-output logger buffer to prevent overly large memory
consumption in case the target system ends up, e.g., in an endless loop.
The buffer is limited to (golden-run output size)+1 to be able to detect
the case when the target system makes a correct output but faultily adds
extra characters afterwards.

Change-Id: I50c082f8fb09a702d87ab83732ca3e3463c46597
2016-03-11 20:59:01 +01:00
e08deef9d5 GenericExperiment: prevent integer overflow
This change prevents an integer overflow in the memory-access listener
for WRITE_OUTERSPACE.  Instead of matching all addresses above
maxima_data, l_mem_outerspace never matched in the
generic-experiment's "--catch-write-outerspace" mode.

Change-Id: I8f4ee4515af3998b7c2a8e83c7a18306c26d8d66
2016-03-11 20:45:50 +01:00
cae6860e4e generic-tracing typo
Change-Id: Ie642487f3c30ec2b99d0d4ee469acb6a987e17c3
2016-03-11 19:01:30 +01:00
d46b81eb3d GenericTracing/-Experiment: add SDC detection
This change adds detection of SDCs to GenericTracing and
GenericExperiment via Bochs's I/O port E9.

Change-Id: Ie036aa97468b45cad94b6c8f73d1ef2d227547b2
2016-03-11 19:01:17 +01:00
ad558abeb6 DatabaseCampaign/-Experiment: add burst faults
This change introduces the ability to inject burst faults to
the DatabaseCampaign/-Experiment and thus to all derived
campaigns/experiments.

Change-Id: I491d021ed3953562bd7c908e9de50d448bc8ef33
2016-03-11 19:01:17 +01:00
bcf75bceee GenericExperiment: target ELF file now specifiable
Up until now only generic-tracing had the feature to directly
pass an ELF file to the experiment. generic-experiment lacked
that functionality and resorted to using the $FAIL_ELF_PATH
environment variable.
This change introduces the "--elf-file" command line argument
to generic-experiment.

Change-Id: Ie74de9e1781275ab247786856e13e412bac39224
2016-03-10 15:15:27 +01:00
bfcb1b415b experiments: experiment for tracing and testing ERIKA
ERIKA Enterprise is a OSEK conforming embedded RTOS. The supplied tracer
and experiment are similar to the cored-{tracing,tester} experiment, but
checks the integrity of the RTOS application in a different
manner. Stacks and stackpointers are located differently in ERIKA. This
experiment was used in RTAS'15 Hoffmann et al.

Change-Id: Idc8d874eb4d4ef15837f903270cfa521bc9514a2
2015-09-18 12:51:57 +02:00
1e572faa04 dosek: merge trace and test experiment
With the instantiate-indirect.ah method, we can choose between different
experiment flows at runtime. By this, we can combine tracing and actual
injection into one fail-client binary. A -Wf,--mode={tester,tracer}
switch does hand the control to different experiment flows.

Change-Id: Ia268489ff6bc74dffea745b7aedcb36e262e8079
2015-09-18 12:51:57 +02:00
f73008f60a cored-tester: adapt the cored tester experiment
For redoing the bench-coptermock-isorc experiment, we have to change the
timeout settings. We now use a soft timeout setting. A soft timeout is
resetted after each checkpoint event. If a hard timeout (2 seconds) is
reached although the soft timeout was resetted, we also abort the injection.

Change-Id: Ib7c2b1ad201641f47434a11d3273dde797e0012e
2015-09-18 12:51:56 +02:00
07b6275cbb plugin/checkpoint: add possibility to cache data
The checkpoint plugin is able to use dynamic values from within the
target to calculate its ranges. If the experiment injects faults within
those dynamic values, we will always get an digest error, even if it has
no influence on the outcome of the experiment or the integrity of the
data range.

Therefore, the plugin now provides a possiblity to cache those dynamic
values, before injecting them. This has to be done explicitly within the
experiment.

Change-Id: Ib2cbedd570ea9ab9c97efc152279e8eb79c573f4
2015-09-18 12:51:56 +02:00
748b0aea09 MemWriteListener: Set accesstype correctly
One construction of MemWriteListener did not set the MemAccessEvent type
correctly.

Change-Id: I34a34a34c1c23b2081d4749ee5e5372461c21717
2015-09-18 12:51:55 +02:00
f7c9917f7e database-experiment: no abort on injection_instr_absolute==NULL
The injection_instr_absolute can be NULL, if the trace was imported by
--faultspace-rightmargin R. The database-experiment then aborted the
injection, since a non present injection instruction is encoded as 0,
which is != 0.

Change-Id: I0abcbf102e8b26678ea574d6f73741c2cfac6781
2015-09-18 12:51:03 +02:00
65e4409c90 generic-tracing: add --restore command-line option
This options performs a restore to the saved state of the machine immediately
after saving (default: off). This option is needed when the state is used by
other experiments that depend on the trace, which slighty differs without a
restore.

Change-Id: I4fdf4c5e03779bb9c6e0a0fa335ceae3e20608a5
2015-09-03 13:44:04 +02:00
c4437e1bd3 Merge "generic-tracing: add --serial-port and --serial-file command-line options" 2015-08-07 13:04:01 +02:00
c2b8566e35 generic-tracing: add --serial-port and --serial-file command-line options
The generic-tracing experiment now supports logging of I/O port access to file.
Therefore, the serialoutput plugin needs to be included in the experiment
configuration. Without the --serial-file option specified, logging is disabled.

Change-Id: I9e60d8ffd598ee04a50b4d92fc283f75382d478a
2015-08-07 11:43:01 +02:00
d71db9211c DatabaseExperiment: fix headers
-  Add missing iomanip header: Without this one, Fail/gem5 does not
    compile.

 -  Remove unnecessary sal/bochs header: This seems to be a relic from
    when the DatabaseExperiment was Bochs-specific.

Change-Id: I91c991795c2c2e76359e9d11415f5119d225a4ab
2015-08-06 16:33:59 +02:00
d2f99b909f Merge changes I7de68835,I27d83526
* changes:
  GenericExperiment: Fix definition of "detected-marker"
  Gitignore: ignore vim swap files
2015-08-05 09:42:24 +02:00
1d9dae0e21 bochs: translate virtual to linear addresses
This change makes MemoryAccessListeners deliver linear addresses
instead of virtual ones deprived of their segment selector.  Even in
modern operating systems, segment selectors are still used for, e.g.,
thread-local storage.

The hooks within MemAccess.ah could maybe be implemented in a simpler
and less fragile way using the BX_INSTR_LIN_ACCESS instrumentation
hook, but this needs more investigation.

Change-Id: I0cee6271d6812d0a29b3a24f34d605a327ced7da
2015-07-31 12:46:06 +02:00
246938d4a6 l4-sys: Enable FI in all config cases
Fix the problem that injection was never enabled if func_entry == filter_entry.

Change-Id: Ifec64b6d1351e0857e568ca132cfed891f85aa62
2015-07-29 19:09:32 +02:00
257a3fb542 ecos_kernel_test: fix using wrong filename for serial output
Change-Id: I59ed61e2e4ee7ffe1a29390dd6ff0264406c3e7b
2015-06-19 17:27:21 +02:00
610e5d798d fiascoFail: grand overhaul of this experiment
* Removed all command-line options.
* Read all required information from *-traceinfo.txt file or kernel elf file.
* Record error_corrected (but only in the 'OK' case).
* Add support for multiple variants (similar to the ecos experiment).

Change-Id: I933e52881fc6bee0750d8aaef813fe2539166b06
2015-06-19 17:11:31 +02:00
ce41b30fb1 GenericExperiment: Fix definition of "detected-marker"
Due to a bug (most likely a copy and paste issue), the detected-marker
group was defined to point to the "FAIL_marker"-set, which would be
redundant. This commit will correctly map it to the "DETECTED_marker"
group.

Change-Id: I7de688357006ced1adf2423e213ae6633629cb81
2015-04-20 23:33:17 +02:00
f24f9f2107 cored-tester: add color_assert listener only if existsing
The color_assert_port symbol does not exist in all dOSEK variant,
therefore we add the listener only if the symbol exists. Otherwise the
invalid handler will trigger on INV_ADDR

Change-Id: I7b81940a8413850527efb9e4bae86248794c622c
2015-04-17 09:22:37 +02:00
d38218f0eb DatabaseExperiment: remove Bochs dependency
Use the newly introduced SimulatorController::getCPUCount() instead of
BX_SMP_PROCESSORS to figure out the number of CPUs the back end provides.

Change-Id: I6d6521ae508154366ab5d0c23ddcb6f2de99aa04
2015-04-10 16:44:41 +02:00
ae15ac704d add missing headers
This change adds some missing headers needed for compiling the
PandaBoard variant, which seems to not have seen a compiler for a
while.

Change-Id: Ifb54abb4dc676fafc29ecbae97bafaa547fcfc80
2015-04-10 16:43:13 +02:00
96fae94b1f DatabaseExperiment: fix wrong variable scope
This fixes a wrong variable scope introduced in commit 193e5b7,
breaking compilation.

Change-Id: I74194e9ea6e726bc0a7ce2ee5ad5439b7de87fba
2015-04-10 15:07:45 +02:00
193e5b757e adapt experiments to new restore() behavior
This change adapts several experiments, including the
DatabaseExperiment framework, to the restore() behavior update from
the previous change.  Existing traces should continue to be usable.

This is not tested yet, mainly because I don't have access to most of
the experiment targets / guest systems necessary for testing.  Please
test your own experiments if possible, or at least leave me a note
that you couldn't test it!

Especially the cored-voter/experiment.cc update may be broken, but
maybe the "FISHY" +2 in there was not OK in the first place.

Change-Id: I0c5daeabc8fe6ce0c3ce3e7e13d02195f41340ad
2015-03-18 18:22:21 +01:00
91a9c6f688 core/sal: restore() more reliable for bochs
BochsController::restore() now recreates a state more expectable from
the experiment.  The state is now the same that save() leaves behind
in its most prominent use case after hitting a breakpoint.  This
change breaks backwards compatibility with some experiments, see
below!

Right after a breakpoint on a specific address fired and
BochsController::save() was called, another breakpoint on that
specific address would not fire again (unless that instruction is
executed again later on).

Up to this change, the situation after calling
BochsController::restore() was different:  A breakpoint on that
specific address would fire twice.  This difference led to the problem
that running the tracing plugin after save() would work fine
(recording the current instruction once, since 3dc752c "tracing: fix
loss of first dynamic instruction"), but running it after restore()
would record the current instruction *twice*.

This change aligns restore()'s behavior to that of save().  The
implications for existing experiments, traces and results are:

 -  Existing result data should be not affected at all, as
    trace.time1/time2 were correct before this change.  Nevertheless,
    the assumption time2-time1 >= instr2-instr1 does not hold for
    equivalence classes including the first instruction, if the latter
    was faultily recorded twice (see below).

 -  Existing traces that were recorded after a restore() (with a
    tracing plugin including the aforementioned commit 3dc752c)
    contain the first instruction twice.  An affected trace can be
    corrected with this command line:

      dump-trace old.tc | tail -n +2 | convert-trace -f dump -t new.tc

 -  For experiments that record traces after a restore() (such as
    ecos_kernel_test), nothing changes, as both the tracing and the
    fast-forwarding before the fault injection now see one instruction
    event less.

 -  Experiments that record traces after a save(), especially those
    that rely on the generic-tracing experiment for tracing, now see
    one instruction event less, before they need to inject their
    fault.  These experiments need to be adjusted, for example
    dciao-kernelstructs now should use bp.setCounter(injection_instr)
    instead of bp.setCounter(injection_instr+1).

Change-Id: I913bed9f1cad91ed3025f610024d62cfc2b9b11b
2015-03-06 08:38:40 +01:00
bd5802e5d7 core/sal: allow repeating BochsController::save
BochsController::save() now can in principle be called multiple times
in a row.  Not that this would really make sense, but the results are
consistent now.

Change-Id: Ib4c6eb571a364b0f7ea6142c8cfec004a12f98b3
2015-03-06 08:38:40 +01:00
d2899e8db7 core/sal: silence "unused function" warning
BochsHelpers.hpp is included by some aspect headers, which are implicitly
included into many (all?) translation units.  As in most TUs the "static
inline" defined getCPU function is not used, every time a "unused function"
warning was generated.

Change-Id: Ibb903fe7a11aaf1f455a626c8bf8b86f50857645
2015-02-09 11:02:40 +01:00
8973f65a50 util: don't leak resources from SumTree
This fixes the resource-leaking "should never happen" case when no
element is found by returning a notfound member.  Found by Coverity
Scan, CID 25555.

Change-Id: I9055ae0a3b31e61f3a8e3b098ec5613c3b5535f6
2015-02-07 18:20:40 +01:00
0fce4f435c tracing: fix "IP only" tracing
Only tracing the instruction pointer was broken, memory accesses were
always traced additionally.  Found by Coverity Scan, CID 25495.

Change-Id: Ideb66175865c85bcd48f4b3786d5d8f16810d4f1
2015-02-07 18:20:39 +01:00
6a0214b132 ProtoStream: member variable -> local var
The contained state is not used over function boundaries anyways.
Found by Coverity Scan, CID 25689.

Change-Id: I34e42c227710be4859f6d62de9311c4201ed29b0
2015-02-07 18:20:39 +01:00