[jboss-jira] [JBoss JIRA] (DROOLS-25) Cannot unmarshall large session file: InvalidProtocolBufferException

RH Bugzilla Integration (JIRA) issues at jboss.org
Wed Mar 18 18:16:19 EDT 2015


    [ https://issues.jboss.org/browse/DROOLS-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13051602#comment-13051602 ] 

RH Bugzilla Integration commented on DROOLS-25:
-----------------------------------------------

Alessandro Lazarotti <alazarot at redhat.com> changed the Status of [bug 1201785|https://bugzilla.redhat.com/show_bug.cgi?id=1201785] from NEW to ASSIGNED

> Cannot unmarshall large session file: InvalidProtocolBufferException
> --------------------------------------------------------------------
>
>                 Key: DROOLS-25
>                 URL: https://issues.jboss.org/browse/DROOLS-25
>             Project: Drools
>          Issue Type: Bug
>    Affects Versions: 5.5.0.Final
>         Environment: Jdk 7
>            Reporter: Magnus Vojbacke
>            Assignee: Edson Tirelli
>             Fix For: 5.5.1.Final, 6.0.0.Alpha9
>
>
> When trying to unmarshall a large knowledge session from a file stream, an exception is thrown.
> It seems that there is a default message size limit in Protobuf (used by Drools marshalling). Apparently, what happens is that the marshalled "Header" message exceeds this size, which causes Protobuf to throw this exception.
> I suspect that the Header field "payload" is the culprit, since it seems to contain the rest of the knowledge base in byte array form.
> Here's the stack trace:
> {code:title=Stacktrace}
> 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:89
>     at com.google.protobuf.CodedInputStream.refillBuffer:720
>     at com.google.protobuf.CodedInputStream.isAtEnd:666
>     at com.google.protobuf.CodedInputStream.readTag:99
>     at org.drools.marshalling.impl.ProtobufMessages$Header$Builder.mergeFrom:967
>     at org.drools.marshalling.impl.ProtobufMessages$Header$Builder.mergeFrom:773
>     at com.google.protobuf.AbstractMessageLite$Builder.mergeFrom:212
>     at com.google.protobuf.AbstractMessage$Builder.mergeFrom:746
>     at org.drools.marshalling.impl.ProtobufMessages$Header.parseFrom:724
>     at org.drools.marshalling.impl.PersisterHelper.readFromStreamWithHeader:234
>     at org.drools.marshalling.impl.ProtobufInputMarshaller.loadAndParseSession:217
>     at org.drools.marshalling.impl.ProtobufInputMarshaller.readSession:107
>     at org.drools.marshalling.impl.ProtobufMarshaller.unmarshall:143
> {code}
> Suggested solutions:
> #1
> You can set the size limit of the Protobuf CodedInputStream, but there doesn't seem to be any way of providing this parameter to the Drools unmarshalling API.
> #2
> When you unmarshall from a byte array, Protobuf does not enforce any message size limit. I have successfully implemented a patch in drools-core that preloads the file into memory and unmarshalls from a byte array. Probably the least desirable fix.



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jboss-jira mailing list