Commit graph

6667 commits

Author SHA1 Message Date
Robin Sommer
4da209d3b1 Installing a handler for running out of memory in "new".
Bro will now print an error message in that case rather than abort
with an uncaught exception.
2012-08-16 11:49:51 -07:00
Seth Hall
b13196cbf1 Fixed more potential problems with deadlocked ES threads and signals from libcurl. 2012-08-16 09:24:25 -04:00
Robin Sommer
ae4066dcf8 Fixing problem with type list. 2012-08-14 17:16:53 -07:00
Soumya Basu
a41efd495d Still segfaults. No real updates. 2012-08-13 16:33:27 -07:00
Soumya Basu
bbaa35434b Added the HyperLogLog files to the repository, and the size method works as well. The add method has an error with the hashkeys thus far and no other methods outside of init and size have been tested yet. 2012-08-11 16:45:58 -07:00
Robin Sommer
9cea1d3b27 Merge remote-tracking branch 'origin/topic/seth/reporter-to-stderr'
* origin/topic/seth/reporter-to-stderr:
  A couple of tests for printing reporter messages to STDERR.
  Small improvements for printing reporter messages to STDERR.
  Reporter warnings and error now print to stderr by default.

Closes #836.
2012-08-10 12:29:07 -07:00
Soumya Basu
a376f2244e Initial commit. Everything compiles, but it seg faults when you try adding an element to the cardinality counter. 2012-08-09 17:11:57 -07:00
Bernhard Amann
a2b5028b58 fix little sneaky bug in input framework with an edge case.
An assertion would trigger in the case when a predicate refuses
a new entry and another entry with the same index elements was
already in the table. (I thought that code block was unreachable
... did not think of this case).
2012-08-04 22:38:26 -07:00
Robin Sommer
9829cf9a29 Fixing little typo with big impact. 2012-08-03 10:45:45 -07:00
Jon Siwek
7b2c3db488 Improve log filter compatibility with remote logging.
If a log filter attempts to write to a path for which a writer is
already instantiated due to remote logging, it will re-use the writer
as long as the fields of the filter and writer are compatible, else
the filter path will be auto-adjusted to not conflict with existing
writer's.  Conflicts between two local filters are still always
auto-adjusted even if field types agree (since they could still
be semantically different).

Addresses #842.
2012-07-30 13:17:49 -05:00
Robin Sommer
38c2ee6894 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Add missing breaks to switch cases in ElasticSearch::HTTPReceive().
2012-07-30 09:13:49 -07:00
Jon Siwek
00d41bb549 Add missing breaks to switch cases in ElasticSearch::HTTPReceive().
Observed as reason for segfault in
testing/btest/scripts/check-test-all-policy.bro unit test when compiled
with optimizations.
2012-07-30 11:07:43 -05:00
Robin Sommer
4ba038070f Tweaking writer API for failed rotations.
There are now two FinishedRotation() methods, one that triggers
post-processing and one that doesn't. There's also insurance built in
against a writer not calling either (or both), in which case we abort
with an internal error.
2012-07-28 16:38:22 -07:00
Jon Siwek
4359bf6b42 Fix log manager hanging on waiting for pending file rotations.
This changes writer implementations to always respond to rotation
messages in their DoRotate() method, even for failure/no-op cases
with a new RotationFailedMessage.  This informs the manager to
decrement its count of pending rotations.

Addresses #860.
2012-07-28 16:23:59 -07:00
Robin Sommer
c66c6d7c46 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Small (potential performance) improvement for logging framework.
  Script-level rotation postprocessor fix.
  update input framework documentation to reflect want_record change.
  Fix crash when encountering an InterpreterException in a predicate in logging or input Framework.
  make want_record=T the default for events
2012-07-27 12:26:18 -07:00
Robin Sommer
1fd0d7a607 Changing the start/end markers in logs to open/close now reflecting
wall clock.

Triggers lots of (simple) baseline updates.
2012-07-27 12:15:21 -07:00
Bernhard Amann
f02ed65878 Fix crash when encountering an InterpreterException in a predicate in logging or input Framework.
Inputframework: did not contain any error handling for this case.

Logging framework: tried to catch the interpreter-exception. However the exception already was caught
by the call-function and not propagated. Instead, call returns a 0-pointer in this case, which
lead to a segmentation fault.
2012-07-26 21:51:29 -07:00
Robin Sommer
f5862fb014 Preventing writers/readers from receiving further messages after a
failure.

