Skip to content

TEZ-4584: TezUtilsInternal.readUserSpecifiedTezConfiguration throws com.google.protobuf.CodedInputStream exception - #376

Closed
liujiayi771 wants to merge 1 commit into
apache:masterfrom
liujiayi771:TEZ-4584
Closed

TEZ-4584: TezUtilsInternal.readUserSpecifiedTezConfiguration throws com.google.protobuf.CodedInputStream exception#376
liujiayi771 wants to merge 1 commit into
apache:masterfrom
liujiayi771:TEZ-4584

Conversation

@liujiayi771

Copy link
Copy Markdown
com.google.protobuf.InvalidProtocolBufferException: Protocol message was too large. May be malicious. Use CodedInputStream.setSizeLimit() to increase the size limit.
at com.google.protobuf.InvalidProtocolBufferException.sizeLimitExceeded(InvalidProtocolBufferException.java:110)
at com.google.protobuf.CodedInputStream.refillBuffer(CodedInputStream.java:755)
at com.google.protobuf.CodedInputStream.isAtEnd(CodedInputStream.java:701)
at com.google.protobuf.CodedInputStream.readTag(CodedInputStream.java:99)
at org.apache.tez.dag.api.records.DAGProtos$ConfigurationProto.<init>(DAGProtos.java:19303)
at org.apache.tez.dag.api.records.DAGProtos$ConfigurationProto.<init>(DAGProtos.java:19267)
at org.apache.tez.dag.api.records.DAGProtos$ConfigurationProto$1.parsePartialFrom(DAGProtos.java:19369)
at org.apache.tez.dag.api.records.DAGProtos$ConfigurationProto$1.parsePartialFrom(DAGProtos.java:19364)
at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:200)
at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:217)
at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:223)
at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:49)
at org.apache.tez.dag.api.records.DAGProtos$ConfigurationProto.parseFrom(DAGProtos.java:19561)
at org.apache.tez.common.TezUtilsInternal.readUserSpecifiedTezConfiguration(TezUtilsInternal.java:77)
at org.apache.tez.dag.app.DAGAppMaster.main(DAGAppMaster.java:2351) 

It is same as https://issues.apache.org/jira/browse/TEZ-4142. Fix this issue by calling CodedInputStream.setSizeLimit.

@liujiayi771liujiayi771 changed the title :TEZ-4584: TezUtilsInternal.readUserSpecifiedTezConfiguration throws com.google.protobuf.CodedInputStream exceptionTEZ-4584: TezUtilsInternal.readUserSpecifiedTezConfiguration throws com.google.protobuf.CodedInputStream exceptionOct 30, 2024
@tez-yetus

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec23m 54sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
-1 ❌test4tests0m 0sThe patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 💚mvninstall16m 58smaster passed
+1 💚compile0m 29smaster passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu322.04
+1 💚compile0m 29smaster passed with JDK Private Build-1.8.0_422-8u422-b05-1~22.04-b05
+1 💚checkstyle1m 25smaster passed
+1 💚javadoc0m 37smaster passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu322.04
+1 💚javadoc0m 23smaster passed with JDK Private Build-1.8.0_422-8u422-b05-1~22.04-b05
+0 🆗spotbugs1m 18sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs1m 15smaster passed
_ Patch Compile Tests _
+1 💚mvninstall0m 15sthe patch passed
+1 💚compile0m 15sthe patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu322.04
+1 💚javac0m 15sthe patch passed
+1 💚compile0m 14sthe patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~22.04-b05
+1 💚javac0m 14sthe patch passed
+1 💚checkstyle0m 9sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 8sthe patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu322.04
+1 💚javadoc0m 8sthe patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~22.04-b05
+1 💚findbugs0m 36sthe patch passed
_ Other Tests _
+1 💚unit0m 35stez-common in the patch passed.
+1 💚asflicense0m 17sThe patch does not generate ASF License warnings.
49m 11s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-376/1/artifact/out/Dockerfile
GITHUB PR#376
JIRA IssueTEZ-4584
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
unameLinux 8d7cb4329e85 5.15.0-122-generic #132-Ubuntu SMP Thu Aug 29 13:45:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitypersonality/tez.sh
git revisionmaster / 607b2bc
Default JavaPrivate Build-1.8.0_422-8u422-b05-1~22.04-b05
Multi-JDK versions/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu322.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_422-8u422-b05-1~22.04-b05
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-376/1/testReport/
Max. process+thread count101 (vs. ulimit of 5500)
modulesC: tez-common U: tez-common
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-376/1/console
versionsgit=2.34.1 maven=3.6.3 findbugs=3.0.1
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

