Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASAN: ODR workaround #2298

Merged
merged 8 commits into from
Jul 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
<<: *defaults
docker:
- image: ornladios/adios2:ci-fedora-ubsan
#"fedora-asan":
# <<: *defaults
# docker:
# - image: ornladios/adios2:ci-fedora-asan
"fedora-asan":
<<: *defaults
docker:
- image: ornladios/adios2:ci-fedora-asan
"fedora-msan":
<<: *defaults
docker:
Expand All @@ -43,6 +43,6 @@ workflows:
sanitizers:
jobs:
- "fedora-ubsan"
#- "fedora-asan"
- "fedora-asan"
- "fedora-msan"
- "fedora-tsan"
4 changes: 2 additions & 2 deletions scripts/ci/cmake/ci-fedora-asan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

set(ENV{CC} clang)
set(ENV{CXX} clang++)
set(ASAN_FLAGS "-fsanitize=address -fno-omit-frame-pointer -pthread")
set(ASAN_FLAGS "-fsanitize=address -fno-omit-frame-pointer -pthread -mllvm -asan-use-private-alias=1 -Wno-unused-command-line-argument")
set(ENV{ASAN_OPTIONS} "use_odr_indicator=1")
set(ENV{CFLAGS} "${ASAN_FLAGS}")
set(ENV{CXXFLAGS} "${ASAN_FLAGS}")
set(ENV{FFLAGS} "${ASAN_FLAGS}")

set(dashboard_cache "
ADIOS2_USE_Fortran:STRING=OFF
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/images/build-native-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ done
echo "************************************************************"
echo "* Building partially squashed final images *"
echo "************************************************************"
LEAF_IMAGES="el7-base,el7 el7-gnu8-ohpc-base,el7-gnu8-ohpc el7-gnu8-ohpc-base,el7-gnu8-openmpi-ohpc el7-intel-ohpc-base,el7-intel-ohpc el7-intel-ohpc-base,el7-intel-openmpi-ohpc suse-pgi-base,suse-pgi suse-pgi-base,suse-pgi-openmpi fedora-sanitizers-base,fedora-ubsan"
LEAF_IMAGES="el7-base,el7 el7-gnu8-ohpc-base,el7-gnu8-ohpc el7-gnu8-ohpc-base,el7-gnu8-openmpi-ohpc el7-intel-ohpc-base,el7-intel-ohpc el7-intel-ohpc-base,el7-intel-openmpi-ohpc suse-pgi-base,suse-pgi suse-pgi-base,suse-pgi-openmpi fedora-sanitizers-base,fedora-asan fedora-sanitizers-base,fedora-ubsan"
for IMAGE_PAIR in ${LEAF_IMAGES}
do
echo "${IMAGE_PAIR%,*} -> ${IMAGE_PAIR#*,}"
Expand All @@ -58,7 +58,7 @@ done
echo "************************************************************"
echo "* Push all images *"
echo "************************************************************"
ALL_IMAGES="el7-base el7 el7-gnu8-ohpc-base el7-gnu8-ohpc el7-gnu8-openmpi-ohpc el7-intel-ohpc-base el7-intel-ohpc el7-intel-openmpi-ohpc suse-pgi-base suse-pgi suse-pgi-openmpi fedora-sanitizers-base fedora-ubsan debian-sid"
ALL_IMAGES="el7-base el7 el7-gnu8-ohpc-base el7-gnu8-ohpc el7-gnu8-openmpi-ohpc el7-intel-ohpc-base el7-intel-ohpc el7-intel-openmpi-ohpc suse-pgi-base suse-pgi suse-pgi-openmpi fedora-sanitizers-base fedora-asan fedora-ubsan debian-sid"
for IMAGE in ${ALL_IMAGES}
do
echo "${IMAGE}"
Expand Down
4 changes: 2 additions & 2 deletions testing/adios2/bindings/C/TestBPWriteAggregateReadLocal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ TEST_P(BPWriteAggregateReadLocalTest, Aggregate1DBlock0)
LocalAggregate1DBlock0(GetParam());
}

INSTANTIATE_TEST_CASE_P(Substreams, BPWriteAggregateReadLocalTest,
::testing::Values("1", "2", "3", "4"));
INSTANTIATE_TEST_SUITE_P(Substreams, BPWriteAggregateReadLocalTest,
::testing::Values("1", "2", "3", "4"));

