Repository navigation
Avoid possible memory leaks in compressors in case of missing buffer finalization - #55262
Conversation
|
This is an automated comment for commit 28f17be with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page Successful checks
|
92a98e2 to
ceade93
Compare
I think that is relevant to the changes. |
Unlikely, since And besides the only problem that could be introduced by this patch is use-after-free (set to null), while in this case the error will be completely different. |
I do not say that the patch introduces the |
I don't see how it unveils it, I think it was possible before, but there was not enough luck to trigger it |
|
The core is useless for this case, BTW, there is no such stacktrace anymore. |
|
MSan report is always "stop all the work, fix it immediately". |
Sometimes it is still possible, the pattern could looks like this:
try
{
writer->finalize();
writer->flush();
write_buf->finalize();
}
catch (...)
{
/// Stop ParallelFormattingOutputFormat correctly.
release();
throw;
}
Here, write_buf will not be finalized, in case of exception during
writer finalize()/flush().
Signed-off-by: Azat Khuzhin <[email protected]>
ceade93 to
28f17be
Compare
|
I can reproduce the issue, and it happens even without text_log. |
|
|
|
This also blocks #55261 |
|
@CheSema kind ping |
alexey-milovidov
left a comment
There was a problem hiding this comment.
The code LGTM. Thank you!
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Avoid possible memory leaks in compressors in case of missing buffer finalization
Sometimes it is still possible, the pattern could looks like this:
Here,
write_bufwill not be finalized, in case of exception duringwriterfinalize/flush.Fixes: #50395 (cc @CheSema )