Once a writer/reader Do* method has returned false, no further ones
will be executed anymore. This is primarily a safety mechanism to make
it easier for writer/reader authors as otherwise they would often need
to track the failure state themselves (because with the now delayed
termination from the earlier commit, furhter messages can now still
arrive for a little bit).
2012-07-26 17:27:56 -07:00
Robin Sommer
743fc1680d Improving error handling for threads.
If a thread command fails (like the input framework not finding a
file), that now (1) no longer hangs Bro, and (2) even allows for
propagating error messages back before the thread is stops.

(Actually, the thread doesn't really "stop"; the thread manager keeps
threads around independent of their success; but it no longer polls
them for input.)

Closes #858.
2012-07-26 17:27:34 -07:00
Robin Sommer
d262a70509 Merge remote-tracking branch 'origin/fastpath'
Small tweak: I added the "same writer" constraint to the loop
condition as well. Makes sense?

* origin/fastpath:
  Change path conflicts between log filters to be auto-corrected.
2012-07-26 15:30:35 -07:00
Jon Siwek
63e8bf72ed Change path conflicts between log filters to be auto-corrected.
This change makes it so when differing logging filters on the same
stream attempt to write to the same writer/path combination, the path
of the filter doing the later write will be automatically adjusted so
that it does not conflict with the other.  The path is adjusted by
appending "-N", where N is the smallest integer greater or equal to 2
required to resolve the path name conflict.

Addresses #842.
2012-07-26 16:55:49 -05:00
Robin Sommer
951444ee73 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  and remove superflous print.
  add testcase for subrecords and events add missing binary testcase (Baseline is in master, testcase is missing for some reason) make error output for nonmatching event types much more verbose
  Add more error handling for close() calls.
  add testcase for subrecords to input framework tests
2012-07-26 14:34:58 -07:00
Bernhard Amann
4a959c1a33 Merge remote-tracking branch 'origin/fastpath' into fastpath 2012-07-26 12:13:46 -07:00
Bernhard Amann
1a49363bbe add testcase for subrecords and events
add missing binary testcase (Baseline is in master, testcase is missing for some reason)
make error output for nonmatching event types much more verbose
2012-07-26 12:12:54 -07:00
Jon Siwek
734e5f68d3 Add more error handling for close() calls. 2012-07-26 12:40:12 -05:00
Jon Siwek
c48a16664b Fix double close() in FilerSerializer class. 2012-07-25 18:05:42 -05:00
Bernhard Amann
d29e691da9 ...adapt to new api... 2012-07-25 15:05:08 -07:00
Bernhard Amann
da157c8ded Merge remote-tracking branch 'origin/master' into topic/bernhard/sqlite
Conflicts:
	scripts/base/frameworks/logging/__load__.bro
	src/CMakeLists.txt
	src/logging.bif
	src/types.bif
2012-07-25 15:04:23 -07:00
Seth Hall
f2a0afad3c Fixes to elasticsearch plugin to make libcurl handle http responses correctly. 2012-07-25 17:01:47 -04:00
Robin Sommer
a33e9a6941 Fixing FreeBSD compiler error. 2012-07-25 13:58:23 -07:00
Robin Sommer
7e228f1d6b Silencing compiler warnings. 2012-07-25 13:58:08 -07:00
Jon Siwek
4abcfa1f66 Fix complaint from valgrind about uninitialized memory usage. 2012-07-25 12:42:46 -05:00
Jon Siwek
2fafadd930 Fix differing log filters of streams from writing to same writer/path.
Since WriterFrontend objects are looked up internally by writer type and
path, and they also expect to write consistent field arguments, it could
be the case that more than one filter of a given stream attempts to
write to the same path (derived either from $path or $path_func fields
of the filter) with the same writer type.  This won't work, so now
WriterFrontend objects are bound to the filter that instantiated them so
that we can warn about other filters attempting to write to the
conflicting writer/path and the write can be skipped.  Remote logs don't
appear to suffer the same issue due to pre-filtering.

Addresses #842.
2012-07-25 12:20:12 -05:00
Daniel Thayer
91522e7836 Fix tests and error message for to_double BIF 2012-07-25 12:10:47 -05:00
Robin Sommer
5af131e303 Compile fix. 2012-07-24 16:10:52 -07:00
Robin Sommer
28c5723775 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Correct a typo
  Fix file permissions of log files
