Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Segfault on isValid #202

Open
thomersch opened this issue Jan 21, 2020 · 6 comments
Open

Segfault on isValid #202

thomersch opened this issue Jan 21, 2020 · 6 comments
Assignees
Labels

Comments

@thomersch
Copy link

I encountered a weird issue that seems only to come up on macOS, but also concerns calls from PostGIS.

When I execute

SELECT ST_StraightSkeleton(
	ST_Buffer(
		ST_GeomFromEWKT('SRID=3857;LINESTRING (1 1, 5 5)'), 1
	)
);

the database segfaults.

So I started to hunt down the problem and was able to reduce it to the following small C++ snippet:

#include <iostream>

#include <SFCGAL/Polygon.h>
#include <SFCGAL/algorithm/isValid.h>

int main(int argc, const char * argv[]) {
	SFCGAL::Polygon poly;
	poly.exteriorRing().addPoint(SFCGAL::Point(2, 1));
	poly.exteriorRing().addPoint(SFCGAL::Point(1, 0));
	poly.exteriorRing().addPoint(SFCGAL::Point(0, 1));
	poly.exteriorRing().addPoint(SFCGAL::Point(1.01, 2));
	poly.exteriorRing().addPoint(SFCGAL::Point(2, 1));
	
	std::cout << SFCGAL::algorithm::isValid(poly) << std::endl;
	return 0;
}

This runs fine on Linux, but not on macOS. Not sure where the issue originates, but I saw that in those cases libgmp receives some very suspicious data structures which contain null pointers.

sfcgal 1.3.7, cgal 4.14.1, gmp 6.2.0
@lbartoletti
Copy link
Contributor

It's fine too on FreeBSD

Confirmed on MacOs Catalina, sfcgal 1.3.7, cgal 4.14.1, gmp 6.1.2 with clang and gcc

The backtrace

Process 57688 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000100cd339f libgmp.10.dylib`mpq_cmp_numden + 112
libgmp.10.dylib`mpq_cmp_numden:
->  0x100cd339f <+112>: movq   -0x8(%rcx,%rsi,8), %r9
    0x100cd33a4 <+117>: movq   %r9, %rcx
    0x100cd33a7 <+120>: orq    %rsi, %rcx
    0x100cd33aa <+123>: xorl   %r8d, %r8d
Target 0: (a.out) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x0000000100cd339f libgmp.10.dylib`mpq_cmp_numden + 112
    frame #1: 0x0000000100272087 libSFCGAL.1.dylib`CGAL::CartesianKernelFunctors::Compare_xy_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >::operator()(CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > > const&, CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > > const&) const + 27
    frame #2: 0x0000000100271c76 libSFCGAL.1.dylib`bool CGAL::Intersections::internal::do_intersect<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >(CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >::Segment_2 const&, CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >::Segment_2 const&, CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > const&) + 54
    frame #3: 0x000000010028727a libSFCGAL.1.dylib`CGAL::Intersections::internal::Segment_2_Segment_2_pair<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >::intersection_type() const + 66
    frame #4: 0x0000000100287082 libSFCGAL.1.dylib`CGAL::Intersection_traits<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >, CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >::Segment_2, CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >::Segment_2>::result_type CGAL::Intersections::internal::intersection<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >(CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >::Segment_2 const&, CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >::Segment_2 const&, CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > const&) + 42
    frame #5: 0x000000010015b98b libSFCGAL.1.dylib`CGAL::Lazy_rep_2<boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> >, boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Segment_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> >, CGAL::CommonKernelFunctors::Intersect_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::CommonKernelFunctors::Intersect_2<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::Segment_2<CGAL::Epeck>, CGAL::Segment_2<CGAL::Epeck> >::update_exact() const + 117
    frame #6: 0x000000010015c593 libSFCGAL.1.dylib`CGAL::Lazy_rep_1<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::internal::Variant_cast<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > > >, CGAL::internal::Variant_cast<CGAL::Point_2<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::Lazy<boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> >, boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Segment_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> >, 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> > > > >::update_exact() const + 53
    frame #7: 0x000000010011f2d4 libSFCGAL.1.dylib`CGAL::Lazy_rep_1<CGAL::Interval_nt<false>, CGAL::Gmpq, CGAL::CartesianKernelFunctors::Compute_x_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::CartesianKernelFunctors::Compute_x_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::To_interval<CGAL::Gmpq>, CGAL::Point_2<CGAL::Epeck> >::update_exact() const + 48
    frame #8: 0x000000010025ac2e libSFCGAL.1.dylib`bool CGAL::operator==<CGAL::Gmpq, CGAL::Gmpq>(CGAL::Lazy_exact_nt<CGAL::Gmpq> const&, CGAL::Lazy_exact_nt<CGAL::Gmpq> const&) + 106
    frame #9: 0x000000010011d518 libSFCGAL.1.dylib`SFCGAL::Coordinate::operator==(SFCGAL::Coordinate const&) const + 344
    frame #10: 0x000000010026f631 libSFCGAL.1.dylib`bool SFCGAL::algorithm::selfIntersectsImpl<2>(SFCGAL::LineString const&) + 1171
    frame #11: 0x000000010028cf35 libSFCGAL.1.dylib`SFCGAL::algorithm::isValid(SFCGAL::Polygon const&, double const&) + 948
    frame #12: 0x000000010028c2f4 libSFCGAL.1.dylib`SFCGAL::algorithm::isValid(SFCGAL::Geometry const&, double const&) + 297
    frame #13: 0x0000000100000c74 a.out`main(argc=1, argv=0x00007ffeefbffa28) at test_sfcgal.cpp:14:15
    frame #14: 0x00007fff6effb7fd libdyld.dylib`start + 1
    frame #15: 0x00007fff6effb7fd libdyld.dylib`start + 1

