Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Uc6uB-0005eJ-8M for pgsql-bugs@arkaria.postgresql.org; Tue, 14 May 2013 04:32:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Uc6uA-0008MV-Nd for pgsql-bugs@arkaria.postgresql.org; Tue, 14 May 2013 04:32:02 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Uc6u9-0008La-Fy for pgsql-bugs@postgresql.org; Tue, 14 May 2013 04:32:01 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Uc6u6-00063K-Nj for pgsql-bugs@postgresql.org; Tue, 14 May 2013 04:32:00 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Uc6u5-00028e-6F for pgsql-bugs@postgresql.org; Tue, 14 May 2013 04:31:58 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1Uc6tz-0006eK-WE for pgsql-bugs@postgresql.org; Tue, 14 May 2013 04:31:52 +0000 Date: Tue, 14 May 2013 04:31:51 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #8156: PostGIS crash with immutable functions when immutable function throws an error To: pgsql-bugs@postgresql.org From: lr@pcorp.us X-Pg-Spam-Score: -0.6 (/) 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: 8156 Logged by: Regina Email address: lr@pcorp.us PostgreSQL version: 9.2.4 Operating system: Windows 7 64-bit compiled with visual c++ - EDB 64 Description:=20=20=20=20=20=20=20=20 Nothing to do yet unless its obvious to you folks what is wrong here. I haven't determined if its an issue in how we are compiling PostGIS for windows or something fundametally wrong in the 9.2 branch on how it handles windows 64-bit. Details in this ticket: http://trac.osgeo.org/postgis/ticket/2185 The issue only seems to exhibit itself in PostgreSQL 9.2.2-9.2.4 (as I recall 9.2.1 doesn't have this issue). and it also only happens on windows 7-64bit and windows 2008 64-bit. As far as I can tell windows 2003 64-bit with same build doesn't have the issue and as I recall I can't replicate this issue testing under mingw64 either which we use to compile. We've only seen it with SQL functions that wrap a PostGIS c function and that are marked IMMUTABLE STRICT and happens when fed invalid inputs that would raise an error in the C function. If we take out the IMMUTABLE part it works fine. e.g. This function will crash when used with invalid inputs. such as ST_AsText('POINT(1 3 hi)') CREATE OR REPLACE FUNCTION st_astext(text) RETURNS text AS ' SELECT ST_AsText($1::geometry); ' LANGUAGE sql IMMUTABLE STRICT COST 100; This variant the function (note no immutable) CREATE OR REPLACE FUNCTION st_astextNotImmut(text) RETURNS text AS ' SELECT ST_AsText($1::geometry); ' LANGUAGE sql STRICT COST 100; Makes it not crash. The 9.3beta1 doesn't have this issue. Nor does the latest 9.1 I have tested. --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs