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

StackOverflowError with protobuf type google.protobuf.Value #1

Open
jfgosselin opened this issue May 30, 2018 · 2 comments
Open

StackOverflowError with protobuf type google.protobuf.Value #1

jfgosselin opened this issue May 30, 2018 · 2 comments

Comments

@jfgosselin
Copy link

I'm getting a StackOverflowError in the ProtocPluginCodeGenerator when a protobuf type google.protobuf.Value is used:

message CreateEchoRequest {
    int64 id = 1;
    EchoContent content = 2;
    google.protobuf.Value foo = 3;
}

java.lang.StackOverflowError
        at java.io.BufferedWriter.write(BufferedWriter.java:226)
        at java.io.Writer.write(Writer.java:157)
        at java.io.PrintStream.write(PrintStream.java:525)
        at java.io.PrintStream.print(PrintStream.java:669)
        at java.io.PrintStream.println(PrintStream.java:806)
        at com.turbonomic.protoc.plugin.common.generator.MessageDescriptor.lambda$visitFields$0(MessageDescriptor.java:124)
        at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:406)
        at com.turbonomic.protoc.plugin.common.generator.MessageDescriptor.visitFields(MessageDescriptor.java:123)
        at com.turbonomic.protoc.plugin.common.generator.MessageDescriptor.lambda$visitFields$0(MessageDescriptor.java:130)
        at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:406)
        at com.turbonomic.protoc.plugin.common.generator.MessageDescriptor.visitFields(MessageDescriptor.java:123)
        at com.turbonomic.protoc.plugin.common.generator.MessageDescriptor.lambda$visitFields$0(MessageDescriptor.java:130)
        at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:406)
        at com.turbonomic.protoc.plugin.common.generator.MessageDescriptor.visitFields(MessageDescriptor.java:123)
@ziminer
Copy link
Contributor

ziminer commented May 30, 2018

Ah, this is because Value has a circular definition inside it (Value -> ListValue -> Value), and the code that visits primitive fields chokes on it. I'll take a closer look at how to get around this.

@Hprasath
Copy link

Any solution to this? I have been facing the same issue, and I am not able to get around it. The proto file is provided by an upstream application, so I don't have control over the contents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants