Commit Graph

116 Commits

Author SHA1 Message Date
Jeff Morriss 470bd4455a Add a new environment variable to cause abort()s if we add too many items
to the tree (to separate this case from the generic DISSECTOR_BUG case).

Enable this environment variable when fuzz testing.

Enable the 3rd (without tree but with a read filter) check (added in r49643)
when testing capture files but not when fuzz testing--not sure if we want to
add even more to the fuzzbot's work load now (OTOH I've been running it for
a while and it hasn't buried me in bugs).

svn path=/trunk/; revision=49784
2013-06-05 14:08:40 +00:00
Jeff Morriss b49c3e7eca Oh yeah, -R is now -Y in trunk.
svn path=/trunk/; revision=49646
2013-05-31 02:03:03 +00:00
Jeff Morriss c56c403a52 As discussed in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8728#c4 :
Running tshark with a read filter ("-R") and without building the full tree
("-V") causes it to run into some more bugs (usually loops adding more than
100000 items to the tree).  Add some (commented out for now) code to do
this...

svn path=/trunk/; revision=49643
2013-05-31 01:38:55 +00:00
Jeff Morriss 4509929f2a Exit if we can't load the test-common.sh library.
svn path=/trunk/; revision=49625
2013-05-30 00:35:46 +00:00
Evan Huus 0c671d8d4d Remove some of the extra noise added while trying to figure out why
the build-bot's valgrind pass wasn't running with/without tree. It's still
broken, but the debug output wasn't giving us any useful information.

svn path=/trunk/; revision=49464
2013-05-20 22:00:39 +00:00
Evan Huus 0a530b2a1f When fuzzing with valgrind and running without -T, run with -v so that the
argument string is non-empty. Perhaps this will fix the fuzz-bot which fails
to run with the empty argument string...

svn path=/trunk/; revision=49075
2013-04-27 14:03:45 +00:00
Gerald Combs b25fa89125 Reverse the arguments we feed to valgrind-wireshark.sh. Add debugging
output.

svn path=/trunk/; revision=48895
2013-04-17 17:23:41 +00:00
Gerald Combs 3c66ac4b83 Forward-port r47305 from trunk-1.8:
------------------------------------------------------------------------
  r47305 | gerald | 2013-01-26 12:12:52 -0800 (Sat, 26 Jan 2013) | 6 lines
  Changed paths:
     M /trunk-1.8/tools/fuzz-test.sh

  Instead of setting resource limits on the fuzz-test.sh process itself,
  set limits on the TShark subprocess. This should hopefully take care
  of the strange fuzz failures we've seen lately.

  Reduce the maximum CPU time to 5 minutes while we're at it.
  ------------------------------------------------------------------------

svn path=/trunk/; revision=47307
2013-01-26 20:36:57 +00:00
Evan Huus 5c57af2df2 When fuzz-testing with valgrind, run both with and without tree (like when
fuzz-testing without valgrind).

svn path=/trunk/; revision=46950
2013-01-05 14:27:37 +00:00
Gerald Combs 739c90f0ad Move a lot of common fuzz-test and randpkt-test code to its own file
(test-common.sh). Add build information to the error output as suggested
in http://www.wireshark.org/lists/wireshark-dev/201212/msg00037.html

svn path=/trunk/; revision=46446
2012-12-07 17:57:09 +00:00
Gerald Combs 6c92b6d86a Add an option (-P) for a minimum plugin count.
svn path=/trunk/; revision=45800
2012-10-26 16:30:48 +00:00
Evan Huus bfe304a9a4 Make the fuzz-test plugin error into a warning, since lacking plugins
doesn't seem (to me) to warrant preventing someone from fuzz-testing.

Anyone know why this was put in in the first place?

svn path=/trunk/; revision=45733
2012-10-22 23:33:48 +00:00
Gerald Combs ff32bd8000 If our error output is huge (> 5 MB) trim out the middle of the file.
The recent loop bugs have generated output that's too large to attach to
Bugzilla.

svn path=/trunk/; revision=45437
2012-10-09 20:47:22 +00:00
Gerald Combs 52972458e8 Add the command and arguments to the error file.
svn path=/trunk/; revision=45294
2012-10-03 18:03:12 +00:00
Gerald Combs a5b9de38b4 Fix return code checking (hopefully).
svn path=/trunk/; revision=45289
2012-10-03 16:39:35 +00:00
Gerald Combs 498db62022 Test with the presence (-nVxr) and absence (-nr) of the tree. We now
use an array of arguments so additional combinations can be added.

