Skip to content
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

RID tracked handles better error messages for dangling RIDs #55719

Merged
merged 1 commit into from
Dec 8, 2021

Conversation

lawnjelly
Copy link
Member

Keeps track of previous allocations as well as current allocations, as the previous allocation will be the one of interest in many cases for dangling RIDs.

Prints the file / line number in the error message, instead of using print_verbose.

Error message now contains:

  • Type of error, possible reason for error
  • Details of the RID, id and revision for the passed revision and the database entry revision (PE)
  • Short filenames for the current allocation and previous allocation (if present)

Notes

  • Now I've used this in practice to track down a danging RID bug (SpatialEditor::_finish_grid() is freeing RIDs that don't belong to it #44642) this gives an opportunity to make the error message more useful
  • The error message contains a lot of info, and is admittedly not super beginner friendly, but can be pasted in issues and will lead us directly to the source of the bug in many situations
  • The alternative I used before was to use print_verbose for the detailed info, but that is of little use with rare errors, because you may not have had verbose output on when it occurred.
  • The old error message wasn't super useful without the extra verbose output.
  • We can perhaps make this more beginner friendly in time, but it should hopefully be a rare error once we fix the engine bugs.

Example output

RID get_or_null, revision is incorrect, possible dangling RID. RID id=12204 [ rev 6 ], PE [ rev 7 ] canvas_item.cpp line 1268 ( prev spatial_editor_plugin.cpp line 5840 )

@lawnjelly lawnjelly requested a review from a team as a code owner December 8, 2021 09:58
Keeps track of previous allocations as well as current allocations, as the previous allocation will be the one of interest in many cases for dangling RIDs.

Prints the file / line number in the error message, instead of using print_verbose.
@akien-mga akien-mga added this to the 3.5 milestone Dec 8, 2021
@akien-mga akien-mga merged commit 193b278 into godotengine:3.x Dec 8, 2021
@akien-mga
Copy link
Member

Thanks!

@lawnjelly lawnjelly deleted the rid_tracking_better_info branch December 8, 2021 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants