This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 0143ae8266 [fix]Add logging before _builtin_unreachable() (#24101)
0143ae8266 is described below
commit 0143ae8266176acc7bf9b429bb22268da39c3ec1
Author: 神技圈子 <[email protected]>
AuthorDate: Sat Sep 9 00:30:11 2023 +0800
[fix]Add logging before _builtin_unreachable() (#24101)
Co-authored-by: 宋光璠 <[email protected]>
---
be/src/io/file_factory.h | 1 +
be/src/pipeline/pipeline_task.h | 1 +
be/src/runtime/memory/cache_policy.h | 1 +
be/src/runtime/memory/mem_tracker_limiter.h | 1 +
be/src/service/doris_main.cpp | 1 +
be/src/util/binary_cast.hpp | 1 +
be/src/util/expected.hpp | 1 +
be/src/util/timezone_utils.cpp | 1 +
be/src/vec/aggregate_functions/aggregate_function_map.h | 8 +++++++-
be/src/vec/common/hash_table/hash_table.h | 5 ++++-
be/src/vec/common/hash_table/string_hash_table.h | 1 +
be/src/vec/core/types.h | 1 +
be/src/vec/data_types/data_type_decimal.h | 1 +
be/src/vec/data_types/data_type_number_base.cpp | 1 +
be/src/vec/data_types/data_type_number_base.h | 1 +
be/src/vec/data_types/serde/data_type_decimal_serde.h | 1 +
be/src/vec/functions/array/function_array_apply.cpp | 1 +
be/src/vec/functions/function_cast.h | 2 +-
be/src/vec/functions/round.h | 8 ++++++--
19 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/be/src/io/file_factory.h b/be/src/io/file_factory.h
index ef3d8b9fc3..3f71d98a09 100644
--- a/be/src/io/file_factory.h
+++ b/be/src/io/file_factory.h
@@ -97,6 +97,7 @@ public:
default:
LOG(FATAL) << "not match type to convert, from type:" << type;
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
};
diff --git a/be/src/pipeline/pipeline_task.h b/be/src/pipeline/pipeline_task.h
index b7b730ad82..cfee287c7c 100644
--- a/be/src/pipeline/pipeline_task.h
+++ b/be/src/pipeline/pipeline_task.h
@@ -100,6 +100,7 @@ inline const char* get_state_name(PipelineTaskState idx) {
case PipelineTaskState::BLOCKED_FOR_RF:
return "BLOCKED_FOR_RF";
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
diff --git a/be/src/runtime/memory/cache_policy.h
b/be/src/runtime/memory/cache_policy.h
index 008e5f4a47..e931b8f131 100644
--- a/be/src/runtime/memory/cache_policy.h
+++ b/be/src/runtime/memory/cache_policy.h
@@ -58,6 +58,7 @@ public:
default:
LOG(FATAL) << "not match type of cache policy :" <<
static_cast<int>(type);
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
diff --git a/be/src/runtime/memory/mem_tracker_limiter.h
b/be/src/runtime/memory/mem_tracker_limiter.h
index bf456c3455..144a189721 100644
--- a/be/src/runtime/memory/mem_tracker_limiter.h
+++ b/be/src/runtime/memory/mem_tracker_limiter.h
@@ -109,6 +109,7 @@ public:
default:
LOG(FATAL) << "not match type of mem tracker limiter :" <<
static_cast<int>(type);
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
diff --git a/be/src/service/doris_main.cpp b/be/src/service/doris_main.cpp
index 36f9cb02dd..2370cd3f95 100644
--- a/be/src/service/doris_main.cpp
+++ b/be/src/service/doris_main.cpp
@@ -167,6 +167,7 @@ auto instruction_fail_to_string(InstructionFail fail) {
case InstructionFail::ARM_NEON:
ret("ARM_NEON");
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
diff --git a/be/src/util/binary_cast.hpp b/be/src/util/binary_cast.hpp
index b252c996c6..ecba899ec2 100644
--- a/be/src/util/binary_cast.hpp
+++ b/be/src/util/binary_cast.hpp
@@ -144,6 +144,7 @@ To binary_cast(From from) {
conv.decimal = from;
return conv.i128;
} else {
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
}
diff --git a/be/src/util/expected.hpp b/be/src/util/expected.hpp
index 5fe7c3dff0..16f28136c3 100644
--- a/be/src/util/expected.hpp
+++ b/be/src/util/expected.hpp
@@ -221,6 +221,7 @@ template <typename E>
#ifdef _MSC_VER
__assume(0);
#else
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
#endif
#endif
diff --git a/be/src/util/timezone_utils.cpp b/be/src/util/timezone_utils.cpp
index 112dc74eb0..14dd8b7e53 100644
--- a/be/src/util/timezone_utils.cpp
+++ b/be/src/util/timezone_utils.cpp
@@ -98,6 +98,7 @@ T next_from_charstream(int8_t*& src) {
} else {
LOG(FATAL) << "Unknown endianess";
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
diff --git a/be/src/vec/aggregate_functions/aggregate_function_map.h
b/be/src/vec/aggregate_functions/aggregate_function_map.h
index 057012f8b7..38b69756e0 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_map.h
+++ b/be/src/vec/aggregate_functions/aggregate_function_map.h
@@ -40,7 +40,11 @@ template <typename K>
struct AggregateFunctionMapAggData {
using KeyType = std::conditional_t<std::is_same_v<K, String>, StringRef,
K>;
using Map = phmap::flat_hash_map<StringRef, int64_t>;
- AggregateFunctionMapAggData() { __builtin_unreachable(); }
+
+ AggregateFunctionMapAggData() {
+ LOG(FATAL) << "__builtin_unreachable";
+ __builtin_unreachable();
+ }
AggregateFunctionMapAggData(const DataTypes& argument_types) {
_key_type = remove_nullable(argument_types[0]);
@@ -213,11 +217,13 @@ public:
void serialize(ConstAggregateDataPtr /* __restrict place */,
BufferWritable& /* buf */) const override {
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
void deserialize(AggregateDataPtr /* __restrict place */, BufferReadable&
/* buf */,
Arena*) const override {
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
diff --git a/be/src/vec/common/hash_table/hash_table.h
b/be/src/vec/common/hash_table/hash_table.h
index a460f0bc2a..756a2c9abb 100644
--- a/be/src/vec/common/hash_table/hash_table.h
+++ b/be/src/vec/common/hash_table/hash_table.h
@@ -379,7 +379,10 @@ struct HashTableFixedGrower {
size_t next(size_t pos) const { return pos + 1; }
bool overflow(size_t /*elems*/) const { return false; }
- void increase_size() { __builtin_unreachable(); }
+ void increase_size() {
+ LOG(FATAL) << "__builtin_unreachable";
+ __builtin_unreachable();
+ }
void set(size_t /*num_elems*/) {}
void set_buf_size(size_t /*buf_size_*/) {}
};
diff --git a/be/src/vec/common/hash_table/string_hash_table.h
b/be/src/vec/common/hash_table/string_hash_table.h
index 712ccb3810..4311dddefd 100644
--- a/be/src/vec/common/hash_table/string_hash_table.h
+++ b/be/src/vec/common/hash_table/string_hash_table.h
@@ -309,6 +309,7 @@ protected:
return iterator4 == rhs.iterator4;
}
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
diff --git a/be/src/vec/core/types.h b/be/src/vec/core/types.h
index a92c183c89..51c41f8662 100644
--- a/be/src/vec/core/types.h
+++ b/be/src/vec/core/types.h
@@ -709,6 +709,7 @@ inline const char* getTypeName(TypeIndex idx) {
return "Time";
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
} // namespace vectorized
diff --git a/be/src/vec/data_types/data_type_decimal.h
b/be/src/vec/data_types/data_type_decimal.h
index a9efbeea75..c704c90365 100644
--- a/be/src/vec/data_types/data_type_decimal.h
+++ b/be/src/vec/data_types/data_type_decimal.h
@@ -168,6 +168,7 @@ public:
if constexpr (std::is_same_v<TypeId<T>, TypeId<Decimal128I>>) {
return TPrimitiveType::DECIMAL128I;
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
diff --git a/be/src/vec/data_types/data_type_number_base.cpp
b/be/src/vec/data_types/data_type_number_base.cpp
index 5e226b6c89..bd73fc4adc 100644
--- a/be/src/vec/data_types/data_type_number_base.cpp
+++ b/be/src/vec/data_types/data_type_number_base.cpp
@@ -136,6 +136,7 @@ Field DataTypeNumberBase<T>::get_field(const TExprNode&
node) const {
if constexpr (std::is_same_v<TypeId<T>, TypeId<Float64>>) {
return Float64(node.float_literal.value);
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
diff --git a/be/src/vec/data_types/data_type_number_base.h
b/be/src/vec/data_types/data_type_number_base.h
index 6ed8047f34..bf6aab8c21 100644
--- a/be/src/vec/data_types/data_type_number_base.h
+++ b/be/src/vec/data_types/data_type_number_base.h
@@ -114,6 +114,7 @@ public:
if constexpr (std::is_same_v<TypeId<T>, TypeId<Float64>>) {
return TPrimitiveType::DOUBLE;
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
Field get_default() const override;
diff --git a/be/src/vec/data_types/serde/data_type_decimal_serde.h
b/be/src/vec/data_types/serde/data_type_decimal_serde.h
index 57cf98327a..c80096ed74 100644
--- a/be/src/vec/data_types/serde/data_type_decimal_serde.h
+++ b/be/src/vec/data_types/serde/data_type_decimal_serde.h
@@ -60,6 +60,7 @@ public:
if constexpr (std::is_same_v<TypeId<T>, TypeId<Decimal128>>) {
return TYPE_DECIMALV2;
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
diff --git a/be/src/vec/functions/array/function_array_apply.cpp
b/be/src/vec/functions/array/function_array_apply.cpp
index a9de042e98..bc16ec6516 100644
--- a/be/src/vec/functions/array/function_array_apply.cpp
+++ b/be/src/vec/functions/array/function_array_apply.cpp
@@ -130,6 +130,7 @@ private:
if constexpr (op == ApplyOp::GE) {
return data >= comp;
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
diff --git a/be/src/vec/functions/function_cast.h
b/be/src/vec/functions/function_cast.h
index ed86e436a6..6a6a348e15 100644
--- a/be/src/vec/functions/function_cast.h
+++ b/be/src/vec/functions/function_cast.h
@@ -1036,7 +1036,7 @@ struct ToNumberMonotonicity {
return {};
}
}
-
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
};
diff --git a/be/src/vec/functions/round.h b/be/src/vec/functions/round.h
index 66753f00c0..ae79804022 100644
--- a/be/src/vec/functions/round.h
+++ b/be/src/vec/functions/round.h
@@ -112,7 +112,7 @@ struct IntegerRoundingComputation {
return target_scale > 1 ? x * target_scale : x;
}
}
-
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
@@ -124,7 +124,7 @@ struct IntegerRoundingComputation {
case ScaleMode::Negative:
return compute_impl(x, scale, target_scale);
}
-
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
@@ -239,6 +239,7 @@ inline float roundWithMode(float x, RoundingMode mode) {
return truncf(x);
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
@@ -254,6 +255,7 @@ inline double roundWithMode(double x, RoundingMode mode) {
return trunc(x);
}
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
@@ -417,6 +419,7 @@ public:
case 10000000000000000000ULL:
return applyImpl<10000000000000000000ULL>(in, out);
default:
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
}
}
@@ -474,6 +477,7 @@ struct Dispatcher {
return col_res;
} else {
+ LOG(FATAL) << "__builtin_unreachable";
__builtin_unreachable();
return nullptr;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]