Skip to content

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

Merged
merged 2 commits into from
Feb 27, 2025

Conversation

Alek5andr-Kotov
Copy link
Collaborator

@Alek5andr-Kotov Alek5andr-Kotov commented Feb 26, 2025

Changelog entry

A pointer to the transaction was stored in the recorded message. This could lead to a use-heap-after-free error in the linux-x86_64-release-asan configuration

#15089

Changelog category

  • Bugfix

Description for reviewers

Added the TTransactionId type. Now, instead of a pointer, std::optional<TTransactionId> is stored.

@Alek5andr-Kotov Alek5andr-Kotov requested a review from a team as a code owner February 26, 2025 15:57
Copy link

github-actions bot commented Feb 26, 2025

🟢 2025-02-26 16:08:44 UTC The validation of the Pull Request description is successful.

Copy link

github-actions bot commented Feb 26, 2025

2025-02-26 15:59:02 UTC Pre-commit check linux-x86_64-release-asan for 3e86b5f has started.
2025-02-26 15:59:25 UTC Artifacts will be uploaded here
2025-02-26 16:02:13 UTC ya make is running...
🟡 2025-02-26 17:36:10 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
12287 12132 0 97 27 31

2025-02-26 17:37:22 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-02-26 17:52:48 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
224 (only retried tests) 191 0 6 1 26

2025-02-26 17:53:01 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-02-26 17:58:07 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
62 (only retried tests) 35 0 2 0 25

🟢 2025-02-26 17:58:14 UTC Build successful.
🟢 2025-02-26 17:58:44 UTC ydbd size 3.7 GiB changed* by -6.4 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: e0f8b20 merge: 3e86b5f diff diff %
ydbd size 3 982 265 248 Bytes 3 982 258 688 Bytes -6.4 KiB -0.000%
ydbd stripped size 1 387 038 472 Bytes 1 387 037 672 Bytes -800 Bytes -0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

Copy link

github-actions bot commented Feb 26, 2025

2025-02-26 15:59:35 UTC Pre-commit check linux-x86_64-relwithdebinfo for 3e86b5f has started.
2025-02-26 15:59:53 UTC Artifacts will be uploaded here
2025-02-26 16:02:41 UTC ya make is running...
🟡 2025-02-26 17:27:05 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
26633 24023 0 5 2472 133

2025-02-26 17:32:56 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-02-26 17:43:21 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
215 (only retried tests) 92 0 0 0 123

🟢 2025-02-26 17:43:36 UTC Build successful.
🟢 2025-02-26 17:43:54 UTC ydbd size 2.1 GiB changed* by -9.3 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: e0f8b20 merge: 3e86b5f diff diff %
ydbd size 2 284 785 120 Bytes 2 284 775 608 Bytes -9.3 KiB -0.000%
ydbd stripped size 479 196 384 Bytes 479 195 616 Bytes -768 Bytes -0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@Alek5andr-Kotov Alek5andr-Kotov enabled auto-merge (squash) February 26, 2025 16:01
@Alek5andr-Kotov Alek5andr-Kotov changed the title WIP: The 'use-heap-after-free` error in the Topic SDK code The 'use-heap-after-free` error in the Topic SDK code Feb 26, 2025
@Alek5andr-Kotov Alek5andr-Kotov changed the title The 'use-heap-after-free` error in the Topic SDK code The use-heap-after-free error in the Topic SDK code Feb 26, 2025
@github-actions github-actions bot added bugfix and removed bugfix labels Feb 26, 2025

template <>
struct THash<NYdb::NTopic::TTransactionId> {
size_t operator()(const NYdb::NTopic::TTransactionId& v) const noexcept {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А для чего хеш используется? Вроде в HashMap не кладем ничего

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

inline
const std::string& GetTxId(const TTransactionId& x)
bool operator!=(const TTransactionId& lhs, const TTransactionId& rhs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А зачем нам только оператор !=?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для симметрии :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants