From aa87d7fbb3872703c0fc1a982ba3b85deb01b295 Mon Sep 17 00:00:00 2001 From: Leonid Fedorov Date: Fri, 1 Aug 2025 03:33:40 +0000 Subject: [PATCH] libc++ crashes fixes --- .drone.jsonnet | 89 ++++++++++++++-------------- dbcon/execplan/rewrites.h | 4 +- dbcon/mysql/ha_mcs_execplan.cpp | 5 +- tests/rewritetest.cpp | 2 +- writeengine/server/we_dataloader.cpp | 7 ++- 5 files changed, 55 insertions(+), 52 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index fa6546d50..6127ee9a1 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -21,7 +21,7 @@ local get_build_command(command) = "bash /mdb/" + builddir + "/storage/columnsto local clang(version) = [get_build_command("install_clang_deb.sh " + version), get_build_command("update-clang-version.sh " + version + " 100"), - get_build_command("install_libc++.sh " + version), + get_build_command("install_libc++.sh" + version), "export CC=/usr/bin/clang", "export CXX=/usr/bin/clang++" ]; @@ -38,7 +38,7 @@ local customEnvCommands(envkey, builddir) = local customBootstrapParamsForExisitingPipelines(envkey) = # errorprone if we pass --custom-cmake-flags twice, the last one will win local customBootstrapMap = { - "ubuntu:24.04": "--custom-cmake-flags '-DCOLUMNSTORE_ASAN_FOR_UNITTESTS=YES'", + #"ubuntu:24.04": "--custom-cmake-flags '-DCOLUMNSTORE_ASAN_FOR_UNITTESTS=YES'", }; (if (std.objectHas(customBootstrapMap, envkey)) then customBootstrapMap[envkey] else ""); @@ -635,29 +635,30 @@ local Pipeline(branch, platform, event, arch="amd64", server="10.6-enterprise", }; -local AllPipelines = [ - Pipeline(b, p, e, a, s) - for b in std.objectFields(platforms) - for p in platforms[b] - for s in servers[b] - for e in events - for a in archs -] + -[ - Pipeline(any_branch, p, "custom", a, server) - for p in platforms[current_branch] - for server in servers[current_branch] - for a in archs -] + -[ - Pipeline(b, platform, triggeringEvent, a, server, "", buildenv) - for a in ["amd64"] - for b in std.objectFields(platforms) - for platform in ["ubuntu:24.04"] - for buildenv in std.objectFields(customEnvCommandsMap) - for triggeringEvent in events - for server in servers[current_branch] -] + +local AllPipelines = +// [ +// Pipeline(b, p, e, a, s) +// for b in std.objectFields(platforms) +// for p in platforms[b] +// for s in servers[b] +// for e in events +// for a in archs +// ] + +// [ +// Pipeline(any_branch, p, "custom", a, server) +// for p in platforms[current_branch] +// for server in servers[current_branch] +// for a in archs +// ] + +// [ +// Pipeline(b, platform, triggeringEvent, a, server, "", buildenv) +// for a in ["amd64"] +// for b in std.objectFields(platforms) +// for platform in ["ubuntu:24.04"] +// for buildenv in std.objectFields(customEnvCommandsMap) +// for triggeringEvent in events +// for server in servers[current_branch] +// ] + // last argument is to ignore mtr and regression failures [ Pipeline(b, platform, triggeringEvent, a, server, flag, envcommand, ["regression", "mtr"]) @@ -668,26 +669,26 @@ local AllPipelines = [ for envcommand in ["clang-20"] for triggeringEvent in events for server in servers[current_branch] -] + -// last argument is to ignore mtr and regression failures -[ - Pipeline(b, platform, triggeringEvent, a, server, flag, "", ["regression", "mtr"]) - for a in ["amd64"] - for b in std.objectFields(platforms) - for platform in ["ubuntu:24.04"] - for flag in ["ASan", "UBSan"] - for triggeringEvent in events - for server in servers[current_branch] -] + -[ - Pipeline(b, platform, triggeringEvent, a, server, flag, "") - for a in ["amd64"] - for b in std.objectFields(platforms) - for platform in ["rockylinux:8"] - for flag in ["gcc-toolset"] - for triggeringEvent in events - for server in servers[current_branch] ]; +// // last argument is to ignore mtr and regression failures +// [ +// Pipeline(b, platform, triggeringEvent, a, server, flag, "", ["regression", "mtr"]) +// for a in ["amd64"] +// for b in std.objectFields(platforms) +// for platform in ["ubuntu:24.04"] +// for flag in ["ASan", "UBSan"] +// for triggeringEvent in events +// for server in servers[current_branch] +// ] + +// [ +// Pipeline(b, platform, triggeringEvent, a, server, flag, "") +// for a in ["amd64"] +// for b in std.objectFields(platforms) +// for platform in ["rockylinux:8"] +// for flag in ["gcc-toolset"] +// for triggeringEvent in events +// for server in servers[current_branch] +// ]; local FinalPipeline(branch, event) = { kind: "pipeline", diff --git a/dbcon/execplan/rewrites.h b/dbcon/execplan/rewrites.h index 12114d756..a161c5cc9 100644 --- a/dbcon/execplan/rewrites.h +++ b/dbcon/execplan/rewrites.h @@ -24,7 +24,7 @@ namespace execplan { -#define debug_rewrites false +#define debug_rewrites true execplan::OpType oppositeOperator(execplan::OpType op); @@ -34,7 +34,7 @@ struct NodeSemanticComparator }; // Walk the tree and find out common conjuctions -template +template execplan::ParseTree* extractCommonLeafConjunctionsToRoot(execplan::ParseTree* tree); bool checkFiltersLimit(execplan::ParseTree* tree, uint64_t limit); } // namespace execplan diff --git a/dbcon/mysql/ha_mcs_execplan.cpp b/dbcon/mysql/ha_mcs_execplan.cpp index 7618dd180..35cd522b6 100644 --- a/dbcon/mysql/ha_mcs_execplan.cpp +++ b/dbcon/mysql/ha_mcs_execplan.cpp @@ -6103,7 +6103,7 @@ int processWhere(SELECT_LEX& select_lex, gp_walk_info& gwi, SCSEP& csep, const s string rewriteEnabled = cf->getConfig("Rewrites", "CommonLeafConjunctionsToTop"); if (filters && rewriteEnabled != "OFF") { - filters = extractCommonLeafConjunctionsToRoot(filters); + filters = extractCommonLeafConjunctionsToRoot(filters); } uint64_t limit = get_max_allowed_in_values(gwi.thd); @@ -6306,7 +6306,8 @@ void extractColumnStatistics(Item_field* ifp, gp_walk_info& gwi) auto* histogram = dynamic_cast(ifp->field->read_stats->histogram); if (histogram) { - SchemaAndTableName tableName = {ifp->field->table->s->db.str, ifp->field->table->s->table_name.str}; + SchemaAndTableName tableName = {ifp->field->table->s->db.str, + ifp->field->table->s->table_name.str}; gwi.tableStatisticsMap[tableName][ifp->field->field_name.str] = *histogram; } } diff --git a/tests/rewritetest.cpp b/tests/rewritetest.cpp index 2f5bcb622..bdcc65237 100755 --- a/tests/rewritetest.cpp +++ b/tests/rewritetest.cpp @@ -40,7 +40,7 @@ bool treeEqual(execplan::ParseTree* fst, execplan::ParseTree* snd, int depth = 0 (treeEqual(fst->left(), snd->right(), depth + 1) && treeEqual(fst->right(), snd->left(), depth + 1)); } -#define REWRITE_TREE_TEST_DEBUG false +#define REWRITE_TREE_TEST_DEBUG true void printTree([[maybe_unused]] const std::string& queryName, [[maybe_unused]] execplan::ParseTree* tree, [[maybe_unused]] const std::string& treeName) diff --git a/writeengine/server/we_dataloader.cpp b/writeengine/server/we_dataloader.cpp index 16d648fd6..9004bed2a 100644 --- a/writeengine/server/we_dataloader.cpp +++ b/writeengine/server/we_dataloader.cpp @@ -254,12 +254,13 @@ bool WEDataLoader::setupCpimport() // fork the cpimport } Cmds.push_back(0); // null terminate - // updatePrgmPath(Cmds); + // updatePrgmPath(Cmds); - // NOTE: for debugging + // // NOTE: for debugging int aSize = Cmds.size(); - for (int aIdx = 0; aIdx < aSize; ++aIdx) + // Do not address last terminating 0 + for (int aIdx = 0; aIdx < aSize - 1; ++aIdx) { cout << "Args " << Cmds[aIdx] << endl; }