This repository was archived by the owner on May 31, 2025. It is now read-only.
Fixed corrupted messages when reopening a rosbag with a different file (#1176)#1192
Merged
dirk-thomas merged 2 commits intoros:lunar-develfrom Oct 23, 2017
Merged
Fixed corrupted messages when reopening a rosbag with a different file (#1176)#1192dirk-thomas merged 2 commits intoros:lunar-develfrom
dirk-thomas merged 2 commits intoros:lunar-develfrom
Conversation
dirk-thomas
reviewed
Oct 20, 2017
tools/rosbag_storage/src/bag.cpp
Outdated
| chunk_open_ = false; | ||
| curr_chunk_data_pos_ = 0; | ||
| current_buffer_ = 0; | ||
| decompressed_chunk_ = 0; |
Member
There was a problem hiding this comment.
This should be easier now that #1189 has been merged. Please update the patch to call the new init method instead.
* ... even with different bags
1888f83 to
f415f71
Compare
* Bag::decompressed_chunk_ was not reset in close(). decompressed_chunk_ stores the offset (within the file) of the compressed chunk whose decompressed content is currently stored in decompress_buffer_. Since it wasn't reset in close(), if the offset is the same as that of the first chunk in the file opened next, Bag::decompressChunk() assumed that it had already decompressed that chunk in the new file and just returned. As a result, some member functions of Bag worked on the decompressed chunk of the old bag. * Cleaned up more state in Bag::close() and ChunkedFile::close()
f415f71 to
abb8491
Compare
Contributor
Author
|
Done. I also analyzed the bug a bit more and found the following cause, which I added to the commit message: |
Member
|
Thank you for the patch. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I kept #1188 as-is to demonstrate the failing test. (I think I remember that the CI only builds the latest commit in a pull-request, right?)