Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upidentical() crashes when dealing with recursive fields in proto #56
Comments
|
Thanks for motivating a PR with an example. That is very good (yet rare ...) practice. |
Although it doesn't occur very often in the wild, it's possible to create protos that have recursive fields (see example proto below). When
identical()is called to compare messages whose descriptor has recursive fields, R crashes due to stack overflow.identical()calls C++ functionidentical_messages_()which iterates all fields in the messages' descriptor for a comprehensive comparison. In the case of recursive fields, this iteration never ends and eventually crashes.One possible fix is for
identical_messages_()to skip a field if it's not populated in both messages. This will naturally terminate the iteration at some point, because although a field's definition can be recursive, its actual data cannot be never-ending. I will send a PR for consideration.Created on 2018-11-30 by the reprex package (v0.2.1)