Skip to content

Segmentation fault in GraphSymmetryFinder destructor #3954

@andre-tebart

Description

@andre-tebart

What version of OR-Tools and what language are you using?
Version: v9.7
Language: C++

Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
GraphSymmetryFinder

What operating system (Linux, Windows, ...) and version?
Ubuntu 22.04

What did you do?
Steps to reproduce the behavior:

#include <doctest/doctest.h>
#include <ortools/algorithms/sparse_permutation.h>
#include <ortools/algorithms/find_graph_symmetries.h>
#include <ortools/graph/graph.h>

TEST_SUITE("or-tools symmetry finder") {
    TEST_CASE("finds symmetries") {
        auto graph = operations_research::GraphSymmetryFinder::Graph{};
        graph.Build();

        auto symmetryFinder = operations_research::GraphSymmetryFinder(graph, true);
    }
}

I run this code snippet via doctest.

What did you expect to see
I expect this to just run through.

What did you see instead?
The program crashes with a segmentation violation signal. This is the stack trace I get:

std::_Rb_tree_increment(std::_Rb_tree_node_base*) 0x00007fffefa6a1d4
operations_research::StatsGroup::~StatsGroup() 0x00007ffff0ad87e9
operations_research::GraphSymmetryFinder::Stats::~Stats find_graph_symmetries.h:249
operations_research::GraphSymmetryFinder::~GraphSymmetryFinder find_graph_symmetries.h:45
DOCTEST_ANON_SUITE_14::DOCTEST_ANON_FUNC_15 graph_symmetry.test.cpp:12
doctest::Context::run doctest.h:7007
main test_main.cpp:8
<unknown> 0x00007fffef79bd90
__libc_start_main 0x00007fffef79be40
_start 0x0000555555555145

Anything else we should know about your project / environment
We also use CP-SAT in our project and don't have any issues there.

Metadata

Metadata

Assignees

Labels

Help NeededModeling/Usage problemLang: C++Native implementation issueSolver: Graph and AlgorithmSolvers in the graph/ and algorithms/ directories

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions