Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault on insert_segments of Segment Delaunay Graph using exact constructions kernel #7972

Closed
Yvee1 opened this issue Jan 10, 2024 · 4 comments · Fixed by #7975
Closed

Comments

@Yvee1
Copy link

Yvee1 commented Jan 10, 2024

Issue Details

Running the insert_segments function of Segment_Delaunay_graph_2 with the Exact_predicates_exact_constructions_kernel gives a segmentation fault.

The error occurs regardless of which segments are inserted. Inserting segments separately with insert after construct_site_2 works fine. When using the Exact_predicates_inexact_constructions_kernel, function insert_segments does work as expected.

Source Code

typedef CGAL::Exact_predicates_exact_constructions_kernel K;
typedef CGAL::Segment_Delaunay_graph_traits_2<K>          Gt;
typedef CGAL::Segment_Delaunay_graph_2<Gt>                SDG2;

int main() {
    auto segments = std::vector({
        CGAL::Segment_2<K>(
            CGAL::Point_2<K>(0.0, 0.0),
            CGAL::Point_2<K>(1.0, 0.0))
    });

    SDG2 delaunay;
    delaunay.insert_segments(segments.begin(), segments.end());

    return 0;
}

Environment

  • Operating system (Windows/Mac/Linux, 32/64 bits): WSL2 on Windows 11, 64 bits
  • Compiler: g++
  • Release or debug mode: both give a segmentation fault
  • CGAL version: 5.4-1
  • Boost version: 1.74.0
@afabri
Copy link
Member

afabri commented Jan 11, 2024

I found the problem and fix, but note that ifor performance reasons it is not really a good idea to use the kernel which does exact constructions.

@Yvee1
Copy link
Author

Yvee1 commented Jan 11, 2024

Thanks for looking into the issue! I used inexact constructions before, but I got an assertion error for some inputs, I think because of collinear points. Is there another way of resolving this aside from turning to exact constructions?

@afabri
Copy link
Member

afabri commented Jan 11, 2024

Would be great if you shared data for which you got an assertion, as well your typedefs, so that we can try to reproduce/fix.

@Yvee1
Copy link
Author

Yvee1 commented Jan 11, 2024

I had some trouble with extracting a minimal example, but I have one now and have opened a new issue (#7978)

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

Successfully merging a pull request may close this issue.

4 participants