Skip to content

Deadlock in itk::VoronoiDiagram2DGenerator<double>::ConstructDiagram() #4386

@ILoveGoulash

Description

@ILoveGoulash

Description

This simple example with these specific values deadlocks.

Steps to Reproduce

#include <itkVoronoiDiagram2DGenerator.h>

int main()
{
    using VoronoiDiagramType         = itk::VoronoiDiagram2D<double>;
    using VoronoiGeneratorType       = itk::VoronoiDiagram2DGenerator<double>;
    using PointType                  = VoronoiDiagramType::PointType;
    VoronoiGeneratorType::Pointer vg = VoronoiGeneratorType::New();
    vg->SetOrigin(PointType {{-1.61569, -1.76726}});
    vg->SetBoundary(PointType {{1.60174, 1.76345}});
    vg->AddOneSeed(PointType {{-1.39649, 0.322212}});
    vg->AddOneSeed(PointType {{-1.30128, 0.231786}});
    vg->AddOneSeed(PointType {{-1.21509, 0.0515039}});
    vg->AddOneSeed(PointType {{-1.22364, -0.030281}});
    vg->AddOneSeed(PointType {{-1.22125, -0.120815}});
    vg->AddOneSeed(PointType {{-1.25159, -0.23593}});
    vg->Update();
}

Expected behavior

No deadlock.

Actual behavior

Deadlock.

Reproducibility

Every time.

Versions

ITK 5.1.2; reproducing on a recent version would be possible but very painful, as I'm in a restricted work environment.

Environment

Tested on MacOS Ventura (Apple clang 15) and Windows 11 (MSVC 2019).

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:BugInconsistencies or issues which will cause an incorrect result under some or all circumstances

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions