You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of protobuf and what language are you using?
Version: 3.7.0-rc1
Language: Java
What operating system (Linux, Windows, ...) and version?
Ubuntu 16.4
What did you do?
We have protobuf-files that are generated with an older version of the protobuf java compiler, namely protoc-3.5.1-linux-x86_64.
We updated the de Java-Dependency com.google.protobuf from 3.6.1 to 3.7.0-rc1.
What did you see?
The generated code for a protobuf message looks as follows:
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
This calls setUnknownFieldsProto3 in GeneratedMessageV3:
... which then calls the caller setUnknownFields, producing and endless recursion.
This did not happen with version 3.6.1, but using 3.7.0-rc1 breaks our builds:
java.lang.StackOverflowError
at com.company.app.PbAppProtos$MyMessage$Builder.$jacocoInit(PbAppProtos.java)
at com.company.app.PbAppProtos$MyMessage$Builder.setUnknownFields(PbAppProtos.java)
at com.google.protobuf.GeneratedMessageV3$Builder.setUnknownFieldsProto3(GeneratedMessageV3.java:725)
at com.company.app.PbAppProtos$MyMessage$Builder.setUnknownFields(PbAppProtos.java:12366)
at com.company.app.PbAppProtos$MyMessage$Builder.setUnknownFields(PbAppProtos.java:11585)
at com.google.protobuf.GeneratedMessageV3$Builder.setUnknownFieldsProto3(GeneratedMessageV3.java:725)
at com.company.app.PbAppProtos$MyMessage$Builder.setUnknownFields(PbAppProtos.java:12366)
at com.company.app.PbAppProtos$MyMessage$Builder.setUnknownFields(PbAppProtos.java:11585)
at com.google.protobuf.GeneratedMessageV3$Builder.setUnknownFieldsProto3(GeneratedMessageV3.java:725)
at com.company.app.PbAppProtos$MyMessage$Builder.setUnknownFields(PbAppProtos.java:12366)
at com.company.app.PbAppProtos$MyMessage$Builder.setUnknownFields(PbAppProtos.java:11585)
at com.google.protobuf.GeneratedMessageV3$Builder.setUnknownFieldsProto3(GeneratedMessageV3.java:725)
at com.company.app.PbAppProtos$MyMessage$Builder.setUnknownFields(PbAppProtos.java:12366)
at com.company.app.PbAppProtos$MyMessage$Builder.setUnknownFields(PbAppProtos.java:11585)
...
What did you expect to see
... the new rc should be compatible with older generated protobuf files or have a major version change.
The text was updated successfully, but these errors were encountered:
…olbuffers#5657)
GeneratedMessageV3#setUnknownFieldsProto3 was trying to delegate to
setUnknownFields but was inadvertently resulting in infinite recursion.
This commit makes setUnknownFields and setUnknownFieldsProto3 delegate
to a common private method to fix the problem and avoid confusion.
GeneratedMessageV3#setUnknownFieldsProto3 was trying to delegate to
setUnknownFields but was inadvertently resulting in infinite recursion.
This commit makes setUnknownFields and setUnknownFieldsProto3 delegate
to a common private method to fix the problem and avoid confusion.
What version of protobuf and what language are you using?
Version: 3.7.0-rc1
Language: Java
What operating system (Linux, Windows, ...) and version?
Ubuntu 16.4
What did you do?
We have protobuf-files that are generated with an older version of the protobuf java compiler, namely
protoc-3.5.1-linux-x86_64
.We updated the de Java-Dependency
com.google.protobuf
from 3.6.1 to 3.7.0-rc1.What did you see?
The generated code for a protobuf message looks as follows:
This calls
setUnknownFieldsProto3
inGeneratedMessageV3
:... which then calls the caller
setUnknownFields
, producing and endless recursion.This did not happen with version
3.6.1
, but using3.7.0-rc1
breaks our builds:What did you expect to see
... the new rc should be compatible with older generated protobuf files or have a major version change.
The text was updated successfully, but these errors were encountered: