From issues-return-67247-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Fri Jun 15 12:21:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9A3BF180636 for ; Fri, 15 Jun 2018 12:21:05 +0200 (CEST) Received: (qmail 62052 invoked by uid 500); 15 Jun 2018 10:21:04 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 62043 invoked by uid 99); 15 Jun 2018 10:21:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jun 2018 10:21:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 3DFA0C0286 for ; Fri, 15 Jun 2018 10:21:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 5ml_ahn_aX1h for ; Fri, 15 Jun 2018 10:21:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id D4E975F59D for ; Fri, 15 Jun 2018 10:21:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 54039E012B for ; Fri, 15 Jun 2018 10:21:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 455C521849 for ; Fri, 15 Jun 2018 10:21:00 +0000 (UTC) Date: Fri, 15 Jun 2018 10:21:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IGNITE-8755) NegativeArraySizeException when trying to serialize in GridClientOptimizedMarshaller humongous object MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IGNITE-8755?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D165= 13643#comment-16513643 ]=20 ASF GitHub Bot commented on IGNITE-8755: ---------------------------------------- GitHub user ivandasch opened a pull request: https://github.com/apache/ignite/pull/4196 IGNITE-8755: If size is too big and left shift can cause arithmetic o= =E2=80=A6 =E2=80=A6veflow, just allocate bytes for required size. So NegativeArra= yException will never throw You can merge this pull request into a Git repository by running: $ git pull https://github.com/ivandasch/ignite ignite-8755 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/4196.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #4196 =20 ---- commit 0a77d3d2cd9713669e756078f0231faee743c7c1 Author: Ivan Daschinskiy Date: 2018-06-15T10:16:40Z IGNITE-8755: If size is too big and left shift can cause arithmetic ove= flow, just allocate bytes for required size. ---- > NegativeArraySizeException when trying to serialize in GridClientOptimize= dMarshaller humongous object > -------------------------------------------------------------------------= ---------------------------- > > Key: IGNITE-8755 > URL: https://issues.apache.org/jira/browse/IGNITE-8755 > Project: Ignite > Issue Type: Bug > Components: binary > Affects Versions: 2.5 > Reporter: Ivan Daschinskiy > Assignee: Ivan Daschinskiy > Priority: Major > Fix For: 2.6 > > > When trying to serialize humongous object in GridClientOptimizedMarshalle= r, NegativeArraySizeException thrown. See below > {code:java} > java.io.IOException: class org.apache.ignite.IgniteCheckedException: Fail= ed to serialize object: GridClientResponse [clientId=3Dnull, reqId=3D0, des= tId=3Dnull, status=3D0, errMsg=3Dnull, result=3Dorg.apache.ignite.internal.= processors.rest.protocols.tcp.TcpRestParserSelfTest$HugeObject@60a582c1] > =09at org.apache.ignite.internal.client.marshaller.optimized.GridClientOp= timizedMarshaller.marshal(GridClientOptimizedMarshaller.java:101) > =09at org.apache.ignite.internal.processors.rest.protocols.tcp.TcpRestPar= serSelfTest.testHugeObject(TcpRestParserSelfTest.java:103) > =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp= l.java:62) > =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc= essorImpl.java:43) > =09at java.lang.reflect.Method.invoke(Method.java:498) > =09at junit.framework.TestCase.runTest(TestCase.java:176) > =09at org.apache.ignite.testframework.junits.GridAbstractTest.runTestInte= rnal(GridAbstractTest.java:2086) > =09at org.apache.ignite.testframework.junits.GridAbstractTest.access$000(= GridAbstractTest.java:140) > =09at org.apache.ignite.testframework.junits.GridAbstractTest$5.run(GridA= bstractTest.java:2001) > =09at java.lang.Thread.run(Thread.java:748) > Caused by: class org.apache.ignite.IgniteCheckedException: Failed to seri= alize object: GridClientResponse [clientId=3Dnull, reqId=3D0, destId=3Dnull= , status=3D0, errMsg=3Dnull, result=3Dorg.apache.ignite.internal.processors= .rest.protocols.tcp.TcpRestParserSelfTest$HugeObject@60a582c1] > =09at org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller= .marshal0(OptimizedMarshaller.java:206) > =09at org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.marsha= l(AbstractNodeNameAwareMarshaller.java:58) > =09at org.apache.ignite.internal.util.IgniteUtils.marshal(IgniteUtils.jav= a:10059) > =09at org.apache.ignite.internal.client.marshaller.optimized.GridClientOp= timizedMarshaller.marshal(GridClientOptimizedMarshaller.java:88) > =09... 10 more > Caused by: java.lang.NegativeArraySizeException > =09at org.apache.ignite.internal.util.io.GridUnsafeDataOutput.requestFree= Size(GridUnsafeDataOutput.java:131) > =09at org.apache.ignite.internal.util.io.GridUnsafeDataOutput.write(GridU= nsafeDataOutput.java:166) > =09at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutp= utStream.write(OptimizedObjectOutputStream.java:142) > =09at org.apache.ignite.internal.processors.rest.protocols.tcp.TcpRestPar= serSelfTest$HugeObject.writeExternal(TcpRestParserSelfTest.java:122) > =09at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutp= utStream.writeExternalizable(OptimizedObjectOutputStream.java:319) > =09at org.apache.ignite.internal.marshaller.optimized.OptimizedClassDescr= iptor.write(OptimizedClassDescriptor.java:814) > =09at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutp= utStream.writeObject0(OptimizedObjectOutputStream.java:242) > =09at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutp= utStream.writeObjectOverride(OptimizedObjectOutputStream.java:159) > =09at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344) > =09at org.apache.ignite.internal.processors.rest.client.message.GridClien= tResponse.writeExternal(GridClientResponse.java:103) > =09at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutp= utStream.writeExternalizable(OptimizedObjectOutputStream.java:319) > =09at org.apache.ignite.internal.marshaller.optimized.OptimizedClassDescr= iptor.write(OptimizedClassDescriptor.java:814) > =09at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutp= utStream.writeObject0(OptimizedObjectOutputStream.java:242) > =09at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutp= utStream.writeObjectOverride(OptimizedObjectOutputStream.java:159) > =09at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344) > =09at org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller= .marshal0(OptimizedMarshaller.java:201) > {code} > The main cause of this that GridClientOptimizedMarshaller marshall object= through OptimizedMarshaller without backed OutputStream, so arithmetical o= verflow occurs in GridUnsafeDataOutput.requestFreeSize.=20 -- This message was sent by Atlassian JIRA (v7.6.3#76005)