Commit graph

9 commits

Author SHA1 Message Date
Robin Sommer
c8dfdb4492 Merge remote-tracking branch 'origin/topic/robin/interpreter-exceptions'
* origin/topic/robin/interpreter-exceptions:
  Adding test for new error handling.
  Experimental code to better handle interpreter errors.

This seems to work fine and it catches some potentially nasty crashes
so I'm merging it in even though it's not the final word on error
handling yet. #646 tracks the work scheduled for later.
2011-10-21 10:35:32 -07:00
Robin Sommer
63b46a0ae2 Fixing a bunch of format strings.
Also leveraging GCC if available to check format specificier.

Closes #567.
2011-10-18 17:39:40 -07:00
Robin Sommer
15ab287436 Experimental code to better handle interpreter errors.
Currently, a lot of interpreter runtime errors, such as an access to
an unset optional record field, cause Bro to abort with an internal
error. This is an experimental branch that turns such errors into
non-fatal runtime errors by internally raising exceptions. These are
caught upstream and processing continues afterwards.

For now, not many errors actually raise exceptions (the example above
does though). We'll need to go through them eventually and adapt the
current Internal() calls (and potentially others). More generally, at
some point we should cleanup the interpreter error handling (unifying
errors reported at parse- and runtime; and switching to exceptions for
all Expr/Stmt/Vals). But that's a larger change and left for later.

The main question for now is if this code is already helpful enough to
go into 2.0. It will quite likely prevent a number of crashes due to
script errors.
2011-10-09 20:28:06 -07:00
Gregor Maier
a9155aceb2 Fix missing format string that caused some segfaults (v2)
My previous fix wasn't enough.
2011-09-04 09:50:21 -07:00
Robin Sommer
f83650f14a Fixing reporter's weird flow method. 2011-07-11 22:18:22 -07:00
Robin Sommer
df1b2f922b Renaming reporter_message to report_info.
Same change internally.
2011-07-07 19:56:25 -07:00
Robin Sommer
9709b1d522 Merge remote branch 'origin/topic/robin/reporting'
* origin/topic/robin/reporting:
  Syslog BiF now goes through the reporter as well.
  Avoiding infinite loops when an error message handlers triggers errors itself.
  Renaming the Logger to Reporter.
  Overhauling the internal reporting of messages to the user.

Updating a bunch of tests/baselines as well.

Conflicts:
	aux/broccoli
	policy.old/alarm.bro
	policy/all.bro
	policy/bro.init
	policy/frameworks/notice/weird.bro
	policy/notice.bro
	src/SSL-binpac.cc
	src/bro.bif
	src/main.cc
2011-07-01 13:59:21 -07:00
Robin Sommer
fb6a8cec19 Avoiding infinite loops when an error message handlers triggers errors
itself.

If an error is triggered inside one of the reporter_* handlers, the
message about that will now fall back to stderr.
2011-07-01 10:04:27 -07:00
Robin Sommer
66e2c3b623 Renaming the Logger to Reporter.
Also changing output to not include timestamps when we haven't started
processing packets yet.
2011-07-01 09:22:33 -07:00
Renamed from src/Logger.h (Browse further)