Skip to content

Crash upon duplicate constraint name #4764

@oliviercailloux

Description

@oliviercailloux

What version of OR-Tools and what language are you using?
Version: 9.14.6206
Language: Java

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

What operating system (Linux, Windows, ...) and version?
Debian stable

What did you do?

MPSolver solver = new MPSolver("Dupl", OptimizationProblemType.CBC_MIXED_INTEGER_PROGRAMMING);
MPVariable x = solver.makeBoolVar("x");
MPVariable y = solver.makeBoolVar("y");
solver.makeConstraint(0d, 0d, "C1").setCoefficient(x, 1);
solver.makeConstraint(0d, 0d, "C1").setCoefficient(y, 1);
solver.solve();

What did you expect to see
No crash

What did you see instead?
prints this, then crashes (exits JVM)

WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
F0000 00:00:1756837543.658813   94817 map_util.h:171] Check failed: collection->insert(value_type(key, data)).second duplicate key: C1
*** Check failure stack trace: ***

Anything else we should know about your project / environment
Please also try to make it so that the JVM does not exit when encoutering such problem. Just failing to solve and throwing an exception with the problem would be nice.

Metadata

Metadata

Assignees

Labels

Lang: JavaJava wrapper issueSolver: CBC/CLPIssue specific to Coin-OR CBC/CLP

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions