Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 158266335A2 for ; Thu, 1 Jul 2010 22:27:22 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 95622-09 for ; Fri, 2 Jul 2010 01:27:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id 29CE863354C for ; Thu, 1 Jul 2010 22:27:15 -0300 (ADT) Received: from mail63.csoft.net (localhost [127.0.0.1]) by mail63.csoft.net (Postfix) with ESMTP id 2F34328411; Thu, 1 Jul 2010 21:27:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sel1; bh=/ZFaz5FS9cbc3eakfnWzl/0Nzio=; b=YJZR9b 3OMzxW5KiWhKDpN/lIrxPcU7nO6HLAexXWyGm3tbCEeDqelMGaTHcwDZI+NG4WOS 05HLoxaFO+GGY/7kTxUC5AoucLTSH7F88imxGVdZHBaX4LI+qNuLg+yZDhSDUBBs yx/th4u5pazN1dLbSwtVUV/UezGJBsA2xmeHE= Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 2CAB42840F; Thu, 1 Jul 2010 21:27:13 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 269E7A200; Thu, 1 Jul 2010 21:27:13 -0400 (EDT) Date: Thu, 1 Jul 2010 21:27:13 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: S K cc: pgsql-jdbc@postgresql.org Subject: Re: Transient runtime error: java.lang.NegativeArraySizeException from org.postgresql.core.PGStream.ReceiveTupleV3(PGStream.java:349) ... In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.79 tagged_above=-10 required=5 tests=BAYES_50=0.8, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Archive-Number: 201007/10 X-Sequence-Number: 20675 On Tue, 22 Jun 2010, S K wrote: >=20 > Our application has been in production for a couple of years. Recent > investigation into a problem revealed the following error started a few > months back. =A0I restarted the application, but the error appears after = a few > days and the thread dies. >=20 > Caused by: java.lang.NegativeArraySizeException > =A0=A0 =A0 =A0 =A0at org.postgresql.core.PGStream.ReceiveTupleV3(PGStream= .java:349) > =A0=A0 =A0 =A0 =A0atorg.postgresql.core.v3.QueryExecutorImpl.processResul= ts(QueryExecutorImpl.j > ava:1306) > =A0=A0 =A0 =A0 =A0atorg.postgresql.core.v3.QueryExecutorImpl.execute(Quer= yExecutorImpl.java:192 > ) > =A0=A0 =A0 =A0 =A0atorg.postgresql.jdbc2.AbstractJdbc2Statement.execute(A= bstractJdbc2Statement. > java:451) > =A0=A0 =A0 =A0 =A0atorg.postgresql.jdbc2.AbstractJdbc2Statement.executeWi= thFlags(AbstractJdbc2S > tatement.java:350) > =A0=A0 =A0 =A0 =A0atorg.postgresql.jdbc2.AbstractJdbc2Statement.executeQu= ery(AbstractJdbc2State > ment.java:254) I haven't seen an error like this before. It most likely indicates that=20 the driver has lost protocol sync with the server and is reading the wrong= =20 part of the message. This is difficult to debug because it's unknown how= =20 far back synchronization was lost. To try to debug this I would modify=20 the driver to log the negative array size value and as much of the message= =20 parts I could find around it. That may give some clues as to why the=20 driver is confused. Additionally, I would try to determine the triggering= =20 query and see if I could reproduce it. Kris Jurka=