-
Notifications
You must be signed in to change notification settings - Fork 656
The use-heap-after-free
error in the Topic SDK code
#15088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The use-heap-after-free
error in the Topic SDK code
#15088
Conversation
🟢 |
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
⚪ Test history | Ya make output | Test bloat
⚪ Test history | Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
use-heap-after-free
error in the Topic SDK code
|
||
template <> | ||
struct THash<NYdb::NTopic::TTransactionId> { | ||
size_t operator()(const NYdb::NTopic::TTransactionId& v) const noexcept { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А для чего хеш используется? Вроде в HashMap не кладем ничего
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В сессиях чтения и записи хранится список транзакций
https://github.com/ydb-platform/ydb/blob/main/ydb/public/sdk/cpp/src/client/topic/impl/read_session_impl.h#L1380
https://github.com/ydb-platform/ydb/blob/main/ydb/public/sdk/cpp/src/client/topic/impl/write_session_impl.h#L496
} | ||
|
||
inline | ||
const std::string& GetTxId(const TTransactionId& x) | ||
bool operator!=(const TTransactionId& lhs, const TTransactionId& rhs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем нам только оператор !=?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для симметрии :)
Changelog entry
A pointer to the transaction was stored in the recorded message. This could lead to a
use-heap-after-free
error in thelinux-x86_64-release-asan
configuration#15089
Changelog category
Description for reviewers
Added the
TTransactionId
type. Now, instead of a pointer,std::optional<TTransactionId>
is stored.