This is an automated email from the ASF dual-hosted git repository.
zykkk 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 15c43d8b8a0 [BugFix](JDBC Catalog) fix jdbc catalog query bitmap may
cause be core sometimes (#26933)
15c43d8b8a0 is described below
commit 15c43d8b8a0a7b2f6a916b8c2288cd0d0bef4d12
Author: GoGoWen <[email protected]>
AuthorDate: Wed Nov 15 10:20:42 2023 +0800
[BugFix](JDBC Catalog) fix jdbc catalog query bitmap may cause be core
sometimes (#26933)
BitmapValue::write_to will get a string with size 1 for empty BitmapValue,
however the size 1 string will reinterpret to BitmapValue* back in
ColumnComplexType::insert:
void insert(const Field& x) override {
const String& s = doris::vectorized::get<const String&>(x);
data.push_back(reinterpret_cast<const T>(s.c_str()));
}
in data.push_back will goto BitmapValue copy constructor, as the _type is
not first member in BitmapValue, cause access to an unknown memory location.
---
be/src/util/bitmap_value.h | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/be/src/util/bitmap_value.h b/be/src/util/bitmap_value.h
index 71edf62a8ad..07895ed5591 100644
--- a/be/src/util/bitmap_value.h
+++ b/be/src/util/bitmap_value.h
@@ -1259,10 +1259,9 @@ public:
}
static std::string empty_bitmap() {
- static BitmapValue bitmap;
- std::string buf;
- buf.resize(bitmap.getSizeInBytes());
- bitmap.write_to(buf.data());
+ std::string buf(sizeof(BitmapValue), 0);
+ BitmapValue* bitmap_value = reinterpret_cast<BitmapValue*>(buf.data());
+ bitmap_value->_type = EMPTY;
return buf;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]