Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VKYxi-0000R3-IG for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Sep 2013 19:23:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VKYxh-0003Kq-US for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Sep 2013 19:23:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VKVu1-0005x4-5I for pgsql-bugs@postgresql.org; Fri, 13 Sep 2013 16:07:25 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VKVtx-0003CN-UO for pgsql-bugs@postgresql.org; Fri, 13 Sep 2013 16:07:24 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VKVtw-0004FH-FP for pgsql-bugs@postgresql.org; Fri, 13 Sep 2013 16:07:21 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.80) (envelope-from ) id 1VKVtr-0004tG-4x for pgsql-bugs@postgresql.org; Fri, 13 Sep 2013 16:07:15 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: BUG #8451: quantile extension: memory corruption? To: pgsql-bugs@postgresql.org From: stephane.wustner@lip6.fr Message-Id: Date: Fri, 13 Sep 2013 16:07:15 +0000 X-Pg-Spam-Score: -2.8 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 8451 Logged by: strexxx Email address: stephane.wustner@lip6.fr PostgreSQL version: 9.1.9 Operating system: Linux 3.8.0-27-generic #40-Ubuntu SMP x86_64 Description: A query such as this one COPY (SELECT e,quantile(EXTRACT(EPOCH FROM(d)),ARRAY[0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1]) AS d FROM (SELECT e,max(time)-min(time) AS d FROM bb RIGHT JOIN (SELECT s,e FROM ss RIGHT JOIN (SELECT e FROM ee WHERE h ~* 'blah') AS i0 USING(e)) AS i0 USING (sessionid) GROUP BY e,ei) AS i1 GROUP BY e) TO 'full_path/d.csv' WITH CSV;" generates this ... 403,"{0.101187,0.139183,0.189162,0.271442,0.405427,0.731997,1.178445,2.52971,4.288747,9.544644,8996.364885}" 404,"{8996.364885,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322}" 437,"{0.10007,0.204397,0.266877,0.48238,0.669026,0.911554,1.275652,1.656346,2.445659,3.909159,58915.291602}" 438,"{58915.291602,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322}" 440,"{58915.291602,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322,3.16202013338398e-322}" ... for row that gets corrupted, the value d, for which quantiles are computed over, is NULL (there is no such row matching conditions and JOIN). I would expect the quantiles to be NULL as well. Additionally there is a strange pattern: the last value of the row preceding a corrupted one, is repeated as the first value of the corrupted rows that comes after. The other values correspond to something somewhat close to 2^-1068 (why ?) ... This subquery corresponding to one of the corrupted case works correctly (from my understanding) SELECT s,quantile(EXTRACT(EPOCH FROM(d)),ARRAY[0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1]) AS d FROM (SELECT s,max(time)-min(time) AS d FROM bb WHERE s = 440 GROUP BY s,e) AS i1 GROUP BY s; s | d -----------+---------- (0 rows) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs