fix @ root remapping in Blackboard::createEntryImpl - #1192
Open
aysha-afrah26 wants to merge 1 commit into
Open
Conversation
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.
A subtree port that remaps to a root blackboard key, written as port="{@foo}" in the XML, is stored as the remapping param -> @foo. When that entry is first created, createEntryImpl walks the remapping up to the parent but never applies the @ redirection that getEntry, set, and createEntry all use, so it lands as a literal @foo entry in the root storage. getEntry then strips the @ and looks up foo in the root, which never matches, so the two disagree about where the entry actually lives. I ran into it through ImportBlackboardFromJSON, the public restore path behind ImportTreeFromJSON: it looks the key up, misses, creates it, looks again, still gets null, and then locks entry_mutex on that null pointer for a segfault. The same split loses data silently as well, since set("param") writes into @foo while a reader gets foo from the root. Moving the @ handling getEntry already has into createEntryImpl keeps creation and lookup in agreement, and the added test crashes before the change and passes after.