2012-07-24 16:02:41 -07:00
Robin Sommer
9e97f7c2aa Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix memory leak when processing a thread's input message fails.
  add comparator functor to the info maps of readerbackend and readerwriteend.
  Fix initialization of WriterFrontend names.
2012-07-24 15:22:52 -07:00
Daniel Thayer
b9a76d7ed0 Fix file permissions of log files
A recent commit was erroneously causing new log files to be created with
execute permissions.
2012-07-24 17:21:30 -05:00
Daniel Thayer
063fd204cc Merge remote-tracking branch 'origin/master' into fastpath 2012-07-24 17:13:05 -05:00
Robin Sommer
f5214c0793 Merge remote-tracking branch 'origin/topic/bernhard/input-fixes'
* origin/topic/bernhard/input-fixes:
  fix problem with possible access to unititialized memory (thanks robin :) )
  and just to be a little bit careful - add check if the field description is long enough. Otherwise there might possibly be an access of uninitialized memory, when someone reads a file that contains just #fields without any following field descriptions.
  and like nearly always - forgot the baseline.
  Input framework now accepts escaped ascii values as input.
  make reading ascii logfiles work when the input separator is different from \t.
2012-07-24 15:08:35 -07:00
Robin Sommer
c36a449c76 New built-in function to_double(s: string).
Closes #859.
2012-07-24 15:05:13 -07:00
Robin Sommer
43752b3d9f Reverting accidentally committed changes.
Thanks, Bernhard!
2012-07-24 11:16:03 -07:00
Robin Sommer
0d748c117d Adding missing include needed on some systems. 2012-07-24 11:06:34 -07:00
Jon Siwek
d6da8365f5 Merge branch 'fastpath' of git://git.bro-ids.org/bro into fastpath 2012-07-24 11:27:05 -05:00
Jon Siwek
cfa8769a42 Fix memory leak when processing a thread's input message fails.
The message is reclaimed in both success/fail cases now.
2012-07-24 11:22:51 -05:00
Bernhard Amann
13952154a1 add comparator functor to the info maps of readerbackend and readerwriteend.
This is required, because after the recent changes the info map containst a
char* as key. Without the comparator the map will compare the char addresses
for all operations - which is not really what we want.
2012-07-24 09:19:20 -07:00
Jon Siwek
3f4b4c88a6 Fix initialization of WriterFrontend names.
The string representation of the writer looked up based on the stream's
enum value instead of the writer's enum value, often causing this
component of the name to be "(null)" since a null pointer was returned
from the lookup.
2012-07-24 11:18:32 -05:00
Bernhard Amann
f887535f1c fix problem with possible access to unititialized memory
(thanks robin :) )
2012-07-23 17:28:27 -07:00
Robin Sommer
c2e0949484 Merge remote-tracking branch 'remotes/origin/topic/jsiwek/ascii-timestamp-fix'
* remotes/origin/topic/jsiwek/ascii-timestamp-fix:
  Fix WriterBackend::WriterInfo serialization, reenable ascii start/end tags.
2012-07-23 16:36:55 -07:00
Robin Sommer
24aea295fa Merge branch 'topic/robin/master-test'
* topic/robin/master-test: (60 commits)
  Script fix for Linux.
  Updating test base line.
  Another small change to MsgThread API.
  Bug fix for BasicThread.
  make version_ok return true for TLSv12
  Sed usage in canonifier script didn't work on non-Linux systems.
  Changing HTTP DPD port 3138 to 3128.
  Temporarily removing tuning/logs-to-elasticsearch.bro from the test-all-policy.
  More documentation updates.
  Revert "Fixing calc_next_rotate to use UTC based time functions."
  Some documentation updates for elasticsearch plugin.
  Give configure a --disable-perftools option.
  Updating tests for the #start/#end change.
  Further threading and API restructuring for logging and input frameworks.
  Reworking forceful thread termination.
  Moving the ASCII writer over to use UNIX I/O rather than stdio.
  Further reworking the thread API.
  Reworking thread termination logic.
  If a thread doesn't terminate, we log that but not longer proceed (because it could hang later still).
  Removing the thread kill functionality.
  ...
2012-07-23 16:20:44 -07:00