Opened 16 years ago

Closed 16 years ago

#147 closed task (worksforme)

regress_ogc_prep fails with PostgreSQL crash

Reported by: mloskot Owned by:
Priority: medium Milestone: PostGIS 1.4.0
Component: postgis Version:
Keywords: Cc:

Description (last modified by robe)

What steps will reproduce the problem?

  1. Update/Checkout Revision 3986 of SVN trunk
  1. Configure

./autogen.sh && ./configure

  1. (Re)Build

make clean && make && sudo make install && make check

  1. Check tests result

regress_ogc_cover. ok regress_ogc_prep. failed (diff expected obtained:

/tmp/pgis_reg_32763/test_42_diff)

Run tests: 42 Failed: 1

  1. There are many diff lines in file /tmp/pgis_reg_32763/test_42_diff

and at the end there is message indicating that PostgreSQL crashed:

! server closed the connection unexpectedly ! This probably means the server terminated abnormally ! before or while processing the request. ! connection to server was lost

Operating system information: Tests run under Linux (Ubuntu 8.10) on 32-bit and 64-bit machines.

Two files attached with test_42_diff output: 32bit-trunk-r3986- regress_ogc_prep-fail-diff.txt 64bit-trunk-r3986- regress_ogc_prep-fail-diff.txt

Change History (10)

comment:1 by sandro.santilli, 16 years ago

Which GEOS version are you using ?

comment:2 by mloskot, 16 years ago

I'm sorry, I've forgot to add this very important detail. I use SVN trunk:

mloskot@vb-ubuntu810-i386:~/dev/geos/_svn/trunk$ svn info | grep Revision Revision: 2319

The last revision submitted yesterday (04/07/09).

comment:3 by mloskot, 16 years ago

FYI, I've re-run the tests using today updates of PostGIS and GEOS:

mloskot@vb-ubuntu810-i386:~/dev/geos/_svn/trunk$ svn info | grep Revision Revision: 2321

mloskot@vb-ubuntu810-i386:~/dev/postgis/_svn/trunk$ svn info | grep Revision Revision: 3986

The test still fails and server terminates connection and gets lost.

comment:4 by sandro.santilli, 16 years ago

I've transferred the test to the unit testing of GEOS for capi and here's what I get: ==3513== Invalid read of size 8 ==3513== at 0x4ECDDFD: geos::geom::prep::PreparedPolygonContainsProperly::containsProperly(geos::geom::Geometry const*) (PreparedPolygonContainsProperly.cpp:58) ==3513== by 0x4ECE0EE: geos::geom::prep::PreparedPolygon::containsProperly(geos::geom::Geometry const*) const (PreparedPolygonContainsProperly.h:73) ==3513== by 0x518D95B: GEOSPreparedContainsProperly_r (geos_ts_c.cpp:3799) ==3513== by 0x50165B: void tut::test_object<tut::test_capigeospreparedgeometry_data>::test<2>() (GEOSPreparedGeometryTest.cpp:108) ==3513== by 0x504147: tut::test_group<tut::test_capigeospreparedgeometry_data, 50>::run_test_seh_(void (tut::test_object<tut::test_capigeospreparedgeometry_data>::*)(), tut::test_group<tut::test_capigeospreparedgeometry_data, 50>::safe_holder<tut::test_object<tut::test_capigeospreparedgeometry_data> >&) (tut.h:973) ==3513== by 0x504430: tut::test_group<tut::test_capigeospreparedgeometry_data, 50>::run_test_(std::_Rb_tree_iterator<std::pair<int const, void (tut::test_object<tut::test_capigeospreparedgeometry_data>::*)()> > const&, tut::test_group<tut::test_capigeospreparedgeometry_data, 50>::safe_holder<tut::test_object<tut::test_capigeospreparedgeometry_data> >&) (tut.h:899) ==3513== by 0x504F18: tut::test_group<tut::test_capigeospreparedgeometry_data, 50>::run_next() (tut.h:862) ==3513== by 0x40C1D6: tut::test_runner::run_all_tests_in_group_(std::_Rb_tree_const_iterator<std::pair<std::string const, tut::group_base*> >) const (tut.h:452) ==3513== by 0x40BACE: main (tut.h:398) ==3513== Address 0x5efda80 is 0 bytes inside a block of size 136 free'd ==3513== at 0x4C2514D: operator delete(void*) (vg_replace_malloc.c:342) ==3513== by 0x4ECDDF3: geos::geom::prep::PreparedPolygonContainsProperly::containsProperly(geos::geom::Geometry const*) (PreparedPolygonContainsProperly.cpp:57) ==3513== by 0x4ECE0EE: geos::geom::prep::PreparedPolygon::containsProperly(geos::geom::Geometry const*) const (PreparedPolygonContainsProperly.h:73) ==3513== by 0x518D95B: GEOSPreparedContainsProperly_r (geos_ts_c.cpp:3799)

I attach the tester, if anyone feels like trying with an older snapshot. I don't think I touched anything related, so my bet is this is a memory error which results in random bugs.

comment:5 by sandro.santilli, 16 years ago

PreparedPolygonContainsProperly was calling a method on an object right after deleting it. Should be fixed as of revision 2323.

comment:6 by mloskot, 16 years ago

I confirm the bug has been fixed on both architectures, Intel 32-bit and 64-bit:

mloskot@vb-ubuntu810-i386:~/dev/postgis/_svn/trunk$ svn info | grep Revision Revision: 3986

mloskot@vb-ubuntu810-x64:~/dev/postgis/_svn/trunk$ svn info | grep Revision Revision: 3986

comment:7 by robe, 16 years ago

Description: modified (diff)
Milestone: 1.4
Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.