Fix segfault on accessing items in the DBus vault. Discard all items that are nullptr.#7850
Conversation
|
Need to trace this further back to see why an item would be nullptr. Also need to fix a couple things here. |
Codecov Report
@@ Coverage Diff @@
## develop #7850 +/- ##
===========================================
- Coverage 64.31% 64.29% -0.01%
===========================================
Files 339 339
Lines 43404 43431 +27
===========================================
+ Hits 27911 27922 +11
- Misses 15493 15509 +16
Continue to review full report at Codecov.
|
Agreed. @Aetf @bionade24 , I would remove the "Fixes: #7731", I'm not convinced this is the same crash as the OP in #7731. Actually, the OP sounds more like what was fixed in 2.7.1. |
Fine, as he didn't provide a backtrace we can't know for sure. |
|
Agreed the referenced issue definitely sounds like the problem fixed by 2.7.1. Going to close that one as duplicate. |
…that are nullptr.
4b6093e to
6b143c8
Compare
|
Any info about how to reproduce this? (best with a dbus-monitor trace items pointer may be nullptr if So if after an entry is added, and before The correct fix should be to make sure |
|
Agree searchItems should never add nullptr to the array, that is begging for crashes. |
|
However it is still unclear to me why this happens in the first place. I can't come up with a case where an entry is added but onEntryAdded is not called before anything else. That's why there is no checks in searchItems, because I supposed the invariant is always maintained. |
|
The root cause is found to be entries in the recycle bin returned during search, and they don't have corresponding items, thus nullptr. I'll prepare a new PR to fix that, and close this one. |
|
@Aetf have you opened a PR/Issue for it yet? |
Discards all items from the loop which are
nullptr. I doubt this isn't really fixing the root issue, but afterall it works. Root of issue probably in a31c5baFixes: #7731Testing strategy
Tests run manually and tested manually.
Type of change
@michaelk83