Commit Graph

931 Commits

Author SHA1 Message Date
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
e99e4aafa8 JobServer: initialize sockaddr_in
This most probably is not a real problem, but does not take much work
to fix.  Found by Coverity Scan, in several reports.

Change-Id: I8bd12e3f7afeb4b1c4e1b057bdbd95da9aa9211c
2015-02-07 18:20:39 +01:00
8c2b6cf028 JobServer: fix socket leaks
Found by Coverity Scan, CID 25600.

Change-Id: Ic0c549928ce8058c145d178ed06b41b543676460
2015-02-07 18:20:30 +01:00
2c6aa6cd37 ElfReader: fix conditional free
buff cannot be zero.  Found by Coverity Scan, CID 25712.

Change-Id: Ibb411be376aab13832e3e5593fe001df1cbfc051
2015-02-07 17:29:48 +01:00
975d4de90d ecos: detect potential ftell failure
ftell() potentially fails and returns -1.  Found by Coverity Scan,
CID 25546.

Change-Id: Ifcf6fa8593cb1f3f54dbbff27ac021d46468a40c
2015-02-07 17:29:46 +01:00
a19eb6db74 DwarfReader: fix premature fd close
When Richard decided we need not yet give up when dwarf_srclines()
fails, he left a -- now premature -- close(fd) behind.  Found by
Coverity Scan, CID 25806.

Change-Id: I0bc0cb6796225c9efaf5290e2799b6814f88e5b4
2015-02-07 17:29:44 +01:00
0e305034e9 Disassembler: restore ostream state after changing it
Found by Coverity Scan, CID 25679.

Change-Id: Ia0c175cd79ddc42ab9154c667db0d647618e41e2
2015-02-07 17:29:42 +01:00
141cefbaf4 DatabaseProtobufAdapter: remove unused struct field
Found by Coverity Scan, CID 25685.

Change-Id: Id7c9d756a7f824af41d1315740f7415f021eaa91
2015-02-07 17:29:41 +01:00
c499292e2f DatabaseProtobufAdapter: init top-level type bridge
Found by Coverity Scan, CID 25724.

Change-Id: I30ab9251bd0b6c60a64075a5cf934f40874a7c6c
2015-02-07 17:29:40 +01:00
26076d070c DatabaseProtobufAdapter: fix uninitialized members
Found by Coverity Scan, CID 25694.

Change-Id: I8fbb1434b73dcecb16675da870e73f1ad39391e4
2015-02-07 17:29:38 +01:00
0047919644 Database: fix tmp array deletion
Found by Coverity Scan, CID 25544.

Change-Id: Iaf0866ebd4a458fabfe79336d8c8b639e42147c5
2015-02-07 17:29:37 +01:00
cf6b481d5e DatabaseExperiment: fix uninitialized variable
Found by Coverity Scan, CID 25741.

Change-Id: I6105fe76afbfe0a6ec76b59778214683d7d754e2
2015-02-07 17:29:35 +01:00
a7184af37b core/sal: uninitialized BochsController member
False positive, nevertheless worth fixing.  Found by Coverity Scan,
CID 25723.

Change-Id: Ia4f1eb033d7cc8c20889280a59d8973ecf768933
2015-02-07 17:29:34 +01:00
61038c2578 core/sal: fix CPUState bracing error
This is why our coding style suggests braces even for single-line "if"
or loop bodies.  Found by Coverity Scan, CID 25767.

Change-Id: I53062286accba7c0fc9795ecea0a5e2795443321
2015-02-07 17:29:32 +01:00
fe9e25374a CampaignManager: initialize campaign member
Found by Coverity Scan, CID 25798.

Change-Id: Ib310ca3198c78a8e01d044d90ada1cd0c22b26d6
2015-02-07 17:29:29 +01:00
412ecbba63 dbcampaign: skip existing pilots with wrong fspmethod
Loading existing pilots with a different fspmethod_id is a waste of
time.

Change-Id: I3519a14822029999fa2ed854daff9853c0cbeec1
2015-01-21 14:53:33 +01:00
d58694521c dbcampaign: don't include fspmethod/variant ID in job msg
These IDs don't make sense by themselves but only after a lookup in the
database, which clients usually don't have (and don't need) access to.

Conflicts:
	src/core/comm/DatabaseCampaignMessage.proto.in