@HorayNarea
Copy link

I can confirm the crash on OpenBSD with gmp 6.1.2, cgal 4.14.2 and sfcgal 1.3.7:

obsd# lldb -c a.out.core -f a.out                                                                                                                                                                                                            
(lldb) target create "a.out" --core "a.out.core"
Core file '/root/a.out.core' (x86_64) was loaded.
(lldb) bt
* thread #1, stop reason = signal SIGSEGV
  * frame #0: 0x00000906a17c5345 libgmp.so.10.0`mpq_cmp_numden + 101
    frame #1: 0x0000090665abdaea libSFCGAL.so.1`boost::multiprecision::backends::gmp_rational::compare(boost::multiprecision::backends::gmp_rational const&) const + 42
    frame #2: 0x0000090665abd9fe libSFCGAL.so.1`CGAL::RET_boost_mp_base<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >::Compare::operator()(boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> const&, boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> const&) const + 62
    frame #3: 0x0000090665ad386e libSFCGAL.so.1`CGAL::Real_embeddable_traits<CGAL::Coercion_traits<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> >::Type>::Compare::result_type CGAL::compare<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> >(boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> const&, boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> const&) + 46
    frame #4: 0x0000090665ad4352 libSFCGAL.so.1`CGAL::Compare<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >::result_type CGAL::compare_lexicographically_xyC2<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> const&, boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> const&, boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> const&, boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> const&) + 50
    frame #5: 0x0000090665ad4305 libSFCGAL.so.1`CGAL::CartesianKernelFunctors::Compare_xy_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >::operator()(CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > > const&, CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > > const&) const + 101
    frame #6: 0x0000090665bbfe29 libSFCGAL.so.1`bool CGAL::Intersections::internal::do_intersect<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >(CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >::Segment_2 const&, CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >::Segment_2 const&, CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > const&) + 2617
    frame #7: 0x0000090665bbe47e libSFCGAL.so.1`CGAL::Intersections::internal::Segment_2_Segment_2_pair<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >::intersection_type() const + 94
    frame #8: 0x0000090665bbe1af libSFCGAL.so.1`CGAL::Intersection_traits<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >, CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >::Segment_2, CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >::Segment_2>::result_type CGAL::Intersections::internal::intersection<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >(CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >::Segment_2 const&, CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >::Segment_2 const&, CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > const&) + 95
    frame #9: 0x0000090665baf449 libSFCGAL.so.1`CGAL::Intersection_traits<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >, CGAL::Segment_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Segment_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > > >::result_type CGAL::CommonKernelFunctors::Intersect_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >::operator()<CGAL::Segment_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Segment_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > > >(CGAL::Segment_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > > const&, CGAL::Segment_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > > const&) const + 57
    frame #10: 0x0000090665baf86f libSFCGAL.so.1`CGAL::Lazy_rep_2<boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > > > >, boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Segment_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > > > >, CGAL::CommonKernelFunctors::Intersect_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::CommonKernelFunctors::Intersect_2<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::Segment_2<CGAL::Epeck>, CGAL::Segment_2<CGAL::Epeck> >::update_exact() const + 191
    frame #11: 0x0000090665bb8eef libSFCGAL.so.1`CGAL::Lazy_rep<boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > > > >, boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Segment_2<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() + 63
    frame #12: 0x0000090665bb8e87 libSFCGAL.so.1`CGAL::Lazy<boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > > > >, boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Segment_2<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() const + 39
    frame #13: 0x0000090665bb83af libSFCGAL.so.1`boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Segment_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > > > > const& CGAL::exact<boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > > > >, boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Segment_2<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> > > >(CGAL::Lazy<boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > > > >, boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Segment_2<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> > > > const&) + 31
    frame #14: 0x0000090665bb7701 libSFCGAL.so.1`CGAL::Lazy_rep_1<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::internal::Variant_cast<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > > >, CGAL::internal::Variant_cast<CGAL::Point_2<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::Lazy<boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > > > >, boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Segment_2<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> > > > >::update_exact() const + 97
    frame #15: 0x00000906659e9bcf libSFCGAL.so.1`CGAL::Lazy_rep<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >, CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > >::exact() + 63
    frame #16: 0x00000906659e9b67 libSFCGAL.so.1`CGAL::Lazy<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::Gmpq, CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >, CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > >::exact() const + 39
    frame #17: 0x00000906659e8f8f libSFCGAL.so.1`CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Gmpq> > const& CGAL::exact<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::Gmpq, CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >, CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > >(CGAL::Lazy<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::Gmpq, CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>, CGAL::Simple_cartesian<CGAL::Interval_nt<false> >, CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > > const&) + 31
    frame #18: 0x00000906659e92c1 libSFCGAL.so.1`CGAL::Lazy_rep_1<CGAL::Interval_nt<false>, CGAL::Gmpq, CGAL::CartesianKernelFunctors::Compute_x_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::CartesianKernelFunctors::Compute_x_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::To_interval<CGAL::Gmpq>, CGAL::Point_2<CGAL::Epeck> >::update_exact() const + 97
    frame #19: 0x00000906659dbc3f libSFCGAL.so.1`CGAL::Lazy_rep<CGAL::Interval_nt<false>, CGAL::Gmpq, CGAL::To_interval<CGAL::Gmpq> >::exact() + 63
    frame #20: 0x00000906659dbbd7 libSFCGAL.so.1`CGAL::Lazy<CGAL::Interval_nt<false>, CGAL::Gmpq, CGAL::Lazy_exact_nt<CGAL::Gmpq>, CGAL::To_interval<CGAL::Gmpq> >::exact() const + 39
    frame #21: 0x00000906659d3b98 libSFCGAL.so.1`bool CGAL::operator==<CGAL::Gmpq, CGAL::Gmpq>(CGAL::Lazy_exact_nt<CGAL::Gmpq> const&, CGAL::Lazy_exact_nt<CGAL::Gmpq> const&) + 184
    frame #22: 0x00000906659d2621 libSFCGAL.so.1`SFCGAL::Coordinate::operator==(SFCGAL::Coordinate const&) const + 897
    frame #23: 0x0000090665a1d6ad libSFCGAL.so.1`SFCGAL::Point::operator==(SFCGAL::Point const&) const + 61
    frame #24: 0x00000906660082a7 libSFCGAL.so.1`bool SFCGAL::algorithm::selfIntersectsImpl<2>(SFCGAL::LineString const&) + 2103
    frame #25: 0x0000090666006bff libSFCGAL.so.1`SFCGAL::algorithm::selfIntersects(SFCGAL::LineString const&) + 31
    frame #26: 0x0000090666020985 libSFCGAL.so.1`SFCGAL::algorithm::isValid(SFCGAL::Polygon const&, double const&) + 853
    frame #27: 0x000009066601fe18 libSFCGAL.so.1`SFCGAL::algorithm::isValid(SFCGAL::Geometry const&, double const&) + 472
    frame #28: 0x00000903b13746b7 a.out`main(argc=1, argv=0x00007f7ffffcc7e8) at crash.cpp:14:15
    frame #29: 0x00000903b137413b a.out`___start + 283