svn path=/trunk/; revision=45258
2012-10-02 17:58:00 +00:00
Gerald Combs 345529250f Run 'git log' if we have a .git directory. Fixes a copy+paste error.
svn path=/trunk/; revision=44784
2012-09-05 20:58:15 +00:00
Evan Huus f385acc461 From Toralf Förster via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7652
Use a fast bash built-in rather than a slow call out to `expr` to increment
the loop count.

svn path=/trunk/; revision=44580
2012-08-19 13:38:53 +00:00
Gerald Combs faf3cdf75d Move error reporting to a common function. Lot information about the
most recent revision / commit.

svn path=/trunk/; revision=44552
2012-08-17 16:28:28 +00:00
Evan Huus 69cd284787 Catch more types of valgrind errors in the fuzz-tester.
These happen when, eg, a program runs out of memory under valgrind
or other more fatal errors (that may sometimes be valgrind bugs instead).

svn path=/trunk/; revision=44451
2012-08-12 14:14:08 +00:00
Evan Huus 2d1575a2d1 Update the usage stanza for fuzz-test to reflect the changes in r44024.
svn path=/trunk/; revision=44083
2012-07-27 22:31:08 +00:00
Evan Huus 69a95ad3a2 valgrind-wireshark.sh:
- add support for 2-pass dissection and config profiles
 - make whitespace a consistent 4-spaces
fuzz-test.sh:
 - update 2-pass support to use -2 and not the old -P
 - add support for fuzz-testing under valgrind with the new -g option

svn path=/trunk/; revision=44024
2012-07-26 02:38:34 +00:00
Jeff Morriss 642099c485 Fix r42293: Make the script actually fail when tshark fails: use a new variable to indicate when we've caught a signal rather than (re-)using MAX_PASSES.
svn path=/trunk/; revision=42295
2012-04-27 17:58:06 +00:00
Jeff Morriss 7891f04d8c Get the script working again in the "unlimited passes" mode.
svn path=/trunk/; revision=42293
2012-04-27 16:58:21 +00:00
Gerald Combs 17febadb12 Terminate our inner loops as well.
svn path=/trunk/; revision=42134
2012-04-18 16:10:08 +00:00
Gerald Combs bb606959f7 Tell the main loop to terminate when we catch a signal instead of trying
to clean up in two places.

svn path=/trunk/; revision=42133
2012-04-18 16:04:05 +00:00
Gerald Combs ad84d4f5d2 Exit if we don't have enough plugins.
svn path=/trunk/; revision=37513
2011-06-01 21:56:11 +00:00
Guy Harris f680be4ca2 Remove the temporary debugging stuff.
svn path=/trunk/; revision=37509
2011-06-01 16:23:51 +00:00
Guy Harris da6a34fce7 Temporary debugging stuff to see in what environment tshark is being
run - the plugins might not be getting loaded, and the goal is to figure
out why.

svn path=/trunk/; revision=37504
2011-06-01 09:12:10 +00:00
Jeff Morriss 4f510bc54d Based on https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5821#c2 :
Move the setting of debug environment variables out of the while loop.

Export MALLOC_OPTIONS=AJ to increase memory allocation debug on FreeBSD (and
others).

Export a number of environment variables that MacOS looks at.