Change-Id: Ice739463552039b7fb48581722ea2e05984cea47
2015-01-21 14:53:32 +01:00
c422911741 dbcampaign: allow wildcard for prune method
Using mixed pruning methods now does not require to run the campaign
server twice anymore.

Change-Id: I3f62c269166b750892bb0e659ad0c180425d1479
2015-01-21 14:53:32 +01:00
336ffd6453 Merge branch 'sampling'
Change-Id: Id6be7954b0bafcbfd64ba702e69e016bd2810115
2015-01-21 14:53:28 +01:00
39df0a979e Merge branch 'listener-perf-bug'
Change-Id: Ia863115ec31011ad2b7a954543c8ee64188d3d32
2015-01-21 14:52:33 +01:00
99a923b11e Merge remote-tracking branch 'origin/master' into sampling-wip
Change-Id: Iae5c02be5801d75e8adc55222ccb35c559f7ebf4
2015-01-21 00:22:28 +01:00
f8e0f1bb3f util: add SumTree::iterator
Change-Id: I8304b64634fa3ab92a126fe5d942674b26334b3d
2015-01-21 00:17:48 +01:00
2f70e05db6 util: rename SumTree::get -> remove, add r/o get
SumTree::get now non-intrusively picks an element and returns a
reference to it, SumTree::remove removes and returns a copy.  The
former is needed for sampling with replacement.

Change-Id: Iefef2fdf0b7df6ea7a9949f2588528ec9e86bb7a
2015-01-21 00:17:48 +01:00
b0c58bab78 util: SumTree::add() documentation
This function copies the reference argument 'element' internally.

Change-Id: I33d94f224bc2b1b89057b90258d500eaa364ab85
2015-01-21 00:17:48 +01:00
a00c4d9a69 util/DwarfReader: plug file-descriptor leaks
This change fixes several file-descriptor leaks in the DwarfReader
implementation.  The patch is taken from Richard Hellwig's not yet
merged change I161f626d12ca7f2b7b9d13ba9cbc254eb55692f1.  I did not
apply any white-space cleanups to prevent conflicts when Richard's
change will be merged later.

Change-Id: Icd9c1bdeeab39e77900e2ce88b756a8cf7ade96a
2015-01-14 10:15:29 +01:00
d68ea990ca sal: catch listener removal corner case
This change makes sure an active but not-yet fired listener does not fire
anymore if it gets removed.  In this case, the listener already has an
invalid index, but still needs to be copied to the delete list.

This issue has not been observed in the wild, and is unlikely to have
caused real problems in the past.

Change-Id: I8be8a5b1d4cdc783a092b93f34f33b969894e5da
2015-01-13 19:22:49 +01:00
c4d44aeb0c sal: fix watch/breakpoint perf implementation
This commit changes the entities in a ResultSet from listener indexes
(into ListenerManagers m_BufferList) to BaseListener pointers, as
ListenerManager::makeActive(BaseListener*) (called from
FastBreakpoints/Watchpoints.ah) may invalidate indexes temporarily
stored in a ResultSet.  The issue occurs when multiple breakpoints
(watchpoints) fire at the same time, and one added more recently than
the others occupies the largest index position in m_BufferList.

Although this issue is extremely rare and was only observed in a few
corner cases up to now, it may have falsified results in the past.

Change-Id: I7b788a06d412f15700ca75f56f2be5d3b78465fa
2015-01-13 19:22:49 +01:00
a3a77141f3 ezs-logger: Added missing dependency
There was a missing depenency to fail-util.

Change-Id: I32ea7f184affa6f95ea28d7254699872fd501a22
2014-12-16 16:36:37 +01:00
e83e87ecc7 DwarfReader: fixed linetable mapping
This change alters/corrects DwarfReader's way of determining the size of
linetable entries (i.e. their "range size"); the interface (e.g. to
ElfReader) stays the same. Prior to this, it was assumed that static
instructions within "the linetable" were sorted in ascending order. This
assumption turned out to be false, as every compilation unit's  header has
its own linetable and the compilation unit headers are not sorted by their
static instructions.
Furthermore this change implements normalization of file names.

Change-Id: Ia4beb7bf9cfb6f1a499aeebd01228335b70ab52d
2014-12-03 19:29:12 +01:00
c00268242a Merge changes I7fe63611,I84ebbb50
* changes:
  util/DwarfReader, ElfImporter: import address ranges
  util/DwarfReader, ElfImporter: use unsigned addresses
