segmentation fault in lwgeom_geos.c

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

segmentation fault in lwgeom_geos.c

Jaime Casanova-2
Hi,

We found a problem in this query:

"""
SELECT DISTINCT vias_calle1, vias_calle2,
        x(st_transform(centroid(the_geom),4326)) as longitud,
        y(st_transform(centroid(the_geom),4326)) as latitud,
        x(centroid(the_geom)) as x, y(centroid(the_geom)) as y
  FROM (SELECT DISTINCT
                    v1.via_nombre as vias_calle1,
                    v2.via_nombre as vias_calle2,
                    st_union(ST_Intersection(v1.the_geom,v2.the_geom))
as the_geom
                 FROM bage_via as v1, bage_via as v2
              WHERE v1.via_nombre LIKE 'MAXIMILIANO RODRIGUEZ'
                    AND v2.via_nombre LIKE 'LAURO GUERRERO'
                    AND intersects(v1.the_geom,v2.the_geom)
                    AND v1.dipo_codiinec LIKE '170121%'
                    AND v2.dipo_codiinec LIKE '170121%'
               GROUP BY v1.via_nombre, v2.via_nombre
) as foo
"""

Attached a file with the backtrace, please let me know what else i can
provide to help debug this? I have access to the server with the
problem.

PostGIS full version

POSTGIS="2.1.8 r13780" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0,
6 March 2012" GDAL="GDAL 1.11.4, released 2016/0
1/25" LIBXML="2.9.1" LIBJSON="UNKNOWN" TOPOLOGY RASTER

postgres version

PostgreSQL 9.4.8 on x86_64-unknown-linux-gnu, compiled by gcc (GCC)
4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit

--
Jaime Casanova                      www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

_______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users