int main(int argc, char **argv)
{
Expand Down
5 changes: 4 additions & 1 deletion testing/adios2/bindings/C/TestBPWriteTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
* Author: William F Godoy godoywf@ornl.gov
*/

#include <cstring>

#include <algorithm>

#include <adios2_c.h>

#if ADIOS2_USE_MPI
#include <mpi.h>
#endif

#include <cstring>
#include <gtest/gtest.h>

#include "SmallTestData_c.h"
Expand Down
1 change: 1 addition & 0 deletions testing/adios2/engine/SmallTestData.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <cstdint>

#include <algorithm>
#include <array>
#include <limits>
#include <string>
Expand Down
14 changes: 7 additions & 7 deletions testing/adios2/engine/bp/TestBPStepsFileGlobalArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,12 +580,12 @@ TEST_P(BPStepsFileGlobalArrayReaders, NewVarPerStep)
#endif
}

INSTANTIATE_TEST_CASE_P(BPStepsFileGlobalArray, BPStepsFileGlobalArrayReaders,
::testing::Values(ReadMode::ReadFileAll,
ReadMode::ReadFileStepByStep,
ReadMode::ReadFileStepByStepBlocks,
ReadMode::ReadStream,
ReadMode::ReadStreamBlocks));
INSTANTIATE_TEST_SUITE_P(BPStepsFileGlobalArray, BPStepsFileGlobalArrayReaders,
::testing::Values(ReadMode::ReadFileAll,
ReadMode::ReadFileStepByStep,
ReadMode::ReadFileStepByStepBlocks,
ReadMode::ReadStream,
ReadMode::ReadStreamBlocks));

class BPStepsFileGlobalArrayParameters
: public BPStepsFileGlobalArray,
Expand Down Expand Up @@ -867,7 +867,7 @@ TEST_P(BPStepsFileGlobalArrayParameters, EveryOtherStep)
#endif
}

INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
BPStepsFileGlobalArray, BPStepsFileGlobalArrayParameters,
::testing::Values(std::make_tuple(4, 0, ReadMode::ReadFileAll),
std::make_tuple(4, 0, ReadMode::ReadFileStepByStep),
Expand Down
8 changes: 4 additions & 4 deletions testing/adios2/engine/bp/TestBPStepsFileLocalArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,9 @@ TEST_P(BPStepsFileLocalArrayReaders, NewVarPerStep)
#endif
}

INSTANTIATE_TEST_CASE_P(BPStepsFileLocalArray, BPStepsFileLocalArrayReaders,
::testing::Values(ReadMode::ReadFileStepByStepBlocks,
ReadMode::ReadStreamBlocks));
INSTANTIATE_TEST_SUITE_P(BPStepsFileLocalArray, BPStepsFileLocalArrayReaders,
::testing::Values(ReadMode::ReadFileStepByStepBlocks,
ReadMode::ReadStreamBlocks));

class BPStepsFileLocalArrayParameters
: public BPStepsFileLocalArray,
Expand Down Expand Up @@ -574,7 +574,7 @@ TEST_P(BPStepsFileLocalArrayParameters, EveryOtherStep)
#endif
}

INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
BPStepsFileLocalArray, BPStepsFileLocalArrayParameters,
::testing::Values(std::make_tuple(4, 0, ReadMode::ReadFileStepByStepBlocks),
std::make_tuple(4, 0, ReadMode::ReadStreamBlocks),
Expand Down
4 changes: 2 additions & 2 deletions testing/adios2/engine/bp/TestBPStepsInSituGlobalArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ TEST_P(BPStepsInSituGlobalArrayReaders, NewVarPerStep)
reader.Close();
}

INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
BPStepsInSituGlobalArray, BPStepsInSituGlobalArrayReaders,
::testing::Values(std::make_tuple(0, ReadMode::ReadGlobal),
std::make_tuple(1, ReadMode::ReadGlobal),
Expand Down Expand Up @@ -649,7 +649,7 @@ TEST_P(BPStepsInSituGlobalArrayParameters, EveryOtherStep)
reader.Close();
}

INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
BPStepsInSituGlobalArray, BPStepsInSituGlobalArrayParameters,
::testing::Values(std::make_tuple(0, 0, ReadMode::ReadGlobal),
std::make_tuple(0, 0, ReadMode::ReadBlocks),
Expand Down
7 changes: 4 additions & 3 deletions testing/adios2/engine/bp/TestBPStepsInSituLocalArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,9 @@ TEST_P(BPStepsInSituLocalArrayReaders, NewVarPerStep)
reader.Close();
}

INSTANTIATE_TEST_CASE_P(BPStepsInSituLocalArray, BPStepsInSituLocalArrayReaders,
::testing::Values(0, 1, 2, 3, 4));
INSTANTIATE_TEST_SUITE_P(BPStepsInSituLocalArray,
BPStepsInSituLocalArrayReaders,
::testing::Values(0, 1, 2, 3, 4));

class BPStepsInSituLocalArrayParameters
: public BPStepsInSituLocalArray,
Expand Down Expand Up @@ -516,7 +517,7 @@ TEST_P(BPStepsInSituLocalArrayParameters, EveryOtherStep)
reader.Close();
}

INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
BPStepsInSituLocalArray, BPStepsInSituLocalArrayParameters,
::testing::Values(std::make_tuple(0, 0), std::make_tuple(0, 1),
std::make_tuple(1, 0), std::make_tuple(1, 1),
Expand Down
4 changes: 2 additions & 2 deletions testing/adios2/engine/bp/TestBPTimeAggregation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,8 @@ TEST_P(BPTestTimeAggregation, BPTimeAggregation2D4x2)
TimeAggregation2D4x2(GetParam());
}

INSTANTIATE_TEST_CASE_P(FlushStepsCount, BPTestTimeAggregation,
::testing::Values("1", "2", "3", "6", "8", "10"));
INSTANTIATE_TEST_SUITE_P(FlushStepsCount, BPTestTimeAggregation,
::testing::Values("1", "2", "3", "6", "8", "10"));

int main(int argc, char **argv)
{
Expand Down
4 changes: 2 additions & 2 deletions testing/adios2/engine/bp/TestBPWriteAggregateRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,8 +953,8 @@ TEST_P(BPWriteAggregateReadTest, ADIOS2BPWriteAggregateRead2D4x2)
WriteAggRead2D4x2(GetParam());
}

INSTANTIATE_TEST_CASE_P(Substreams, BPWriteAggregateReadTest,
::testing::Values("1", "2", "3", "4", "5"));
INSTANTIATE_TEST_SUITE_P(Substreams, BPWriteAggregateReadTest,
::testing::Values("1", "2", "3", "4", "5"));

int main(int argc, char **argv)
{
Expand Down
4 changes: 2 additions & 2 deletions testing/adios2/engine/bp/TestBPWriteMemorySelectionRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -968,8 +968,8 @@ TEST_P(BPWriteMemSelReadVector, BPMemorySelectionSteps3D4x2x8)
BPSteps3D8x2x4(GetParam());
}

INSTANTIATE_TEST_CASE_P(ghostCells, BPWriteMemSelReadVector,
::testing::Values(1));
INSTANTIATE_TEST_SUITE_P(ghostCells, BPWriteMemSelReadVector,
::testing::Values(1));

int main(int argc, char **argv)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ TEST_P(BPWriteReadBZIP2, ADIOS2BPWriteReadBZIP23DSel)
BZIP2Accuracy3DSel(GetParam());
}

INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
BZIP2Accuracy, BPWriteReadBZIP2,
::testing::Values(adios2::ops::bzip2::value::blockSize100k_1,
adios2::ops::bzip2::value::blockSize100k_2,
Expand Down
21 changes: 11 additions & 10 deletions testing/adios2/engine/bp/operations/TestBPWriteReadBlosc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,16 +878,17 @@ TEST_P(BPWriteReadBlosc, ADIOS2BPWriteReadBlosc3DSel)
BloscAccuracy3DSel(GetParam());
}

