Configure Undefined Behaviour Sanitizer (#6290)

This commit is contained in:
Siarhei Fedartsou
2022-08-01 23:40:26 +02:00
committed by GitHub
parent 589becbfec
commit 00816722dd
11 changed files with 68 additions and 32 deletions
+5 -7
View File
@@ -43,10 +43,8 @@ namespace contractor
struct ContractorConfig final : storage::IOConfig
{
ContractorConfig()
: IOConfig({".osrm.ebg", ".osrm.ebg_nodes", ".osrm.properties"},
{},
{".osrm.hsgr", ".osrm.enw"}),
requested_num_threads(0)
: IOConfig(
{".osrm.ebg", ".osrm.ebg_nodes", ".osrm.properties"}, {}, {".osrm.hsgr", ".osrm.enw"})
{
}
@@ -62,16 +60,16 @@ struct ContractorConfig final : storage::IOConfig
updater::UpdaterConfig updater_config;
// DEPRECATED to be removed in v6.0
bool use_cached_priority;
bool use_cached_priority = false;
unsigned requested_num_threads;
unsigned requested_num_threads = 0;
// DEPRECATED to be removed in v6.0
// A percentage of vertices that will be contracted for the hierarchy.
// Offers a trade-off between preprocessing and query time.
// The remaining vertices form the core of the hierarchy
//(e.g. 0.8 contracts 80 percent of the hierarchy, leaving a core of 20%)
double core_factor;
double core_factor = 1.0;
};
} // namespace contractor
} // namespace osrm
@@ -48,13 +48,14 @@ GetShortestRoundTrip(const NodeID new_loc,
const auto dist_from = dist_table(*from_node, new_loc);
const auto dist_to = dist_table(new_loc, *to_node);
const auto trip_dist = dist_from + dist_to - dist_table(*from_node, *to_node);
// If the edge_weight is very large (INVALID_EDGE_WEIGHT) then the algorithm will not choose
// this edge in final minimal path. So instead of computing all the permutations after this
// large edge, discard this edge right here and don't consider the path after this edge.
if (dist_from == INVALID_EDGE_WEIGHT || dist_to == INVALID_EDGE_WEIGHT)
continue;
const auto trip_dist = dist_from + dist_to - dist_table(*from_node, *to_node);
// This is not neccessarily true:
// Lets say you have an edge (u, v) with duration 100. If you place a coordinate exactly in
// the middle of the segment yielding (u, v'), the adjusted duration will be 100 * 0.5 = 50.
+6 -9
View File
@@ -69,8 +69,7 @@ struct ExtractorConfig final : storage::IOConfig
".osrm.icd",
".osrm.cnbg",
".osrm.cnbg_to_ebg",
".osrm.maneuver_overrides"}),
requested_num_threads(0), parse_conditionals(false), use_locations_cache(true)
".osrm.maneuver_overrides"})
{
}
@@ -84,14 +83,12 @@ struct ExtractorConfig final : storage::IOConfig
std::vector<boost::filesystem::path> location_dependent_data_paths;
std::string data_version;
unsigned requested_num_threads;
unsigned small_component_size;
unsigned requested_num_threads = 0;
unsigned small_component_size = 1000;
bool generate_edge_lookup;
bool use_metadata;
bool parse_conditionals;
bool use_locations_cache;
bool use_metadata = false;
bool parse_conditionals = false;
bool use_locations_cache = true;
};
} // namespace extractor
} // namespace osrm
+3
View File
@@ -85,6 +85,9 @@ class Log
return *this;
}
private:
void Init();
protected:
const LogLevel level;
std::ostringstream buffer;