…om.google.protobuf.CodedInputStream exception
@tez-yetus

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 13sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
-1 ❌test4tests0m 0sThe patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 💚mvninstall19m 40smaster passed
+1 💚compile0m 29smaster passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu322.04
+1 💚compile0m 28smaster passed with JDK Private Build-1.8.0_422-8u422-b05-1~22.04-b05
+1 💚checkstyle1m 27smaster passed
+1 💚javadoc0m 39smaster passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu322.04
+1 💚javadoc0m 24smaster passed with JDK Private Build-1.8.0_422-8u422-b05-1~22.04-b05
+0 🆗spotbugs1m 24sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs1m 22smaster passed
_ Patch Compile Tests _
+1 💚mvninstall0m 15sthe patch passed
+1 💚compile0m 14sthe patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu322.04
+1 💚javac0m 14sthe patch passed
+1 💚compile0m 14sthe patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~22.04-b05
+1 💚javac0m 14sthe patch passed
+1 💚checkstyle0m 9sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 8sthe patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu322.04
+1 💚javadoc0m 8sthe patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~22.04-b05
+1 💚findbugs0m 37sthe patch passed
_ Other Tests _
+1 💚unit0m 37stez-common in the patch passed.
+1 💚asflicense0m 19sThe patch does not generate ASF License warnings.
28m 28s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-376/2/artifact/out/Dockerfile
GITHUB PR#376
JIRA IssueTEZ-4584
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
unameLinux d17062f9d326 5.15.0-122-generic #132-Ubuntu SMP Thu Aug 29 13:45:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitypersonality/tez.sh
git revisionmaster / 607b2bc
Default JavaPrivate Build-1.8.0_422-8u422-b05-1~22.04-b05
Multi-JDK versions/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu322.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_422-8u422-b05-1~22.04-b05
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-376/2/testReport/
Max. process+thread count101 (vs. ulimit of 5500)
modulesC: tez-common U: tez-common
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-376/2/console
versionsgit=2.34.1 maven=3.6.3 findbugs=3.0.1
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@ayushtknayushtkn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TEZ-4142. had a test as well, is it possible to extend a test for this case as well?

@liujiayi771

Copy link
Copy Markdown
Author

@ayushtkn I tried to add a test case. However, I found that this modification is no longer needed in master, including the modifications in TEZ-4142 are no longer needed as well.

I encountered this issue in version 0.10.2, when the protobuf version was 2.5.0. In that version, the CodedInputStream.DEFAULT_SIZE_LIMIT was 64MB.

https://github.com/protocolbuffers/protobuf/blob/774d630bde574f5fcbb6dae6eaa0f91f7bc12967/java/src/main/java/com/google/protobuf/CodedInputStream.java#L561

However, the protobuf in master branch has now been upgraded to 3.25.5, where the DEFAULT_SIZE_LIMIT is now set to Integer.MAX_VALUE by default, so this issue no longer exists.

https://github.com/protocolbuffers/protobuf/blob/9d0ec0f92b5b5fdeeda11f9dcecc1872ff378014/java/core/src/main/java/com/google/protobuf/CodedInputStream.java#L42

@ayushtkn

Copy link
Copy Markdown
Member

cool, we can close this then, thanx for checking

@ayushtknayushtkn closed this Nov 7, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@liujiayi771@tez-yetus@ayushtkn