@HorayNarea
Copy link

I can also confirm the crash on Windows 10 with cgal 4.14.2, sfcgal 1.3.7 and gmp 6.1.2 cross-compiled with mingw-w64

Backtrace when run under cygwin (until I figure out how I use gdb/lldb native):

#0  0x000000006ad096d0 in libgmp-10!.gmpn_copyi () from /cygdrive/c/Users/User/Desktop/libgmp-10.dll
#1  0x000000006d56d57b in boost::array<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1>, 2ull>::array(boost::array<boost:
:multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1>, 2ull> const&) () from /cygdrive/c/Users/User/Desktop/libSFCGAL.dll
#2  0x000000006d5dc567 in CGAL::Lazy_rep_3<CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision:
:backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::CommonKernelFunctors::Construct_segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::CommonKernel
Functors::Construct_segment_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Cartesia
n_converter<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >, CGAL::Simple_cartesian<CGAL::Inter
val_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_2<CGAL::Epeck>, CGAL::Point_2<CGAL::Epeck> >::update_exact() const () from /cygdrive/c/Users/User/Desktop/libSFCGAL.dll
#3  0x000000006d5c67c1 in CGAL::Lazy_rep_2<boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false
> > >, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::det
ail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::voi
d_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> >, boost::optional<boost::variant<CGAL::Poin
t_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Segment_2<CGAL::Simple_cartesian<b
oost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, boost::detail::variant::void_, boost::detail::variant::void_, boost:
:detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant:
:void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::de
tail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> >, CGAL::CommonKernelFunctors::Intersect_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::CommonKernelFunct
ors::Intersect_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Cartesian_converter<C
GAL::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::Segment_2<CG
AL::Epeck>, CGAL::Segment_2<CGAL::Epeck> >::update_exact() const () from /cygdrive/c/Users/User/Desktop/libSFCGAL.dll
#4  0x000000006d5bfb9a in CGAL::Lazy_rep_1<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::bac
kends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::internal::Variant_cast<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > > >, CGAL::internal::Variant_c
ast<CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > > >, CGAL::Cartesian_converte
r<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> >, CGAL::Simple_cartesian<CGAL::Interval_nt<fal
se> >, CGAL::NT_converter<boost::multiprecision::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1>, CGAL::Interval_nt<false> > >, CGAL::Lazy<boos
t::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::Segment_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, boost::detail::variant::void_, boost::de
tail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::vo
id_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detai
l::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> >, boost::optional<boost::variant<CGAL::Point_2<CGAL::Simple_cartesian<boost::multiprecisio
n::number<boost::multiprecision::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, CGAL::Segment_2<CGAL::Simple_cartesian<boost::multiprecision::number<boost::multiprecis
ion::backends::gmp_rational, (boost::multiprecision::expression_template_option)1> > >, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant
::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::d
etail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::v
oid_, boost::detail::variant::void_> >, 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> > > > >::update_exact() con
st () from /cygdrive/c/Users/User/Desktop/libSFCGAL.dll
#5  0x000000006d5bb779 in CGAL::Lazy_rep_1<CGAL::Interval_nt<false>, CGAL::Gmpq, CGAL::CartesianKernelFunctors::Compute_x_2<CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >, CGAL::CartesianKernelFunct
ors::Compute_x_2<CGAL::Simple_cartesian<CGAL::Gmpq> >, CGAL::To_interval<CGAL::Gmpq>, CGAL::Point_2<CGAL::Epeck> >::update_exact() const () from /cygdrive/c/Users/User/Desktop/libSFCGAL.dll
#6  0x000000006d546659 in bool CGAL::operator==<CGAL::Gmpq, CGAL::Gmpq>(CGAL::Lazy_exact_nt<CGAL::Gmpq> const&, CGAL::Lazy_exact_nt<CGAL::Gmpq> const&) ()
   from /cygdrive/c/Users/User/Desktop/libSFCGAL.dll
