From: Russ Combs (rucombs) Date: Mon, 22 Feb 2016 22:00:24 +0000 (-0500) Subject: Merge pull request #283 in SNORT/snort3 from crc/valgrind to master X-Git-Tag: 3.0.0-233~590 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=caec070f96030fad8771db6e48363ec15ef52528;p=thirdparty%2Fsnort3.git Merge pull request #283 in SNORT/snort3 from crc/valgrind to master Squashed commit of the following: commit 66f22cac027f75b9e0fddd54e8d81fb02cdd4941 Author: snorty Date: Mon Feb 22 08:16:12 2016 -0500 remove unused valgrind specific build --- diff --git a/cmake/configure_options.cmake b/cmake/configure_options.cmake index 662575486..b6e3a38b4 100644 --- a/cmake/configure_options.cmake +++ b/cmake/configure_options.cmake @@ -24,7 +24,6 @@ set_if_true (STATIC_LOGGERS STATIC_LOGGERS) set_if_true (STATIC_IPS_ACTIONS STATIC_IPS_ACTIONS) set_if_true (STATIC_IPS_OPTIONS STATIC_IPS_OPTIONS) set_if_true (STATIC_CODECS STATIC_CODECS) -set_if_true (ENABLE_VALGRIND VALGRIND_TESTING) set_if_true (BUILD_HA ENABLE_HA ) set_if_true (ENABLE_LINUX_SMP_STATS LINUX_SMP) set_if_true (ENABLE_DEBUG DEBUG) diff --git a/cmake/create_options.cmake b/cmake/create_options.cmake index fc73e7605..1b470778c 100644 --- a/cmake/create_options.cmake +++ b/cmake/create_options.cmake @@ -12,7 +12,6 @@ option (STATIC_IPS_ACTIONS "include internal ips actions in binary" ON) option (STATIC_IPS_OPTIONS "include ips options in binary" ON) option (STATIC_SEARCH_ENGINES "include search engines in binary" ON) option (ENABLE_STATIC_DAQ "Link static DAQ modules" ON) -option (ENABLE_VALGRIND "Only use if you are testing with valgrind" OFF) option (ENABLE_LINUX_SMP_STATS "Enable statistics reporting through proc" OFF) option (ENABLE_PTHREAD "Disable pthread support" ON) option (ENABLE_DEBUG_MSGS "Enable debug printing options (bugreports and developers only)" OFF) diff --git a/config.cmake.h.in b/config.cmake.h.in index 12bee20e6..0ff98a405 100644 --- a/config.cmake.h.in +++ b/config.cmake.h.in @@ -48,9 +48,6 @@ /* build side channel */ #cmakedefine SIDE_CHANNEL 1 -/* Workarounds for valgrind testing */ -#cmakedefine VALGRIND_TESTING 1 - /* enable proc stats */ #cmakedefine LINUX_SMP 1 diff --git a/configure.ac b/configure.ac index 0156d5b0c..35fa503fd 100644 --- a/configure.ac +++ b/configure.ac @@ -389,14 +389,6 @@ if test "x$static_piglets" = "xyes"; then AC_DEFINE(STATIC_PIGLETS, [1], [include internal piglets in binary]) fi -AC_ARG_ENABLE(valgrind, - AC_HELP_STRING([--enable-valgrind],[only use if you are testing with valgrind.]), - enable_valgrind="$enableval", enable_valgrind="no") - -if test "x$enable_valgrind" = "xyes"; then - AC_DEFINE([VALGRIND_TESTING],[1],[Workarounds for valgrind testing]) -fi - AC_ARG_ENABLE(shell, AC_HELP_STRING([--enable-shell],[enable command line shell support]), enable_shell="$enableval", enable_shell="no") diff --git a/configure_cmake.sh b/configure_cmake.sh index 9799f6b92..226755d33 100755 --- a/configure_cmake.sh +++ b/configure_cmake.sh @@ -184,12 +184,6 @@ while [ $# -ne 0 ]; do --enable-static-daq) append_cache_entry ENABLE_STATIC_DAQ BOOL true ;; - --disable-valgrind) - append_cache_entry ENABLE_VALGRIND BOOL false - ;; - --enable-valgrind) - append_cache_entry ENABLE_VALGRIND BOOL true - ;; --disable-linux-smp-stats) append_cache_entry ENABLE_LINUX_SMP_STATS BOOL false ;; diff --git a/src/codecs/ip/cd_ipv4.cc b/src/codecs/ip/cd_ipv4.cc index 95fe02ffa..74e3b3471 100644 --- a/src/codecs/ip/cd_ipv4.cc +++ b/src/codecs/ip/cd_ipv4.cc @@ -612,17 +612,16 @@ void Ipv4Codec::log(TextLog* const text_log, const uint8_t* raw_pkt, static inline uint16_t IpId_Next() { -#if defined(REG_TEST) || defined(VALGRIND_TESTING) +#if defined(REG_TEST) uint16_t id = htons(s_id_index + 1); #else uint16_t id = s_id_pool[s_id_index]; #endif s_id_index = (s_id_index + 1) % IP_ID_COUNT; -#ifndef VALGRIND_TESTING if ( !s_id_index ) rand_shuffle(s_rand, &s_id_pool[0], sizeof(s_id_pool), 1); -#endif + return id; } @@ -722,7 +721,6 @@ static void mod_dtor(Module* m) //------------------------------------------------------------------------- static void ipv4_codec_ginit() { -#ifndef VALGRIND_TESTING if ( s_rand ) rand_close(s_rand); @@ -735,7 +733,6 @@ static void ipv4_codec_ginit() FatalError("rand_open() failed.\n"); rand_get(s_rand, &s_id_pool[0], sizeof(s_id_pool)); -#endif // Reserved addresses within multicast address space (See RFC 5771) MulticastReservedIp = sfip_var_from_string( diff --git a/src/helpers/process.cc b/src/helpers/process.cc index 9c619187d..3176a50d7 100644 --- a/src/helpers/process.cc +++ b/src/helpers/process.cc @@ -197,10 +197,6 @@ const char* get_signal_name(PigSignal s) // FIXIT-L convert sigaction, etc. to c++11 static int add_signal(int sig, sighandler_t signal_handler, int check_needed) { -#ifdef VALGRIND_TESTING - if ( sig == SIGUSR2 ) - return 0; // used by valgrind -#endif sighandler_t pre_handler; #ifdef HAVE_SIGACTION diff --git a/src/main/snort_config.cc b/src/main/snort_config.cc index d7850b591..3d1f7d178 100644 --- a/src/main/snort_config.cc +++ b/src/main/snort_config.cc @@ -277,10 +277,8 @@ void SnortConfig::setup() if ( output_use_utc() ) thiszone = 0; -#ifndef VALGRIND_TESTING else thiszone = gmt2local(0); -#endif init_policies(this); ParseRules(this); diff --git a/src/managers/codec_manager.cc b/src/managers/codec_manager.cc index b97c9b32b..364e21e6d 100644 --- a/src/managers/codec_manager.cc +++ b/src/managers/codec_manager.cc @@ -237,7 +237,6 @@ void CodecManager::thread_init(SnortConfig* sc) if (!grinder) ParseError("Unable to find a Codec with data link type %d\n", daq_dlt); -#ifndef VALGRIND_TESTING if ( s_rand ) rand_close(s_rand); @@ -250,7 +249,6 @@ void CodecManager::thread_init(SnortConfig* sc) ParseError("rand_open() failed.\n"); rand_get(s_rand, s_id_pool.data(), s_id_pool.size()); -#endif } void CodecManager::thread_term() diff --git a/src/packet_io/sfdaq.cc b/src/packet_io/sfdaq.cc index c2b1bdbe9..d7a49057b 100644 --- a/src/packet_io/sfdaq.cc +++ b/src/packet_io/sfdaq.cc @@ -249,11 +249,9 @@ void DAQ_Init(const SnortConfig* sc) void DAQ_Term() { -//#ifndef VALGRIND_TESTING if ( loaded ) DAQ_Unload(); daq_mod = NULL; -//#endif } void DAQ_Abort() diff --git a/src/parser/parser.cc b/src/parser/parser.cc index 576902d69..b2a6af302 100644 --- a/src/parser/parser.cc +++ b/src/parser/parser.cc @@ -332,7 +332,6 @@ static void DefineAllIfaceVars(SnortConfig* sc) (uint8_t*)&iface_vars[i].netmask); } } -#ifndef VALGRIND_TESTING else { char errbuf[PCAP_ERRBUF_SIZE]; @@ -366,7 +365,6 @@ static void DefineAllIfaceVars(SnortConfig* sc) pcap_freealldevs(alldevs); } -#endif } static RuleListNode* addNodeToOrderedList(RuleListNode* ordered_list, diff --git a/src/search_engines/acsmx2.cc b/src/search_engines/acsmx2.cc index 71d461a56..076e740da 100644 --- a/src/search_engines/acsmx2.cc +++ b/src/search_engines/acsmx2.cc @@ -2636,9 +2636,6 @@ int acsmPrintSummaryInfo2(void) LogStat("fail state memory", acsm2_failstate_memory/scale); #if 0 // FIXIT-L clean up format; not all this should be printed all the time -//#ifndef VALGRIND_TESTING - // valgrind on macos claims leakage here ... - if (acsm2_dfa_memory > 0) { if (summary.acsm.compress_states) diff --git a/src/utils/stats.cc b/src/utils/stats.cc index 158d83640..7dc597c4f 100644 --- a/src/utils/stats.cc +++ b/src/utils/stats.cc @@ -107,11 +107,7 @@ void LogCount(const char* s, uint64_t c) void LogStat(const char* s, uint64_t n, uint64_t tot) { -#ifdef VALGRIND_TESTING - LogMessage("%25.25s: " FMTu64("-12") "\n", s, n); -#else LogMessage("%25.25s: " FMTu64("-12") "\t(%7.3f%%)\n", s, n, CalcPct(n, tot)); -#endif } void LogStat(const char* s, double d) diff --git a/src/utils/util.cc b/src/utils/util.cc index 77b51804a..f1c7d5eec 100644 --- a/src/utils/util.cc +++ b/src/utils/util.cc @@ -424,7 +424,6 @@ void InitProtoNames(void) for (i = 0; i < NUM_IP_PROTOS; i++) { -#ifndef VALGRIND_TESTING struct protoent* pt = getprotobynumber(i); // main thread only if (pt != NULL) @@ -436,7 +435,6 @@ void InitProtoNames(void) protocol_names[i][j] = toupper(protocol_names[i][j]); } else -#endif { char protoname[10];