Ticket #147 (closed task: worksforme)

Opened 4 years ago

Last modified 4 years ago

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) (diff)

What steps will reproduce the problem?

1. Update/Checkout? Revision 3986 of SVN trunk

2. Configure

./autogen.sh && ./configure

3. (Re)Build

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

4. 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

5. 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

Attachments

Change History

Changed 4 years ago by sandro.santilli

Which GEOS version are you using ?

Changed 4 years ago by mloskot

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).

Changed 4 years ago by mloskot

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.

Changed 4 years ago by sandro.santilli

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> >&amp;) (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&amp;, tut::test_group<tut::test_capigeospreparedgeometry_data, 50>::safe_holder<tut::test_object<tut::test_capigeospreparedgeometry_data> >&amp;) (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.

Changed 4 years ago by sandro.santilli

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

Changed 4 years ago by mloskot

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

Changed 4 years ago by robe

  • status changed from new to closed
  • resolution set to worksforme
  • description modified (diff)
  • milestone set to 1.4
Note: See TracTickets for help on using tickets.