#7  0x000000006d2421b9 in SFCGAL::Coordinate::operator==(SFCGAL::Coordinate const&) const () from /cygdrive/c/Users/User/Desktop/libSFCGAL.dll
#8  0x000000006d5a7c3f in bool SFCGAL::algorithm::selfIntersectsImpl<2>(SFCGAL::LineString const&) () from /cygdrive/c/Users/User/Desktop/libSFCGAL.dll
#9  0x000000006d29797d in SFCGAL::algorithm::isValid(SFCGAL::Polygon const&, double const&) () from /cygdrive/c/Users/User/Desktop/libSFCGAL.dll
#10 0x000000006d29a739 in SFCGAL::algorithm::isValid(SFCGAL::Geometry const&, double const&) () from /cygdrive/c/Users/User/Desktop/libSFCGAL.dll
#11 0x00000000004017e0 in main ()

@danielcu888
Copy link
Contributor

danielcu888 commented Apr 11, 2020

The specified snippet application runs fine:

$ cat main.cpp
#include <iostream>

#include <SFCGAL/Polygon.h>
#include <SFCGAL/algorithm/isValid.h>

int main()
{
  SFCGAL::Polygon poly;
  poly.exteriorRing().addPoint(SFCGAL::Point(2, 1));
  poly.exteriorRing().addPoint(SFCGAL::Point(1, 0));
  poly.exteriorRing().addPoint(SFCGAL::Point(0, 1));
  poly.exteriorRing().addPoint(SFCGAL::Point(1.01, 2));
  poly.exteriorRing().addPoint(SFCGAL::Point(2, 1));
  
  std::cout << SFCGAL::algorithm::isValid(poly) << std::endl;

  return 0;
}
$ g++ -o main  main.cpp --std=c++11 -lSFCGAL -lCGAL
$ ./main
1