postgis_segmentation_fault.txt (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: segmentation fault in lwgeom_geos.c

Jaime Casanova-2
On 25 July 2016 at 18:24, Jaime Casanova <[hidden email]> wrote:

> Hi,
>
> We found a problem in this query:
>
> """
> SELECT DISTINCT vias_calle1, vias_calle2,
>         x(st_transform(centroid(the_geom),4326)) as longitud,
>         y(st_transform(centroid(the_geom),4326)) as latitud,
>         x(centroid(the_geom)) as x, y(centroid(the_geom)) as y
>   FROM (SELECT DISTINCT
>                     v1.via_nombre as vias_calle1,
>                     v2.via_nombre as vias_calle2,
>                     st_union(ST_Intersection(v1.the_geom,v2.the_geom))
> as the_geom
>                  FROM bage_via as v1, bage_via as v2
>               WHERE v1.via_nombre LIKE 'MAXIMILIANO RODRIGUEZ'
>                     AND v2.via_nombre LIKE 'LAURO GUERRERO'
>                     AND intersects(v1.the_geom,v2.the_geom)
>                     AND v1.dipo_codiinec LIKE '170121%'
>                     AND v2.dipo_codiinec LIKE '170121%'
>                GROUP BY v1.via_nombre, v2.via_nombre
> ) as foo
> """
>
> Attached a file with the backtrace, please let me know what else i can
> provide to help debug this? I have access to the server with the
> problem.
>
> PostGIS full version
>
> POSTGIS="2.1.8 r13780" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0,
> 6 March 2012" GDAL="GDAL 1.11.4, released 2016/0
> 1/25" LIBXML="2.9.1" LIBJSON="UNKNOWN" TOPOLOGY RASTER
>
> postgres version
>
> PostgreSQL 9.4.8 on x86_64-unknown-linux-gnu, compiled by gcc (GCC)
> 4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit
>

HI,

Anything i can do to help debug this?

--
Jaime Casanova                      www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
_______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: segmentation fault in lwgeom_geos.c

Regina Obe
Didn't see a file attached to this.

-----Original Message-----
From: postgis-users [mailto:[hidden email]] On Behalf Of Jaime Casanova
Sent: Saturday, July 30, 2016 3:25 PM
To: [hidden email]
Subject: Re: [postgis-users] segmentation fault in lwgeom_geos.c

On 25 July 2016 at 18:24, Jaime Casanova <[hidden email]> wrote:

> Hi,
>
> We found a problem in this query:
>
> """
> SELECT DISTINCT vias_calle1, vias_calle2,
>         x(st_transform(centroid(the_geom),4326)) as longitud,
>         y(st_transform(centroid(the_geom),4326)) as latitud,
>         x(centroid(the_geom)) as x, y(centroid(the_geom)) as y
>   FROM (SELECT DISTINCT
>                     v1.via_nombre as vias_calle1,
>                     v2.via_nombre as vias_calle2,
>                     st_union(ST_Intersection(v1.the_geom,v2.the_geom))
> as the_geom
>                  FROM bage_via as v1, bage_via as v2
>               WHERE v1.via_nombre LIKE 'MAXIMILIANO RODRIGUEZ'
>                     AND v2.via_nombre LIKE 'LAURO GUERRERO'
>                     AND intersects(v1.the_geom,v2.the_geom)
>                     AND v1.dipo_codiinec LIKE '170121%'
>                     AND v2.dipo_codiinec LIKE '170121%'
>                GROUP BY v1.via_nombre, v2.via_nombre
> ) as foo
> """
>
> Attached a file with the backtrace, please let me know what else i can
> provide to help debug this? I have access to the server with the
> problem.
>
> PostGIS full version
>
> POSTGIS="2.1.8 r13780" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0,
> 6 March 2012" GDAL="GDAL 1.11.4, released 2016/0 1/25" LIBXML="2.9.1"
> LIBJSON="UNKNOWN" TOPOLOGY RASTER
>
> postgres version
>
> PostgreSQL 9.4.8 on x86_64-unknown-linux-gnu, compiled by gcc (GCC)
> 4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit
>

HI,

Anything i can do to help debug this?

--
Jaime Casanova                      www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services _______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users

_______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: segmentation fault in lwgeom_geos.c

Jaime Casanova-2
On 30 July 2016 at 23:39, Regina Obe <[hidden email]> wrote:
> Didn't see a file attached to this.
>

I see it here. https://lists.osgeo.org/pipermail/postgis-users/2016-July/041515.html

Anyway, i'm attaching it again

--
Jaime Casanova                      www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

_______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users

postgis_segmentation_fault.txt (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: segmentation fault in lwgeom_geos.c

Paul Ramsey
In reply to this post by Jaime Casanova-2
To debug, start cutting it down to size. First, it looks like you can probably reproduce it with just the sub-select 'foo'. So that's a smaller query that shows the issue. Probably from that query you can also drop the GROUP BY and get a crash, since the crash in the trace is happening in the intersects() function.

The where clause in the query includes a number of filters

v1.via_nombre LIKE 'MAXIMILIANO RODRIGUEZ'
                    AND v2.via_nombre LIKE 'LAURO GUERRERO'
                    AND intersects(v1.the_geom,v2.the_geom)
                    AND v1.dipo_codiinec LIKE '170121%'
                    AND v2.dipo_codiinec LIKE '170121%'

How many records are returned on that query when you use every filter *except* the intersects() one? Is it a small set of data? Can you share it? Until we can reproduce the problem, we cannot fix it, and it's caused by the particularity of your data/environment.  Cutting the crash down to the simplest SQL and smallest data set that reproduce is an excellent first step.

Thanks,

P


On Mon, Jul 25, 2016 at 4:24 PM, Jaime Casanova <[hidden email]> wrote:
Hi,

We found a problem in this query:

"""
SELECT DISTINCT vias_calle1, vias_calle2,
        x(st_transform(centroid(the_geom),4326)) as longitud,
        y(st_transform(centroid(the_geom),4326)) as latitud,
        x(centroid(the_geom)) as x, y(centroid(the_geom)) as y
  FROM (SELECT DISTINCT
                    v1.via_nombre as vias_calle1,
                    v2.via_nombre as vias_calle2,
                    st_union(ST_Intersection(v1.the_geom,v2.the_geom))
as the_geom
                 FROM bage_via as v1, bage_via as v2
              WHERE v1.via_nombre LIKE 'MAXIMILIANO RODRIGUEZ'
                    AND v2.via_nombre LIKE 'LAURO GUERRERO'
                    AND intersects(v1.the_geom,v2.the_geom)
                    AND v1.dipo_codiinec LIKE '170121%'
                    AND v2.dipo_codiinec LIKE '170121%'
               GROUP BY v1.via_nombre, v2.via_nombre
) as foo
"""

Attached a file with the backtrace, please let me know what else i can
provide to help debug this? I have access to the server with the
problem.

PostGIS full version

POSTGIS="2.1.8 r13780" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0,
6 March 2012" GDAL="GDAL 1.11.4, released 2016/0
1/25" LIBXML="2.9.1" LIBJSON="UNKNOWN" TOPOLOGY RASTER

postgres version

PostgreSQL 9.4.8 on x86_64-unknown-linux-gnu, compiled by gcc (GCC)
4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit

--
Jaime Casanova                      www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

_______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: segmentation fault in lwgeom_geos.c

Jaime Casanova-2
On 31 July 2016 at 15:17, Paul Ramsey <[hidden email]> wrote:
> To debug, start cutting it down to size. First, it looks like you can
> probably reproduce it with just the sub-select 'foo'. So that's a smaller
> query that shows the issue. Probably from that query you can also drop the
> GROUP BY and get a crash, since the crash in the trace is happening in the
> intersects() function.
>

Hi,

After i got a reduced set to reproduce the problem (it was a table
with just the two geom columns and 55 rows) i decided to reproduce the
problem in my own laptop

and found out that intersects function didn't exist in my clean
postgis installation but st_intersects, which made me suspect. after
some investigation it was clear what was the problem.

this system was developed originally in pg8.4 with postgis 1.2 and
then upgraded to pg9.2 with postgis 2.0, when that happens there was a
lot of not-ST_ functions in use so we just recreated them in 2.0 with
the definitions they had in 1.2. In this new upgrade i forgot to fix
the definitions to point to the postgis-2.1 library so they were
pointing to the postgis-2.0 one.

In short, it was my fault. sorry for the noise.

--
Jaime Casanova                      www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
_______________________________________________
postgis-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-users