GH-211: improve consistency of how scripting errors are handled

Scripting errors/mistakes now consistently generate a runtime error
which have the behavior of unwinding the call stack all the way out of
the current event handler.

Before, such errors were not treated consistently and either aborted
the process entirely or emitted a message while continuing to execute
subsequent statements without well-defined behavior (possibly causing
a cascade of errors).

The previous behavior also would only unwind out of the current
function (if within a function body), not out the current event
handler, which is especially problematic for functions that return
a value: the caller is essentially left a mess with no way to deal
with it.

This also changes the behavior of the startup/initialization process
to abort if there's errors during bro_init() rather than continue one
to the main run loop.  The `allow_init_errors` option may change this
new, default behavior.
This commit is contained in:
Jon Siwek 2019-01-30 11:20:09 -06:00
parent 49a30d61cf
commit 67484a90fa
49 changed files with 374 additions and 144 deletions

View file

@ -30,7 +30,7 @@ export BRO_SEED_FILE=$source_dir/testing/btest/random.seed
function run_bro
{
bro -X $conf_file broxygen >/dev/null 2>$bro_error_file
ZEEK_ALLOW_INIT_ERRORS=1 bro -X $conf_file broxygen >/dev/null 2>$bro_error_file
if [ $? -ne 0 ]; then
echo "Failed running bro with broxygen config file $conf_file"