[CORE] The vector returned by ov::util::load_binary() has a size of 0.#33882
Open
sungeunk wants to merge 1 commit intoopenvinotoolkit:masterfrom
Open
[CORE] The vector returned by ov::util::load_binary() has a size of 0.#33882sungeunk wants to merge 1 commit intoopenvinotoolkit:masterfrom
sungeunk wants to merge 1 commit intoopenvinotoolkit:masterfrom
Conversation
t-jankowski
approved these changes
Jan 30, 2026
praasz
approved these changes
Feb 2, 2026
| buffer.reserve(std::filesystem::file_size(path)); | ||
| input.read(reinterpret_cast<char*>(buffer.data()), buffer.capacity()); | ||
| buffer.resize(std::filesystem::file_size(path)); | ||
| input.read(reinterpret_cast<char*>(buffer.data()), buffer.size()); |
Contributor
There was a problem hiding this comment.
Can be test be added to reproduce the issue?
Contributor
Author
There was a problem hiding this comment.
@praasz As you know, 'reserve() does not change the size of the vector.'
Refer link: https://en.cppreference.com/w/cpp/container/vector/reserve
Contributor
There was a problem hiding this comment.
Yes, it could be fix using back inserter and still use reserve
But test could be added to catch the issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The vector returned by ov::util::load_binary() has a size of 0.
This issue occurs after PR#33396