protocolbuffers / protobuf

Protocol Buffers - Google's data interchange format
http://protobuf.dev
Other
65.23k stars 15.44k forks source link

MessageDifferencer::StreamReporter Documentation Update #8861

Closed acminor closed 6 months ago

acminor commented 3 years ago

What version of protobuf and what language are you using? Version: v3.17.3 Language: C++

What operating system (Linux, Windows, ...) and version? Linux

What runtime / compiler are you using (e.g., python version or gcc version) g++ (Ubuntu 10.3.0-1ubuntu1~20.10) 10.3.0

What did you do? Steps to reproduce the behavior:

  1. Create a MessageDifferencer
  2. Create a StreamReporter with OstreamOutputStream(&std::cout)
  3. Attach StreamReporter to MessageDifferencer
  4. Use MessageDifferencer multiple times (with non-equal messages)
  5. Allow StreamReporter to be deleted
  6. See error for protobuf exception backup can only be called after next

What did you expect to see

No error.

I believe the documentation should mention that StreamReporter should be called with a new StreamReporter each time. Also, it appears that destructing the OstreamOutputStream in the StreamReporter is dangerous in that it destroys the internal Printer object which will throw an exception if it cannot call backup. This does not appear to be caught resulting in exceptions being bubbled up from a destructor.

What did you see instead?

Sorry I do not have the log. I can recreate it if needed.

Anything else we should know about your project / environment

github-actions[bot] commented 7 months ago

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago.

github-actions[bot] commented 6 months ago

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.

This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.