Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1042 closed defect (duplicate)

Segfault on multipolygon

Reported by: stefgis Owned by: geos-devel@…
Priority: minor Milestone:
Component: Default Version: 3.8.0
Severity: Unassigned Keywords:
Cc:

Description

A customer of us triggered a segfault (through postgis):

kernel: [3756240.108588] postgres[17471]: segfault at 0 ip 00007fc6a56acce7 sp 00007fffffca5090 error 4 in libgeos-3.8.0.so[7fc6a5605000+1be000]

After some debugging this seems related to the way some of their polygons are saved in a specific table:

GEOMETRYCOLLECTION(MULTIPOLYGON(((224480.183 573551.3,224490.982 573554.021,224493.322 573554.693,224492.601 573557.214,224487.439 573555.74,224486.357 573559.53,224478.47 573557.287,224480.183 573551.3))))

In combination with st_intersecs or st_buffer this leads to a segfault. We can reproduce the issue with the following query:

SELECT link AS id FROM ybak."test_bit_libgeos" WHERE ST_dimension(m1g1) IN (2) AND st_isvalid(m1g1)=true AND ST_Intersects(ST_Buffer(ST_GeomFromText('POINT(224707.42286981 573643.1066404)'), 2), m1g1) ORDER BY ST_Intersects(ST_Geomfromtext('POINT(224707.42286981 573643.1066404)'), m1g1) DESC LIMIT 1;

Change History (6)

comment:1 by stefgis, 4 years ago

The wkb of the geometry is:

\001\007\000\000\000\001\000\000\000\001\006\000\000\000\001\000\000\000\001\003\000\000\000\001\000\000\000\010\000\000\000Zd;\337Bo\013A\252\361\322\215\232\201!A\000\000\000\000Do\013AD\213l\347\246\201!A;\337O\215\002o\013Ash\221\355\247\201!A\016-\262\235\327n\013A\333\371~*\250\201!A\356|?5\327n\013A\035Zd;\243\201!A\033/\335$\002o\013A\006\201\225\003\243\201!AR\270\036\205\001o\013Ao\022\203\200\233\201!AZd;\337Bo\013A\252\361\322\215\232\201!A

comment:3 by stefgis, 4 years ago

Yes, looks like it.

comment:4 by strk, 4 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #1047

comment:5 by mdavis, 4 years ago

This ticket has a more realistic test case than the other one. Although I can't get it to reproduce.

Last edited 4 years ago by mdavis (previous) (diff)

comment:6 by mdavis, 4 years ago

Here's a simple reproducer:

select st_intersects(
    'LINESTRING (0 0, 1 0)', 
    'GEOMETRYCOLLECTION (MULTIPOLYGON (((922337 -922337, 922337 922337, -922337 922337, -922337 922337, 922337 -922337))))');
Note: See TracTickets for help on using tickets.