diff --git a/.github/workflows/root-ci-config/buildconfig/alma10-asan.txt b/.github/workflows/root-ci-config/buildconfig/alma10-asan.txt new file mode 100644 index 0000000000000..65f3fd63f791a --- /dev/null +++ b/.github/workflows/root-ci-config/buildconfig/alma10-asan.txt @@ -0,0 +1,12 @@ +CMAKE_BUILD_TYPE=RelWithDebInfo +asan=ON +ccache=ON +builtin_civetweb=ON +builtin_vdt=ON +ccache=ON +fail-on-missing=ON +minimal=ON +roottest=ON +testing=ON +LSAN_OPTIONS=verbosity=1:log_threads=1 +ROOT_CTEST_CUSTOM_FLAGS="-E \(gtest-core-metacling-TClingTest$\|roottest-cling-specialobj-runf02$\|roottest-root-collection-DeleteWarning$\|roottest-root-io-evolution-fixarr2$\|roottest-root-meta-rlibmap$\|roottest-root-tree-cloning-runtreeCloneTest2$\|roottest-root-treeproxy-vectorint-vectorint$\)" diff --git a/.github/workflows/root-ci-config/buildconfig/alma10-minimal-asan.txt b/.github/workflows/root-ci-config/buildconfig/alma10-minimal-asan.txt deleted file mode 100644 index d9e43b53bbff4..0000000000000 --- a/.github/workflows/root-ci-config/buildconfig/alma10-minimal-asan.txt +++ /dev/null @@ -1,12 +0,0 @@ -CMAKE_BUILD_TYPE=Debug -CMAKE_CXX_FLAGS_DEBUG="-Og -g" -asan=ON -ccache=ON -builtin_civetweb=ON -builtin_vdt=ON -fail-on-missing=ON -minimal=ON -roottest=ON -testing=ON -LSAN_OPTIONS=verbosity=1:log_threads=1 -ROOT_CTEST_CUSTOM_FLAGS="-E \(cppinterop-CppInterOpTest\|roottest-cling-specialobj-runf02$\|roottest-root-collection-DeleteWarning$\|roottest-root-io-evolution-fixarr2$\|roottest-root-meta-rlibmap$\|roottest-root-treeproxy-vectorint-vectorint$\)" diff --git a/.github/workflows/root-ci.yml b/.github/workflows/root-ci.yml index a7820f201a3f4..0da9c83aa686d 100644 --- a/.github/workflows/root-ci.yml +++ b/.github/workflows/root-ci.yml @@ -442,10 +442,10 @@ jobs: overrides: ["CMAKE_CXX_STANDARD=20"] # Asan build - image: alma10 - platform_config: alma10-minimal + platform_config: alma10-asan is_special: true property: "asan" - overrides: ["ROOT_CTEST_CUSTOM_FLAGS=-E@\\(^tutorial-\\|cppinterop-CppInterOpTest\\|roottest-cling-specialobj-runf02$\\|roottest-root-collection-DeleteWarning$\\|roottest-root-io-evolution-fixarr2$\\|roottest-root-meta-rlibmap$\\|roottest-root-treeproxy-vectorint-vectorint$\\)"] + overrides: ["ROOT_CTEST_CUSTOM_FLAGS=-E@\\(^tutorial-\\|gtest-core-metacling-TClingTest$\\|roottest-cling-specialobj-runf02$\\|roottest-root-collection-DeleteWarning$\\|roottest-root-io-evolution-fixarr2$\\|roottest-root-meta-rlibmap$\\|roottest-root-tree-cloning-runtreeCloneTest2$\\|roottest-root-treeproxy-vectorint-vectorint$\\)"] # Fedora Rawhide with Python freethreading+debug build - image: rawhide python_venv: "/py-venv-3.15td/ROOT-CI" diff --git a/cmake/modules/RootMacros.cmake b/cmake/modules/RootMacros.cmake index 864f5f6c81a2d..d9139ea0e9ac9 100644 --- a/cmake/modules/RootMacros.cmake +++ b/cmake/modules/RootMacros.cmake @@ -1768,6 +1768,7 @@ function(ROOT_ADD_TEST test) list(FILTER theCommand INCLUDE REGEX "^-DCMD=.*python[0-9.]*[\\^]") if((theCommand AND NOT (_command MATCHES XMLParsing/parseXMLs.py OR + _command MATCHES roottest/root/rint/driveRedirect.py OR _command MATCHES roottest/root/rint/driveTabCom.py)) OR (_command MATCHES roottest/python/cmdLineUtils AND NOT _command MATCHES MakeNameCyclesRootmvInput)) diff --git a/core/base/src/TSystem.cxx b/core/base/src/TSystem.cxx index 12a79480a7ff9..e7a725a73790d 100644 --- a/core/base/src/TSystem.cxx +++ b/core/base/src/TSystem.cxx @@ -2593,14 +2593,12 @@ static void R__WriteDependencyFile(const TString & build_loc, const TString &dep // standard include directories, bool needToUnlinkTempFile = false; -#ifndef WIN32 - const char * stderrfile = "/dev/null"; -#else + TString stderrfile = "/dev/null"; +#ifdef WIN32 // Determine the null device based on the shell in use. // COMSPEC unset or pointing to cmd.exe -> NUL // COMSPEC pointing to powershell -> $null // Anything else (e.g. bash/sh on Windows) -> `depfilename`.stderr.tmp - TString stderrfile; const char *comspec = gSystem->Getenv("COMSPEC"); if (!comspec || !comspec[0]) { stderrfile = "NUL"; @@ -2620,11 +2618,19 @@ static void R__WriteDependencyFile(const TString & build_loc, const TString &dep #endif TString bakdepfilename = depfilename + ".bak"; -#ifdef WIN32 - TString touch = "echo # > "; touch += "\"" + depfilename + "\""; -#else - TString touch = "echo > "; touch += "\"" + depfilename + "\""; -#endif + struct Defer { + bool fNeedToUnlinkTempFile; + const TString &fStderrfile, &fBakdepfilename; + ~Defer() + { + if (fNeedToUnlinkTempFile) { + // Remove the temporary stderr file if it was created. + gSystem->Unlink(fStderrfile); + } + gSystem->Unlink(fBakdepfilename); + } + } deferGuard{needToUnlinkTempFile, stderrfile, bakdepfilename}; + TString builddep = "rmkdepend"; gSystem->PrependPathName(TROOT::GetBinDir(), builddep); builddep += " \"-f"; @@ -2678,7 +2684,7 @@ static void R__WriteDependencyFile(const TString & build_loc, const TString &dep builddep += stderrfile; builddep += " 2>&1 "; - TString adddictdep = "echo "; + TString adddictdep; R__AddPath(adddictdep,targetname); adddictdep += ": "; #if defined(R__HAS_CLING_DICTVERSION) @@ -2694,19 +2700,27 @@ static void R__WriteDependencyFile(const TString & build_loc, const TString &dep } #endif { - const char *dictHeaders[] = { "RVersion.h", "ROOT/RConfig.hxx", "TClass.h", - "TDictAttributeMap.h","TInterpreter.h","TROOT.h","TBuffer.h", - "TMemberInspector.h","TError.h","RtypesImp.h","TIsAProxy.h", - "TFileMergeInfo.h","TCollectionProxyInfo.h"}; - - for (unsigned int h=0; h < sizeof(dictHeaders)/sizeof(dictHeaders[0]); ++h) - { - char *rootVersion = gSystem->Which(incPath,dictHeaders[h]); + constexpr const char *dictHeaders[] = {"RVersion.h", + "ROOT/RConfig.hxx", + "TClass.h", + "TDictAttributeMap.h", + "TInterpreter.h", + "TROOT.h", + "TBuffer.h", + "TMemberInspector.h", + "TError.h", + "RtypesImp.h", + "TIsAProxy.h", + "TFileMergeInfo.h", + "TCollectionProxyInfo.h"}; + + for (const char *header : dictHeaders) { + char *rootVersion = gSystem->Which(incPath, header); if (rootVersion) { R__AddPath(adddictdep,rootVersion); delete [] rootVersion; } else { - R__AddPath(adddictdep,rootsysInclude + "/" + dictHeaders[h]); + R__AddPath(adddictdep, rootsysInclude + "/" + header); } adddictdep += " "; } @@ -2720,32 +2734,36 @@ static void R__WriteDependencyFile(const TString & build_loc, const TString &dep delete [] rootCling; } } - adddictdep += " >> \""+depfilename+"\""; - TString addversiondep( "echo "); - addversiondep += libname + version_var_prefix + " \"" + ROOT_RELEASE + "\" >> \""+depfilename+"\""; + { + std::ofstream depFile(depfilename, std::ios::out | std::ios::trunc); + if (!depFile) { + ::Warning("ACLiC", "Failed to open dependency file %s for %s", depfilename.Data(), library.Data()); + return; + } +#ifdef WIN32 + depFile << "#\n"; +#endif + } - if (gDebug > 4) { - ::Info("ACLiC", "%s", touch.Data()); + if (gDebug > 4) { ::Info("ACLiC", "%s", builddep.Data()); ::Info("ACLiC", "%s", adddictdep.Data()); } + bool depbuiltOk = !gSystem->Exec(builddep); + if (!depbuiltOk) { + ::Warning("ACLiC", "Failed to run rmkdepend for %s", library.Data()); + return; + } - Int_t depbuilt = !gSystem->Exec(touch); - if (depbuilt) depbuilt = !gSystem->Exec(builddep); - if (depbuilt) depbuilt = !gSystem->Exec(adddictdep); - if (depbuilt) depbuilt = !gSystem->Exec(addversiondep); - - if (!depbuilt) { - ::Warning("ACLiC","Failed to generate the dependency file for %s", + std::ofstream depFile(depfilename, std::ios::out | std::ios::app); + if (!depFile) { + ::Warning("ACLiC", "Failed to open dependency file %s for %s after running rmkdepend", depfilename.Data(), library.Data()); - } else { - if (needToUnlinkTempFile) { - // Remove the temporary stderr file if it was created. - gSystem->Unlink(stderrfile); - } - gSystem->Unlink(bakdepfilename); + return; } + depFile << adddictdep << "\n"; + depFile << libname << version_var_prefix << " \"" << ROOT_RELEASE << "\"\n"; } //////////////////////////////////////////////////////////////////////////////// diff --git a/core/sanitizer/SanitizerSetup.cxx b/core/sanitizer/SanitizerSetup.cxx index 2e4b1340900dc..e4d783ace554b 100644 --- a/core/sanitizer/SanitizerSetup.cxx +++ b/core/sanitizer/SanitizerSetup.cxx @@ -32,7 +32,7 @@ const char* __asan_default_options() { ":alloc_dealloc_mismatch=0" DETECT_LEAKS ":verify_asan_link_order=0" - ":halt_on_error=0"; + ":detect_odr_violation=0"; } /// Default options when leak sanitizer starts up in ROOT executables. diff --git a/roottest/root/io/heritstl/SEIdAltLItem.h b/roottest/root/io/heritstl/SEIdAltLItem.h index f5b06fae1822f..84d102893d27a 100644 --- a/roottest/root/io/heritstl/SEIdAltLItem.h +++ b/roottest/root/io/heritstl/SEIdAltLItem.h @@ -34,10 +34,10 @@ class SEIdAltLItem { fSigLin(siglin), fSigCorr(sigcorr), fTime(time) { }; - SEIdAltLItem(const SEIdAltLItem& that) // copy ctor - { *this = that; } + SEIdAltLItem(const SEIdAltLItem &) = default; + SEIdAltLItem &operator=(const SEIdAltLItem &) = default; - virtual ~SEIdAltLItem() { ; } // dtor + virtual ~SEIdAltLItem() = default; Int_t GetSEId() const { return fStripEndId; } Float_t GetWeight() const { return fWeight; }