1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2026-10-23 21:49:05 +03:00

ASAN Test -- Do Not Merge

This commit is contained in:
dhall
2020-01-07 10:30:14 -06:00
parent c719b9b36f
commit 2701bdde69
22 changed files with 92 additions and 44 deletions

View File

@@ -28,7 +28,7 @@ MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}")
# default being a community build. This does not impact the feature
# set that will be compiled in; it's merely provided as a hint to
# custom packaging steps.
OPTION(COMMUNITY_BUILD "Set to true if this is a community build" ON)
OPTION(COMMUNITY_BUILD "Set to true if this is a community build" ON)
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RELWITHDEBINFO CACHE STRING
@@ -135,31 +135,31 @@ MY_CHECK_AND_SET_COMPILER_FLAG("-ggdb3 -fno-omit-frame-pointer -fno-tree-vectori
# enable security hardening features, like most distributions do
# in our benchmarks that costs about ~1% of performance, depending on the load
IF(CMAKE_C_COMPILER_VERSION VERSION_LESS "4.6")
SET(security_default OFF)
ELSE()
SET(security_default ON)
ENDIF()
OPTION(SECURITY_HARDENED "Use security-enhancing compiler features (stack protector, relro, etc)" ${security_default})
OPTION(SECURITY_HARDENED_NEW "Use new security-enhancing compilier features" OFF)
IF(SECURITY_HARDENED)
# security-enhancing flags
MY_CHECK_AND_SET_COMPILER_FLAG("-pie -fPIC")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wl,-z,relro,-z,now")
MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-protector --param=ssp-buffer-size=4")
MY_CHECK_AND_SET_COMPILER_FLAG("-D_FORTIFY_SOURCE=2" RELEASE RELWITHDEBINFO)
MY_CHECK_AND_SET_COMPILER_FLAG("-fexceptions")
IF(SECURITY_HARDENED_NEW)
MY_CHECK_AND_SET_COMPILER_FLAG("-mcet -fcf-protection")
MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-protector-strong")
MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-clash-protection")
ENDIF()
ENDIF()
#IF(CMAKE_C_COMPILER_VERSION VERSION_LESS "4.6")
# SET(security_default OFF)
#ELSE()
# SET(security_default ON)
#ENDIF()
#OPTION(SECURITY_HARDENED "Use security-enhancing compiler features (stack protector, relro, etc)" ${security_default})
#OPTION(SECURITY_HARDENED_NEW "Use new security-enhancing compilier features" OFF)
#IF(SECURITY_HARDENED)
# # security-enhancing flags
# MY_CHECK_AND_SET_COMPILER_FLAG("-pie -fPIC")
# MY_CHECK_AND_SET_COMPILER_FLAG("-Wl,-z,relro,-z,now")
# MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-protector --param=ssp-buffer-size=4")
# MY_CHECK_AND_SET_COMPILER_FLAG("-D_FORTIFY_SOURCE=2" RELEASE RELWITHDEBINFO)
# MY_CHECK_AND_SET_COMPILER_FLAG("-fexceptions")
# IF(SECURITY_HARDENED_NEW)
# MY_CHECK_AND_SET_COMPILER_FLAG("-mcet -fcf-protection")
# MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-protector-strong")
# MY_CHECK_AND_SET_COMPILER_FLAG("-fstack-clash-protection")
# ENDIF()
#ENDIF()
SET (ENGINE_LDFLAGS "-Wl,--no-as-needed -Wl,--add-needed")
FIND_PACKAGE(Boost 1.53.0 REQUIRED COMPONENTS system filesystem thread regex date_time)
FIND_PACKAGE(Boost 1.53.0 REQUIRED COMPONENTS system filesystem thread regex date_time)
SET (ENGINE_LIBDIR "${INSTALL_ENGINE}/lib")
SET (ENGINE_BINDIR "${INSTALL_ENGINE}/bin")
@@ -174,7 +174,7 @@ SET (ENGINE_LOCALDIR "${INSTALL_ENGINE}/local")
SET (ENGINE_MYSQLDIR "${INSTALL_ENGINE}/mysql")
SET (ENGINE_TOOLSDIR "${INSTALL_ENGINE}/tools")
SET (ENGINE_COMMON_LIBS messageqcpp loggingcpp configcpp idbboot ${Boost_LIBRARIES} xml2 pthread rt libmysql_client ${JEMALLOC_LIBRARIES})
SET (ENGINE_COMMON_LIBS messageqcpp loggingcpp configcpp idbboot ${Boost_LIBRARIES} xml2 pthread rt libmysql_client)
SET (ENGINE_OAM_LIBS oamcpp alarmmanager)
SET (ENGINE_BRM_LIBS brm idbdatafile cacheutils rwlock ${ENGINE_OAM_LIBS} ${ENGINE_COMMON_LIBS})
SET (ENGINE_EXEC_LIBS joblist execplan windowfunction joiner rowgroup funcexp udfsdk regr dataconvert common compress querystats querytele thrift threadpool ${ENGINE_BRM_LIBS})
@@ -210,8 +210,8 @@ SET (ENGINE_UTILS_IDBDATAFILE_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/idbdata
SET (ENGINE_UTILS_LOGGINGCPP_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/loggingcpp")
SET (ENGINE_UTILS_CONFIGCPP_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/configcpp")
SET (ENGINE_UTILS_COMPRESS_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/compress")
SET (ENGINE_VERSIONING_BRM_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/versioning/BRM")
SET (ENGINE_UTILS_ROWGROUP_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/rowgroup")
SET (ENGINE_VERSIONING_BRM_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/versioning/BRM")
SET (ENGINE_UTILS_ROWGROUP_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/rowgroup")
SET (ENGINE_UTILS_COMMON_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/common")
SET (ENGINE_UTILS_DATACONVERT_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/dataconvert")
SET (ENGINE_UTILS_RWLOCK_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/rwlock")

View File

@@ -57,6 +57,10 @@ set(joblist_LIB_SRCS
virtualtable.cpp
windowfunctionstep.cpp)
IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
ENDIF(CMAKE-ASAN)
add_library(joblist SHARED ${joblist_LIB_SRCS})
set_target_properties(joblist PROPERTIES VERSION 1.0.0 SOVERSION 1)

View File

@@ -66,7 +66,7 @@
<LaunchID>20</LaunchID>
<DepProcessName/>
<RunType>LOADSHARE</RunType>
<LogFile>off</LogFile>
<LogFile>on</LogFile>
</PROCESSCONFIG7>
<PROCESSCONFIG8>
<ProcessName>ExeMgr</ProcessName>

View File

@@ -49,7 +49,7 @@ if [ $vflg -gt 0 ]; then
fi
while [ $keep_going -ne 0 ]; do
$exename $args
LD_PRELOAD=/usr/lib64/libasan.so.5.0.0;ASAN_OPTIONS=detect_leaks=0 $exename $args
if [ -e ${lopt}/StopColumnstore ]; then
exit 0
fi

View File

@@ -264,7 +264,7 @@ void Oam::getSystemConfig(SystemModuleTypeConfig& systemmoduletypeconfig)
/********************************************************************
*
* get System Module Configuration Information by Module Type
*
*getSystemConfig
********************************************************************/
void Oam::getSystemConfig(const std::string& moduletype, ModuleTypeConfig& moduletypeconfig)
@@ -1278,7 +1278,7 @@ void Oam::addModule(DeviceNetworkList devicenetworklist, const std::string passw
bool storeHostnames)
{
// build and send msg
int returnStatus = sendAddModuleToProcMgr(ADDMODULE, devicenetworklist, FORCEFUL, ACK_YES, storeHostnames,
int returnStatus = sendAddModuleToProcMgr(ADDMODULE, devicenetworklist, FORCEFUL, ACK_YES, storeHostnames,
password, mysqlpw);
if (returnStatus != API_SUCCESS)

View File

@@ -66,4 +66,4 @@ install(TARGETS mycnfUpgrade DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
########### next target ###############
install(PROGRAMS quick_installer_single_server.sh quick_installer_multi_server.sh quick_installer_amazon.sh
DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
DESTINATION ${ENGINE_BINDIR} COMPONENT platform)

View File

@@ -492,7 +492,7 @@ int main(int argc, char* argv[])
}
umNumber = atoi(argv[i]);
}
else if ( string("-numBlocksPct") == argv[i] )
else if ( string("-numBlocksPct") == argv[i] )
{
i++;
if (i >= argc)
@@ -666,14 +666,14 @@ int main(int argc, char* argv[])
if (moduleconfig.hostConfigList.size() > 0 )
{
HostConfigList::iterator pt1 = moduleconfig.hostConfigList.begin();
// MCOL-1607. The 'am I pm1?' check below requires an ipaddr.
string PM1ipAdd = oam.getIPAddress((*pt1).IPAddr.c_str());
if (PM1ipAdd.empty())
PM1ipAdd = (*pt1).IPAddr; // this is what it was doing before
PM1ipAdd = (*pt1).IPAddr; // this is what it was doing before
//cout << PM1ipAdd << endl;
if ( PM1ipAdd != "127.0.0.1" )
{
if ( PM1ipAdd != "0.0.0.0")
@@ -1733,7 +1733,7 @@ int main(int argc, char* argv[])
exit(1);
}
string percent;
if (!totalUmMemoryParam.empty()) { // if totalUmMemory was set as command line parameter use the command line parameter value
@@ -2610,7 +2610,7 @@ int main(int argc, char* argv[])
callFree(pcommand);
}
if (!doNotResolveHostNames)
{
string ugh = oam.getIPAddress(newModuleIPAddr);
@@ -3780,7 +3780,7 @@ int main(int argc, char* argv[])
if ( remote_installer_debug == "1" )
{
logfile = tmpDir + "/";
logfile += remoteModuleName + "_" + EEPackageType + "_install.log";
logfile += remoteModuleName + "_" + EEPackageType + "_install.";
debug_logfile = " > " + logfile;
}
@@ -4014,7 +4014,7 @@ int main(int argc, char* argv[])
{
exit(0);
}
string p1 = pass1;
pass2 = getpass("Confirm password > ");
string p2 = pass2;
@@ -6605,7 +6605,7 @@ bool glusterSetup(string password, bool doNotResolveHostNames)
callFree(pcommand);
}
if (!doNotResolveHostNames)
{
string ugh = oam.getIPAddress(moduleIPAddr);
@@ -7150,7 +7150,7 @@ void singleServerConfigSetup(Config* sysConfig)
/**
Resolves the given hostname into its reverse DNS name.
@param hostname the hostname to resolve.
@return the reverse dns name of given hostname or an empty string in case the hostname could not be resolved.
*/

View File

@@ -22,10 +22,14 @@ set(PrimProc_SRCS
../../utils/common/crashtrace.cpp)
#PrimProc_CXXFLAGS = $(march_flags) $(AM_CXXFLAGS)
#IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common")
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
#ENDIF(CMAKE-ASAN)
add_executable(PrimProc ${PrimProc_SRCS})
target_link_libraries(PrimProc ${ENGINE_LDFLAGS} ${NETSNMP_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} threadpool cacheutils dbbc processor)
target_link_libraries(PrimProc ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} threadpool cacheutils dbbc processor)
install(TARGETS PrimProc DESTINATION ${ENGINE_BINDIR} COMPONENT platform)

View File

@@ -10,6 +10,9 @@ set(common_LIB_SRCS
MonitorProcMem.cpp
nullvaluemanip.cpp
threadnaming.cpp)
IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
ENDIF(CMAKE-ASAN)
add_library(common SHARED ${common_LIB_SRCS})

View File

@@ -26,6 +26,7 @@
void fatalHandler(int sig)
{
return;
char filename[128];
void* addrs[128];
snprintf(filename, 128, "/var/log/mariadb/columnstore/trace/%s.%d.log", program_invocation_short_name, getpid());

View File

@@ -6,6 +6,9 @@ include_directories( ${ENGINE_COMMON_INCLUDES} ${SNAPPY_INCLUDE_DIR} )
set(compress_LIB_SRCS
idbcompress.cpp
version1.cpp)
IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
ENDIF(CMAKE-ASAN)
add_definitions(-DNDEBUG)

View File

@@ -5,6 +5,9 @@ include_directories( ${ENGINE_COMMON_INCLUDES} )
########### next target ###############
set(dataconvert_LIB_SRCS dataconvert.cpp)
IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
ENDIF(CMAKE-ASAN)
add_library(dataconvert SHARED ${dataconvert_LIB_SRCS})

View File

@@ -106,6 +106,9 @@ set(funcexp_LIB_SRCS
func_year.cpp
func_yearweek.cpp)
IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
ENDIF(CMAKE-ASAN)
add_library(funcexp SHARED ${funcexp_LIB_SRCS})
target_link_libraries(funcexp ${NETSNMP_LIBRARIES})

View File

@@ -5,6 +5,9 @@ include_directories( ${ENGINE_COMMON_INCLUDES} )
########### next target ###############
set(joiner_LIB_SRCS joiner.cpp tuplejoiner.cpp joinpartition.cpp)
IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
ENDIF(CMAKE-ASAN)
add_library(joiner SHARED ${joiner_LIB_SRCS})

View File

@@ -12,6 +12,9 @@ set(loggingcpp_LIB_SRCS
sqllogger.cpp
stopwatch.cpp
idberrorinfo.cpp)
IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
ENDIF(CMAKE-ASAN)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/messageids.h ${CMAKE_CURRENT_SOURCE_DIR}/errorids.h
@@ -19,9 +22,9 @@ ADD_CUSTOM_COMMAND(
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS genMsgId.pl genErrId.pl
)
ADD_CUSTOM_TARGET(genMsgAndErrId DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/messageids.h ${CMAKE_CURRENT_SOURCE_DIR}/errorids.h)
add_library(loggingcpp SHARED ${loggingcpp_LIB_SRCS})
add_dependencies(loggingcpp genMsgAndErrId)

View File

@@ -12,6 +12,9 @@ set(messageqcpp_LIB_SRCS
iosocket.cpp
compressed_iss.cpp)
IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
ENDIF(CMAKE-ASAN)
add_library(messageqcpp SHARED ${messageqcpp_LIB_SRCS})
set_target_properties(messageqcpp PROPERTIES VERSION 1.0.0 SOVERSION 1)

View File

@@ -4,6 +4,9 @@ include_directories( ${ENGINE_COMMON_INCLUDES} )
########### next target ###############
set(querystats_LIB_SRCS querystats.cpp)
IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
ENDIF(CMAKE-ASAN)
add_library(querystats SHARED ${querystats_LIB_SRCS})

View File

@@ -11,6 +11,9 @@ set(querytele_LIB_SRCS
querytele_types.cpp
QueryTeleService.cpp
queryteleprotoimpl.cpp)
IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
ENDIF(CMAKE-ASAN)
add_library(querytele SHARED ${querytele_LIB_SRCS})

View File

@@ -7,6 +7,9 @@ include_directories( ${ENGINE_COMMON_INCLUDES} )
set(rowgroup_LIB_SRCS rowaggregation.cpp rowgroup.cpp)
#librowgroup_la_CXXFLAGS = $(march_flags) $(AM_CXXFLAGS)
IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
ENDIF(CMAKE-ASAN)
add_library(rowgroup SHARED ${rowgroup_LIB_SRCS})

View File

@@ -6,6 +6,9 @@ include_directories( ${ENGINE_COMMON_INCLUDES} )
########### next target ###############
set(rwlock_LIB_SRCS rwlock.cpp rwlock_local.cpp)
IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
ENDIF(CMAKE-ASAN)
add_library(rwlock SHARED ${rwlock_LIB_SRCS})

View File

@@ -5,6 +5,9 @@ include_directories( ${ENGINE_COMMON_INCLUDES} )
########### next target ###############
set(threadpool_LIB_SRCS weightedthreadpool.cpp threadpool.cpp prioritythreadpool.cpp)
IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
ENDIF(CMAKE-ASAN)
add_library(threadpool SHARED ${threadpool_LIB_SRCS})

View File

@@ -24,6 +24,9 @@ set(windowfunction_LIB_SRCS
wf_sum_avg.cpp
wf_udaf.cpp)
IF(CMAKE-ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-blacklist=/home/calpont/mariadb/buildEngine/addressblacklist.txt")
ENDIF(CMAKE-ASAN)
add_library(windowfunction SHARED ${windowfunction_LIB_SRCS})
set_target_properties(windowfunction PROPERTIES VERSION 1.0.0 SOVERSION 1)