Re: BUG #13334: PostGIS 2.2 crash in topology (array_contain_compare)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: lr(at)pcorp(dot)us
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13334: PostGIS 2.2 crash in topology (array_contain_compare)
Date: 2015-05-22 22:25:23
Message-ID: 14779.1432333523@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

lr(at)pcorp(dot)us writes:
> Since May 9th our Debian build bot has been crashing on one of our PostGIS
> regression tests.

> I tried the same exercise on my Mingw-w64 GCC 4.8.3 (with latest PostgreSQL
> 9.5 - (dated 5/22) and also have crashing in same spot.

> I isoloated the offending query in PostGIS to this:

> with inp as ( select 'MULTIPOINT((0 -10),(5 -10))' ::geometry as g)
> select St_AsText(g), ST_Equals(totopogeom(g, 'tt', 1)::geometry, g) from
> inp;

> Which produces a gdb backtrace:

> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 4252.0x3cf4]
> array_contain_compare (array1=array1(at)entry=0xdd94200,
> array2=array2(at)entry=0xde69db8, collation=<optimized out>,
> matchall=matchall(at)entry=1 '\001', fn_extra=0xdeac920) at arrayfuncs.c:4116
> 4116 if (isnull2)

Hm. Just guessing from the location of the crash, but I'll bet I
overlooked the case of an expanded array with no nulls, ie should be

- bool isnull2 = nulls2[j];
+ bool isnull2 = nulls2 ? nulls2[j] : false;

I'll commit that in a few minutes, please confirm whether it fixes this
for you.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message chris 2015-05-23 00:05:27 BUG #13336: Unexpected result from invalid query
Previous Message Andres Freund 2015-05-22 19:43:52 Re: pg_upgrade slowness for databases with many tables