[postgis-tickets] [PostGIS] #4157: ST_3DIntersection segfaults on some geometries

PostGIS trac at osgeo.org
Mon Aug 26 08:04:23 PDT 2019


#4157: ST_3DIntersection segfaults on some geometries
-----------------------+----------------------------
  Reporter:  tilt      |      Owner:  hmercier
      Type:  defect    |     Status:  reopened
  Priority:  critical  |  Milestone:  PostGIS SFCGAL
 Component:  sfcgal    |    Version:  trunk
Resolution:            |   Keywords:
-----------------------+----------------------------
Changes (by Algunenano):

 * priority:  medium => critical
 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Tested with current trunk and sfcgal master and it's still crashing

 {{{
 Select postgis_full_version();
 postgis_full_version

 --------------------------------------------------------------------------------------------------------------------
 ---------------------------------------------------------------------------
  POSTGIS="3.0.0alpha5dev r17774" [EXTENSION] PGSQL="120" GEOS="3.8.0dev-
 CAPI-1.11.0 " SFCGAL="1.3.7" PROJ="6.1.0" LI
 BXML="2.9.9" LIBJSON="0.13.1" LIBPROTOBUF="1.3.1" WAGYU="0.4.3 (Internal)"
 (1 row)
 }}}

 Coredump trace:
 {{{
 (gdb) bt
 #0  __gmpn_copyi_core2 () at tmp-core2_copyi.s:136
 #1  0x00007fc86389c9a6 in
 boost::multiprecision::backends::gmp_rational::gmp_rational (o=...,
 this=0x7fff2023a8a0) at /usr/include/boost/multiprecision/gmp.hpp:1844
 #2
 boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1>::number (e=...,
 this=0x7fff2023a8a0) at /usr/include/boost/multiprecision/number.hpp:52
 #3
 boost::array<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1>, 3ul>::array
 (this=0x7fff2023a8a0) at /usr/include/boost/array.hpp:61
 #4  0x00007fc86389d71c in
 CGAL::VectorC3<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> > >::VectorC3
 (this=0x7fff2023a8a0)
     at /usr/include/CGAL/Cartesian/Vector_3.h:36
 #5
 CGAL::Vector_3<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> > >::Vector_3
 (this=0x7fff2023a8a0)
     at /usr/include/CGAL/Vector_3.h:43
 #6
 CGAL::PointC3<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> > >::PointC3
 (this=0x7fff2023a8a0)
     at /usr/include/CGAL/Cartesian/Point_3.h:34
 #7
 CGAL::Point_3<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> > >::Point_3
 (this=0x7fff2023a8a0)
     at /usr/include/CGAL/Point_3.h:40
 #8
 CGAL::make_array<CGAL::Point_3<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> > > > (b2=...,
 b1=...)
     at /usr/include/CGAL/array.h:113
 #9
 CGAL::SegmentC3<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> > >::SegmentC3
 (ep=..., sp=..., this=0x7fff2023a8a0)
     at /usr/include/CGAL/Cartesian/Segment_3.h:54
 #10
 CGAL::CommonKernelFunctors::Construct_segment_3<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> > >::operator() (
     this=0x5611bb8c7520, q=..., p=...) at
 /usr/include/CGAL/Kernel/function_objects.h:2254
 #11
 CGAL::Lazy_rep_3<CGAL::Segment_3<CGAL::Simple_cartesian<CGAL::Interval_nt<false>
 > >,
 CGAL::Segment_3<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> > >,
 CGAL::CommonKernelFunctors::Construct_segment_3<CGAL::Simple_cartesian<CGAL::Interval_nt<false>
 > >,
 CGAL::CommonKernelFunctors::Construct_segment_3<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> > >,
 CGAL::Cartesian_converter<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> >,
 CGAL::Simple_cartesian<CGAL::Interval_nt<false> >,
 CGAL::NT_converter<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1>,
 CGAL::Interval_nt<false> > >, CGAL::Return_base_tag,
 CGAL::Point_3<CGAL::Epeck>, CGAL::Point_3<CGAL::Epeck> >::update_exact
 (this=0x5611bb8c7520) at /usr/include/CGAL/Lazy.h:455
 #12 0x00007fc86392c9ca in
 CGAL::Lazy_rep<CGAL::Segment_3<CGAL::Simple_cartesian<CGAL::Interval_nt<false>
 > >,
 CGAL::Segment_3<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> > >,
 CGAL::Cartesian_converter<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> >,
 CGAL::Simple_cartesian<CGAL::Interval_nt<false> >,
 CGAL::NT_converter<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1>,
 CGAL::Interval_nt<false> > > >::exact (
     this=0x5611bb8c7520) at /usr/include/CGAL/Lazy.h:273
 #13
 CGAL::Lazy<CGAL::Segment_3<CGAL::Simple_cartesian<CGAL::Interval_nt<false>
 > >,
 CGAL::Segment_3<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> > >,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1>,
 CGAL::Cartesian_converter<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> >,
 CGAL::Simple_cartesian<CGAL::Interval_nt<false> >,
 CGAL::NT_converter<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1>,
 CGAL::Interval_nt<false> > > >::exact (this=0x7fff2023aa20) at
 /usr/include/CGAL/Lazy.h:792
 #14
 CGAL::exact<CGAL::Segment_3<CGAL::Simple_cartesian<CGAL::Interval_nt<false>
 > >,
 CGAL::Segment_3<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> > >,
 boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1>,
 CGAL::Cartesian_converter<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> >,
 CGAL::Simple_cartesian<CGAL::Interval_nt<false> >,
 CGAL::NT_converter<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1>,
 CGAL::Interval_nt<false> > > > (l=...) at /usr/include/CGAL/Lazy.h:92
 #15 CGAL::Lazy_construction_variant<CGAL::Epeck,
 CGAL::CommonKernelFunctors::Intersect_3<CGAL::Simple_cartesian<CGAL::Interval_nt<false>
 > >,
 CGAL::CommonKernelFunctors::Intersect_3<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational,
 (boost::multiprecision::expression_template_option)1> > >
 >::operator()<CGAL::Segment_3<CGAL::Epeck>, CGAL::Segment_3<CGAL::Epeck> >
 (this=this at entry=0x7fff2023abb8, l1=..., l2=...)
     at /usr/include/CGAL/Lazy.h:1593
 #16 0x00007fc863a817d6 in CGAL::intersection<CGAL::Epeck> (b=..., a=...)
 at /usr/include/CGAL/Intersections_3/Segment_3_Segment_3.h:31
 #17 SFCGAL::algorithm::selfIntersectsImpl<3> (line=...) at /tmp/yaourt-
 tmp-raul/aur-sfcgal-git/src/sfcgal/src/algorithm/intersects.cpp:473
 #18 0x00007fc863a70296 in SFCGAL::algorithm::selfIntersects3D (l=...) at
 /tmp/yaourt-tmp-raul/aur-sfcgal-
 git/src/sfcgal/src/algorithm/intersects.cpp:507
 #19 0x00007fc863a82d8a in SFCGAL::algorithm::isValid (p=...,
 toleranceAbs=@0x7fff2023b230: 1.0000000000000001e-09) at
 /usr/include/c++/9.1.0/bits/stl_vector.h:1058
 #20 0x00007fc863a85a0e in SFCGAL::algorithm::isValid (g=...,
 toleranceAbs=@0x7fff2023b230: 1.0000000000000001e-09) at /tmp/yaourt-tmp-
 raul/aur-sfcgal-git/src/sfcgal/src/algorithm/isValid.cpp:525
 #21 0x00007fc863a85be5 in SFCGAL::SFCGAL_ASSERT_GEOMETRY_VALIDITY_ (g=...,
 ctxt="") at /tmp/yaourt-tmp-raul/aur-sfcgal-
 git/src/sfcgal/src/algorithm/isValid.cpp:63
 #22 0x00007fc863a85c58 in SFCGAL::SFCGAL_ASSERT_GEOMETRY_VALIDITY (g=...)
 at /usr/include/c++/9.1.0/bits/char_traits.h:300
 #23 0x00007fc863a85f09 in SFCGAL::SFCGAL_ASSERT_GEOMETRY_VALIDITY_3D
 (g=...) at /tmp/yaourt-tmp-raul/aur-sfcgal-
 git/src/sfcgal/src/algorithm/isValid.cpp:108
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4157#comment:8>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list