]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #283 in SNORT/snort3 from crc/valgrind to master
authorRuss Combs (rucombs) <rucombs@cisco.com>
Mon, 22 Feb 2016 22:00:24 +0000 (17:00 -0500)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Mon, 22 Feb 2016 22:00:24 +0000 (17:00 -0500)
Squashed commit of the following:

commit 66f22cac027f75b9e0fddd54e8d81fb02cdd4941
Author: snorty <snorty@localhost.localdomain>
Date:   Mon Feb 22 08:16:12 2016 -0500

    remove unused valgrind specific build

14 files changed:
cmake/configure_options.cmake
cmake/create_options.cmake
config.cmake.h.in
configure.ac
configure_cmake.sh
src/codecs/ip/cd_ipv4.cc
src/helpers/process.cc
src/main/snort_config.cc
src/managers/codec_manager.cc
src/packet_io/sfdaq.cc
src/parser/parser.cc
src/search_engines/acsmx2.cc
src/utils/stats.cc
src/utils/util.cc

index 662575486cce3f3de0e3c59986a046e4e13df12e..b6e3a38b45fa9195aafccb1dfc34f4977e9eb0c5 100644 (file)
@@ -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)
index fc73e760577a2a846ca08890fdb17a59e8a7e578..1b470778c07d1f7ce909e7f15ef713bbdd1d2fa3 100644 (file)
@@ -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)
index 12bee20e69232636ff2990e10b2e88ff81590199..0ff98a4051c5c902494694ab163b0c06df6ac207 100644 (file)
@@ -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
 
index 0156d5b0cc467fee363e1907f6d04c470020b675..35fa503fd56ae208969e035bfe76ac06a6bfdfd2 100644 (file)
@@ -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")
index 9799f6b92f004a2ef59714ba2f71807c2773f186..226755d33290ce93d1a5b1ec9a3b77af77f99151 100755 (executable)
@@ -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
             ;;
index 95fe02ffab82997e988fd6a55136f02ced66b6dd..74e3b34711886473256535b037ba435c7c833e53 100644 (file)
@@ -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(
index 9c619187df4817cdb8f6732f7bf544a04bbe3fae..3176a50d76011c35dca4726c10c857b62cc72d88 100644 (file)
@@ -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
index d7850b59177a9b8ee7db6575e3bfd9ab18c6dbac..3d1f7d178291a73c7c2800eb7f3a667624586a9d 100644 (file)
@@ -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);
index b97c9b32b108dd8188d0411081381321d51914be..364e21e6d211418eb34a52c87c87861ac0a21e3d 100644 (file)
@@ -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()
index c2b1bdbe920e795eee49efb69debcd023774cad5..d7a49057b998e7dedd9bf2e6d2d75a6e2e841bd0 100644 (file)
@@ -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()
index 576902d69807dbc0ea31234548ac5b87c7057bbd..b2a6af302d677a1f99ee3a0d3ac398c4f1f95429 100644 (file)
@@ -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,
index 71d461a56524e4d0b6d9bcf62578add6918254b7..076e740da8cfc2dc9b9d42610f6f2f901c4c6f2e 100644 (file)
@@ -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)
index 158d8364066a326bd671c453cc06b616996c2fd8..7dc597c4f9d75f95199c4b25514be6b39463ce52 100644 (file)
@@ -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)
index 77b51804a3c9557e2476038f9000097427abd01a..f1c7d5eecbb895b281c1578f2f7d578df6c38ff7 100644 (file)
@@ -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];