(I don't have easy access to either of these OS so this has not been tested.)

Add a comments for each entry explaining which OS uses it and what it does.

svn path=/trunk/; revision=36622
2011-04-13 15:36:05 +00:00
Jeff Morriss 4cbe8ff6db Fix up indentation
svn path=/trunk/; revision=36461
2011-04-04 18:43:59 +00:00
Gerald Combs 667629d80d Don't clobber the capinfos data if we have a valid capture file. This
should let the original file information show up in bug reports.

svn path=/trunk/; revision=36209
2011-03-17 19:53:28 +00:00
Bill Meier 9b9dcb0161 Export G_SLICE=debug-blocks to do additional memory checks;
From the GLib docs
 "Using this option (present since GLib-2.13) engages extra code which
  performs sanity checks on the released memory slices. Invalid slice
  addresses or slice sizes will be reported and lead to a program halt."

svn path=/trunk/; revision=35165
2010-12-10 03:13:09 +00:00
Chris Maynard e6bbbe1071 Added -b and -C options to usage.
svn path=/trunk/; revision=34702
2010-10-29 23:05:55 +00:00
Bill Meier 175ec40ea0 Add fuzz-test option (-C) to specify a configuration profile.
svn path=/trunk/; revision=34553
2010-10-18 13:21:04 +00:00
Jeff Morriss 7d20440ff0 Introduce 2 new environment variables: WIRESHARK_EP_VERIFY_POINTERS and
WIRESHARK_SE_VERIFY_POINTERS that control whether or not we verify if a given
pointer is ep_ or se_ allocated, respectively.

Turn the behavior off by default for speed reasons (the speed difference isn't
huge, but...).

Turn the behavior on when fuzz testing.

Document these two new variables in the man pages.

svn path=/trunk/; revision=34046
2010-09-02 18:02:06 +00:00
Gerald Combs 334f5715cd Dump the error output when we have a problem.
svn path=/trunk/; revision=33594
2010-07-20 15:49:57 +00:00
Gerald Combs 3bc24f2d98 Try limiting our stack size.
svn path=/trunk/; revision=33466
2010-07-07 16:55:42 +00:00
Gerald Combs e5def72fe7 If BIN_DIR is ".", set WIRESHARK_RUN_FROM_BUILD_DIRECTORY so that we
test plugins.

svn path=/trunk/; revision=33085
2010-06-04 16:59:49 +00:00
Jeff Morriss 2dc4b6ae91 Export MALLOC_CHECK_=3 when fuzz testing in case we're on a glibc-based system:
this value will cause glibc to do some memory allocation checking for us and
abort if it finds a problem.

(If we're not on a glibc-based system this will have no effect but should also
do no harm.)

(I think the buildbot already runs with this set but it's better for all of us
to have it set, too.)

svn path=/trunk/; revision=32528
2010-04-21 00:53:24 +00:00
Jeff Morriss c9b88696c9 Turn on memory scrubbing when fuzz testing.
svn path=/trunk/; revision=32487
2010-04-16 00:56:11 +00:00
Gerald Combs 5bf311e5e5 Exit normally when we trap a signal so that things like Buildbot don't
generate unnecessary errors when we cancel a fuzz test.

svn path=/trunk/; revision=31803
2010-02-05 21:35:59 +00:00
Jeff Morriss 71b8709d52 Use SE canaries when fuzz testing.
svn path=/trunk/; revision=30566
2009-10-15 22:01:59 +00:00
Kovarththanan Rajaratnam 760eb47fc1 Add initial support for "two pass analysis" in tshark. This allows tshark to arrive at the same protocol tree as the Wireshark GUI. Before this change tshark only supported a single scan over the file. This effectively means that packets cannot use data that are gathered from frames that appear after the current frame. By scanning twice we give the dissector the opportunity to make forward references.
svn path=/trunk/; revision=30076
2009-09-22 19:28:00 +00:00
Kovarththanan Rajaratnam c48602900a Add error probability command line parameter
svn path=/trunk/; revision=29486
2009-08-20 17:43:56 +00:00
Gerald Combs 3a5270f542 Temporarily disable dissector bug checking. Fixing the ones we've found
so far will take a while and in the meantime looking for dissector
assertions is keeping us from finding more serious bugs.

svn path=/trunk/; revision=29395
2009-08-12 17:08:08 +00:00
Bill Meier d6925b130e fuzz-test: Fix/change WIRESHARK_ABORT_ON_DISSECTOR_BUG handling:
1. If enabled: the variable must be exported to the env to take effect;
2. Upon reflection: disable this feature:
   tshark has been changed to output WARNING messages to stderr as a
    default; This means that DISSECTOR_BUGs and failed DISSECTOR_ASSERTs
     which cause WARNING log level messages will thus be output to stderr and 
     thus will be detected by the fuzz-test.

svn path=/trunk/; revision=29330
2009-08-07 22:36:14 +00:00
Jeff Morriss e70fdb05a7 Fail the fuzz test (reporting the *input* file as a problem) if capinfos aborts out--like it was for iSeries files prior to rev 25388.
svn path=/trunk/; revision=25389
2008-05-28 15:36:29 +00:00
Stig Bjørlykke 0ce8d6c354 Added an option (-b) to specify directory containing binaries to use for
fuzz testing (tshark, editcap and capinfos).

svn path=/trunk/; revision=25041
2008-04-15 09:12:26 +00:00
Gerald Combs 86027b1ee6 Use cygpath to automatically find our paths under Windows.
svn path=/trunk/; revision=24725
2008-03-24 22:58:34 +00:00
Gerald Combs 0a2fdfe9ec Print the pass number periodically as a convenience for running the script
on a large number of trace files.

svn path=/trunk/; revision=23437
2007-11-12 19:47:15 +00:00
Bill Meier 2fa88cfca3 Don't rename to self when fuzz err; enable ^C file cleanup trap
svn path=/trunk/; revision=22601
2007-08-23 14:56:18 +00:00
Gerald Combs 49a7d578c8 Use a more uniform name for the output files (which makes it easier to
write wrapper scripts).

svn path=/trunk/; revision=18577
2006-06-26 19:49:27 +00:00
Gerald Combs d65312a960 Let the user set the working directory and number of passes from the command
line.  An upcoming Buildbot step will use these.

svn path=/trunk/; revision=18564
2006-06-23 20:39:51 +00:00
Gerald Combs eb71f7fb96 Rename the main executable to "wireshark", along with more conversions:
ethereal.com -> wireshark.org
  mailing lists and addresses
  ETHEREAL -> WIRESHARK
  Man pages
  Automake/Autoconf names


svn path=/trunk/; revision=18271
2006-05-31 19:12:15 +00:00
Gerald Combs 8958bab6de Tethereal/tethereal -> TShark/tshark.
svn path=/trunk/; revision=18268
2006-05-31 17:38:42 +00:00
Jörg Mayer a5c03f490e Mike Duigou:
I noticed that when you run fuzz testing from both a root account and
a user account you can run into problems because the user account tries
to use and delete temp files created by the root account and fails. This
patch uses the same scheme as used for fuzz error files for naming the
tampered file and for the error file to prevent filename/permission
collisions between temp files from different runs.


svn path=/trunk/; revision=17145
2006-02-03 09:29:54 +00:00
Jörg Mayer 1cd8e8ca0c Reminder to clean up in case of ctrl-c etc
svn path=/trunk/; revision=16954
2006-01-05 12:43:35 +00:00
Gerald Combs 25d75e66a7 Set ETHEREAL_ABORT_ON_DISSECTOR_BUG. Make sure we create a core file. Fix
up file names and extensions.

svn path=/trunk/; revision=16190
2005-10-11 15:17:06 +00:00
Jörg Mayer 16bd74ab0c In case the paths to the tools are wrong, inform the
user about it instead of complaining that no capture files
could be found.


svn path=/trunk/; revision=16037
2005-09-28 08:14:54 +00:00
Ulf Lamping 53ace04fe1 fix a problem if the tools have a space char in their path
svn path=/trunk/; revision=14588
2005-06-08 06:40:17 +00:00
Ulf Lamping a30f4fb400 add some general and some cygwin related comments
svn path=/trunk/; revision=14587
2005-06-08 06:33:49 +00:00
Gerald Combs 103103e21c Fix a quoting bug.
svn path=/trunk/; revision=14177
2005-04-24 00:37:08 +00:00
Gerald Combs ec5ec3768e Allow the locations of tethereal, editcap, and capinfos to be changed.
Limit the amount of VM the process can use (default 500 MB).  If we
can't save a capture in libpcap format, try again with the encapsulation
type set to "ether".

svn path=/trunk/; revision=14156
2005-04-20 21:00:03 +00:00
Gerald Combs e39e982856 Add a description and usage message. Handle invalid capture files.
svn path=/trunk/; revision=14114
2005-04-17 18:55:42 +00:00
Gerald Combs 210225e22d Add a script based on the "menagerie-fuzz" buildbot test. Running
"./tools/fuzz-test.sh /path/to/capture/files/*" will iterate over the
specified capture files, using editcap to introduce errors and tethereal
to check for bugs.  It will do this until tethereal exits abnormally or
a dissector bug is encountered.

svn path=/trunk/; revision=14073
2005-04-14 04:32:27 +00:00