-
Notifications
You must be signed in to change notification settings - Fork 53
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
Add warning for OBJECT_UNUSED in journal plugin #971
Add warning for OBJECT_UNUSED in journal plugin #971
Conversation
Would it be possible to add a unit test? |
Unfortunately we do not have a journal file we can share with |
Would it be possible to fabricate one with some hex editing or a cstruct write? |
We have added a modified journal file in 3dc6d25. |
35ff3db
to
3dc6d25
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #971 +/- ##
==========================================
+ Coverage 77.74% 77.76% +0.01%
==========================================
Files 327 327
Lines 28623 28627 +4
==========================================
+ Hits 22254 22261 +7
+ Misses 6369 6366 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This PR adds an additional check for ObjectType
OBJECT_UNUSED
when iterating to a new journal entry array. It is possible that space is allocated in a journal file which is not yet used to store the next entry array (e.g. the object resides in memory and is not yet flushed to disk). The plugin would then attempt to read this empty data and return aValueError
since it is not expecting a zero byte.We have changed this to a warning and added a break to stop iterating since this ObjectType can only be encountered at the end of a journal file.