INSTANTIATE_TEST_CASE_P(BloscAccuracy, BPWriteReadBlosc,
::testing::Values(adios2::ops::blosc::value::clevel_1,
adios2::ops::blosc::value::clevel_2,
adios2::ops::blosc::value::clevel_3,
adios2::ops::blosc::value::clevel_4,
adios2::ops::blosc::value::clevel_5,
adios2::ops::blosc::value::clevel_6,
adios2::ops::blosc::value::clevel_7,
adios2::ops::blosc::value::clevel_8,
adios2::ops::blosc::value::clevel_9));
INSTANTIATE_TEST_SUITE_P(
BloscAccuracy, BPWriteReadBlosc,
::testing::Values(adios2::ops::blosc::value::clevel_1,
adios2::ops::blosc::value::clevel_2,
adios2::ops::blosc::value::clevel_3,
adios2::ops::blosc::value::clevel_4,
adios2::ops::blosc::value::clevel_5,
adios2::ops::blosc::value::clevel_6,
adios2::ops::blosc::value::clevel_7,
adios2::ops::blosc::value::clevel_8,
adios2::ops::blosc::value::clevel_9));

int main(int argc, char **argv)
{
Expand Down
6 changes: 3 additions & 3 deletions testing/adios2/engine/bp/operations/TestBPWriteReadMGARD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,9 +997,9 @@ TEST_P(BPWriteReadMGARD, BPWRMGARD2D) { MGARDAccuracy2D(GetParam()); }

TEST_P(BPWriteReadMGARD, BPWRMGARD3D) { MGARDAccuracy3D(GetParam()); }

INSTANTIATE_TEST_CASE_P(MGARDAccuracy, BPWriteReadMGARD,
::testing::Values("0.01", "0.001", "0.0001",
"0.00001"));
INSTANTIATE_TEST_SUITE_P(MGARDAccuracy, BPWriteReadMGARD,
::testing::Values("0.01", "0.001", "0.0001",
"0.00001"));

int main(int argc, char **argv)
{
Expand Down
2 changes: 1 addition & 1 deletion testing/adios2/engine/bp/operations/TestBPWriteReadPNG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ class BPWRPNG : public ::testing::TestWithParam<std::string>

TEST_P(BPWRPNG, BPWRPNG2D) { PNGAccuracy2D(GetParam()); }

INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
PNGAccuracy, BPWRPNG,
::testing::Values(adios2::ops::png::value::compression_level_1,
adios2::ops::png::value::compression_level_2,
Expand Down
6 changes: 3 additions & 3 deletions testing/adios2/engine/bp/operations/TestBPWriteReadSZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1035,9 +1035,9 @@ TEST_P(BPWriteReadSZ, BPWRSZ2DSel) { SZAccuracy2DSel(GetParam()); }
TEST_P(BPWriteReadSZ, BPWRSZ3DSel) { SZAccuracy3DSel(GetParam()); }
TEST_F(BPWriteReadSZ, BPWRSZ2DSmallSel) { SZAccuracy2DSmallSel("0.01"); }

INSTANTIATE_TEST_CASE_P(SZAccuracy, BPWriteReadSZ,
::testing::Values("0.01", "0.001", "0.0001",
"0.00001"));
INSTANTIATE_TEST_SUITE_P(SZAccuracy, BPWriteReadSZ,
::testing::Values("0.01", "0.001", "0.0001",
"0.00001"));

int main(int argc, char **argv)
{
Expand Down
3 changes: 2 additions & 1 deletion testing/adios2/engine/bp/operations/TestBPWriteReadZfp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <cstdint>
#include <cstring>

#include <algorithm>
#include <iostream>
#include <numeric> //std::iota
#include <stdexcept>
Expand Down Expand Up @@ -960,7 +961,7 @@ TEST_P(BPWRZFP, ADIOS2BPWRZFP2DSel) { ZFPRate2DSel(GetParam()); }
TEST_P(BPWRZFP, ADIOS2BPWRZFP3DSel) { ZFPRate3DSel(GetParam()); }
TEST_P(BPWRZFP, ADIOS2BPWRZFP2DSmallSel) { ZFPRate2DSmallSel(GetParam()); }

INSTANTIATE_TEST_CASE_P(ZFPRate, BPWRZFP, ::testing::Values("8", "9", "10"));
INSTANTIATE_TEST_SUITE_P(ZFPRate, BPWRZFP, ::testing::Values("8", "9", "10"));

int main(int argc, char **argv)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ TEST_P(BPWriteReadZfpConfig, ADIOS2BPWriteReadZfp2DSmallSel)
ZfpRate2DSmallSel(GetParam());
}

INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
ZfpConfigFile, BPWriteReadZfpConfig,
::testing::Values("configZfp_rate8.xml", "configZfp_rate8Simple.xml",
"configZfp_rate9.xml", "configZfp_rate9Simple.xml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,8 @@ TEST_P(BPWriteReadZfpHighLevelAPI, ADIOS2BPWriteReadZfp2DSmallSel)
ZfpRate2DSmallSel(GetParam());
}

INSTANTIATE_TEST_CASE_P(ZfpRate, BPWriteReadZfpHighLevelAPI,
::testing::Values(8., 9., 10));
INSTANTIATE_TEST_SUITE_P(ZfpRate, BPWriteReadZfpHighLevelAPI,
::testing::Values(8., 9., 10));

int main(int argc, char **argv)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -924,8 +924,8 @@ TEST_P(HDF5WriteMemSelReadVector, HDF5MemorySelectionSteps3D4x2x8)
HDF5Steps3D8x2x4(GetParam());
}

INSTANTIATE_TEST_CASE_P(ghostCells, HDF5WriteMemSelReadVector,
::testing::Values(1));
INSTANTIATE_TEST_SUITE_P(ghostCells, HDF5WriteMemSelReadVector,
::testing::Values(1));

int main(int argc, char **argv)
{
Expand Down
6 changes: 3 additions & 3 deletions testing/adios2/engine/staging-common/TestStagingMPMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct RunParams
: npx_w{xw}, npy_w{yw}, npx_r{xr}, npy_r{yr} {};
};

/* This function is executed by INSTANTIATE_TEST_CASE_P
/* This function is executed by INSTANTIATE_TEST_SUITE_P
before main() and MPI_Init()!!! */
std::vector<RunParams> CreateRunParams()
{
Expand Down Expand Up @@ -346,8 +346,8 @@ TEST_P(TestStagingMPMD, SlowReader)
TestCommon(p, 4, 0, 100, -1.0);
}

INSTANTIATE_TEST_CASE_P(NxM, TestStagingMPMD,
::testing::ValuesIn(CreateRunParams()));
INSTANTIATE_TEST_SUITE_P(NxM, TestStagingMPMD,
::testing::ValuesIn(CreateRunParams()));

void threadTimeoutRun(size_t t)
{
Expand Down
2 changes: 1 addition & 1 deletion testing/adios2/interface/TestADIOSInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class ADIOS2_CXX11_API_MultiBlock : public ADIOS2_CXX11_API_IO
std::vector<Box> m_Selections;
};

TYPED_TEST_CASE(ADIOS2_CXX11_API_MultiBlock, MultiBlockTypes);
TYPED_TEST_SUITE(ADIOS2_CXX11_API_MultiBlock, MultiBlockTypes);

TYPED_TEST(ADIOS2_CXX11_API_MultiBlock, Put)
{
Expand Down
6 changes: 3 additions & 3 deletions testing/adios2/performance/manyvars/TestManyVars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct RunParams
: nvars{nv}, nblocks{nb}, nsteps{ns} {};
};

/* This function is executed by INSTANTIATE_TEST_CASE_P
/* This function is executed by INSTANTIATE_TEST_SUITE_P
before main() and MPI_Init()!!! */
std::vector<RunParams> CreateRunParams()
{
Expand Down Expand Up @@ -479,8 +479,8 @@ TEST_P(TestManyVars, DontRedefineVars)
ASSERT_EQ(err, 0);
}

INSTANTIATE_TEST_CASE_P(NxM, TestManyVars,
::testing::ValuesIn(CreateRunParams()));
INSTANTIATE_TEST_SUITE_P(NxM, TestManyVars,
::testing::ValuesIn(CreateRunParams()));

//******************************************************************************
// main
Expand Down
4 changes: 2 additions & 2 deletions testing/adios2/transports/TestFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ TEST_P(BufferTest, WriteRead)
}

#ifdef __unix__
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
TransportTests, BufferTest,
::testing::Values(std::make_tuple("fstream", "true", "posix", "false"),
std::make_tuple("fstream", "false", "posix", "false"),
Expand Down Expand Up @@ -106,7 +106,7 @@ INSTANTIATE_TEST_CASE_P(
std::make_tuple("fstream", "false", "fstream", "true"),
std::make_tuple("fstream", "false", "fstream", "false")));
#else
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
TransportTests, BufferTest,
::testing::Values(std::make_tuple("stdio", "true", "stdio", "true"),
std::make_tuple("stdio", "true", "stdio", "false"),
Expand Down
Loading