when using the following environment:

Operating system: Mac OS X 64bit
Compiler: Apple LLVM version 8.0.0 (clang-800.0.42.1)
Build type: Release
Specific flags: --std=c++11
SFCGAL Commit: 787e2b7
CGAL Version: CGAL-4.12
Boost Version: 1.72.0
GMP Version: 6.1.2
MPFR Version: 4.0.2

@lbartoletti lbartoletti self-assigned this May 29, 2020
@james-newtracs
Copy link

Hi, we're experiencing this issue also. Does anyone have a workaround until its resolved? How can we fall back to a previous version of SFGCAL? Running latest versions of Postgres & Postgis via homebrew.

@james-newtracs
Copy link

I encountered a weird issue that seems only to come up on macOS, but also concerns calls from PostGIS.

When I execute

SELECT ST_StraightSkeleton(
	ST_Buffer(
		ST_GeomFromEWKT('SRID=3857;LINESTRING (1 1, 5 5)'), 1
	)
);

the database segfaults.

So I started to hunt down the problem and was able to reduce it to the following small C++ snippet:

#include <iostream>

#include <SFCGAL/Polygon.h>
#include <SFCGAL/algorithm/isValid.h>

int main(int argc, const char * argv[]) {
	SFCGAL::Polygon poly;
	poly.exteriorRing().addPoint(SFCGAL::Point(2, 1));
	poly.exteriorRing().addPoint(SFCGAL::Point(1, 0));
	poly.exteriorRing().addPoint(SFCGAL::Point(0, 1));
	poly.exteriorRing().addPoint(SFCGAL::Point(1.01, 2));
	poly.exteriorRing().addPoint(SFCGAL::Point(2, 1));
	
	std::cout << SFCGAL::algorithm::isValid(poly) << std::endl;
	return 0;
}

This runs fine on Linux, but not on macOS. Not sure where the issue originates, but I saw that in those cases libgmp receives some very suspicious data structures which contain null pointers.

sfcgal 1.3.7, cgal 4.14.1, gmp 6.2.0

@thomersch were you able to find a solution to this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants