aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnaury <snaury@ydb.tech>2023-07-04 10:06:49 +0300
committersnaury <snaury@ydb.tech>2023-07-04 10:06:49 +0300
commit0f87b69c533a45da477e2f0a010c8922f0cb86b7 (patch)
treecf778a3512d0b0aaec040a63a831b56c880f69fd
parentd44d62cd90b65db2f9e6c44a0cd298ad66b020b4 (diff)
downloadydb-0f87b69c533a45da477e2f0a010c8922f0cb86b7.tar.gz
Fix misaligned arena block size in TEvUploadRowsRequest causing ubsan failures
-rw-r--r--library/cpp/actors/core/event_pb.h5
-rw-r--r--ydb/core/tx/datashard/datashard.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/library/cpp/actors/core/event_pb.h b/library/cpp/actors/core/event_pb.h
index 3543af4901..4c4f49b1cc 100644
--- a/library/cpp/actors/core/event_pb.h
+++ b/library/cpp/actors/core/event_pb.h
@@ -448,6 +448,11 @@ namespace NActors {
TIntrusivePtr<TProtoArenaHolder> Arena;
TRecord& Record;
+ // Arena depends on block size to be a multiple of 8 for correctness
+ // FIXME: uncomment these asserts when code is synchronized between repositories
+ // static_assert((InitialBlockSize & 7) == 0, "Misaligned InitialBlockSize");
+ // static_assert((MaxBlockSize & 7) == 0, "Misaligned MaxBlockSize");
+
static const google::protobuf::ArenaOptions GetArenaOptions() {
google::protobuf::ArenaOptions opts;
opts.initial_block_size = InitialBlockSize;
diff --git a/ydb/core/tx/datashard/datashard.h b/ydb/core/tx/datashard/datashard.h
index 0d79d0e758..ddbcc163bc 100644
--- a/ydb/core/tx/datashard/datashard.h
+++ b/ydb/core/tx/datashard/datashard.h
@@ -865,7 +865,7 @@ struct TEvDataShard {
struct TEvUploadRowsRequest : public TEventPBWithArena<TEvUploadRowsRequest,
NKikimrTxDataShard::TEvUploadRowsRequest,
TEvDataShard::EvUploadRowsRequest,
- 16200, 32500> {
+ 16*1024, 32*1024> {
TEvUploadRowsRequest() = default;
};