2014-10-23 07:53:46 +02:00
491312bb91 GenericExperiment: A standardized fault injection experiment
The GenericExperiment is a standard campaign+experiment pair. It is
derived from the DatabaseCampaign+DatabaseExperiment. Its experiment
endpoints are set on the command line, therefore it can be used to give
users a first impression of FAIL*. Currently it supports different
endpoints:

--trap: Catch all traps that occur and end the experiment
--timeout <N>: kill the experiment after N microseconds
--catch-write-text: detect writes on the text segment
--catch-write-outerspace: detect writes into nirvana
--{ok,fail,detected}-marker: groups of ELF symbols that are used as
     execution breakpoints

Change-Id: Idc7fcf8875953f1007e1a37bacb086eddd29cd10
2014-10-22 18:31:58 +02:00
d53c83d7c8 TimerListener: make timeout field changeable
An accessor for the m_Timeout field was missing.

Change-Id: Idf86a3da16a328c783613ed8502446d561f6287c
2014-10-22 18:31:57 +02:00
6ebd9b003a DatabaseExperiment: base class for distributed fail experiments
The DatabaseExperiment is a class a concrete experiment can inherit
from. It handles the communication with the campaign server. Does the
fast forward to the fault location, injects the fault and gives the
result over experiment outcome to the child class.

Change-Id: I1fb676da6c704cd570a638f0dfaadd4f1a9845e4
2014-10-22 17:30:07 +02:00
0ba03ca97e cmake: Set PROTOBUF_IMPORT_DIRS in toplevel dir
The variable PROTOBUF_IMPORT_DIRS has to be set in the toplevel
CMakeLists.txt, since the import path has to be available for all .proto
files within all subdirectories. Without this addition, the
GenericExperiment will fail to compile.

Change-Id: I676e0abd83bd1c5d247afcd33e7522e72da3dc2f
2014-10-22 16:35:17 +02:00
5378573b1d util/DwarfReader, ElfImporter: import address ranges
This change implements the following:
-DwarfReader now exports the address range of linetable-entries instead of
	only the first address
-ElfImporter saves this range alongside the mapping

Change-Id: I7fe6361178f761a8f605a44bb0183c56a236cc95
2014-10-22 15:42:05 +02:00
d94b005be2 util/DwarfReader, ElfImporter: use unsigned addresses
This change alters DwarfReader and import-trace's ElfImporter so that they use
unsigned int for static address and line numbers instead of signed int.

Change-Id: I84ebbb500afd7cd4d93b137a35dcf736dc679fab
2014-10-22 14:30:43 +02:00
0317be8f8f cmake: Replace the experiment configuration mechanism
The inline configuration mechanism did work properly for iterated
invocation of cmake. But since the configuration items were set after
the decision was made whether a tool was build or not, they had only
influence on the second run of cmake.

The experiment configuration is no saved in a config.cmake file, which
populates the CMakeCache.txt before any other CMakeLists.txt is read.

Change-Id: I6eca1c6e462af3a241bd9c5b9a27a71a1f5d2829
2014-10-21 17:57:44 +02:00
f7e205f01a experiment/generic-tracing: inline the required configuration
The configuration from weather-monitor was also stripped down to those
values which do not represent the default settings.

Change-Id: I207306e555067156a4ed80edcbcd524137bc8e27
2014-10-21 17:07:57 +02:00
c24e54f2d4 weather-monitor: adapt CMake configuration for experiment
The configuration needed to build this experiment is no noted within the
experiment's CMakeLists.txt. This allows the easy building of this
experiment.

Change-Id: Ifddc4e6a8fa4e63c4656058166f9ef42e46e1edb
2014-10-21 12:41:59 +02:00
7ee105016c cmake/bochs: more strict dependency handling for libfailboch_external
The configure step for libfailbochs_external could be executed parallel
to other build steps, which required the files produced by the configure
step. Therefore a race-condition occurred. By giving the configure step
an explicit target name, more correct dependencies could be modeled
within bochs.cmake.

Change-Id: If2d7dafdace23b0eba6efcdff3ed0bfca2423048
2014-10-21 12:39:42 +02:00
66408e83ce Merge branch 'llvm-rtti' 2014-10-01 15:02:00 +02:00
ebbf35c509 Merge branch 'tools-report-unknown-parameters' 2014-10-01 13:58:57 +02:00