Skip to content

Segmentation fault when solving a (quadratic convex) nonlinear problem in a memory-limited Docker #1234

Description

@Rastaban-TzW

Describe the bug
When solving a nonlinear optimization problem in a Docker, with memory limits dictated by e.g. -m 4g, the default SCIP build sometimes (50%+) crashes with a segfault, or a bad free(). Furthermore, this "core dump" means that the entire process dies, and cannot be caught by Python.

In brief, something in METIS (in the nonlinear heuristics) is causing this issue.

To Reproduce
Inside a docker created with a memory limit, create and solve a nonlinear model (quadratic convex is fine).
I am not sure whether the size or complexity of the model matters -- still testing that. An anonymized problem file that replicates this problem is attached in comments.

Expected behavior
Normal solution

Mitigation (from BUGREPORT)

  • Switch MUMPS off METIS ordering — SCIP nlpi/ipopt/optfile = "ipopt.opt" with
    mumps_pivot_order 0 (AMD) in that file. Avoids the METIS code path while keeping
    all NLP heuristics (incl. nlpdiving), so no primal-heuristic loss. Held 16/16
    solves
    where the METIS default / mumps_pivot_order 5 crash on loop 1. Note this is
    a path-avoidance workaround (the METIS overflow is still present, just not triggered),
    and AMD may give slightly different factorization performance than METIS.

System

  • OS: Docker (python:3.13-slim)
  • Version 6.2.1 (latest)
  • SCIP version: bundled
  • How did you install pyscipopt? PyPi

Additional context
Attached is a more detailed writeup co-authored with Claude, complete with long gdb thread dumps.

SCIP_BUGREPORT.md

Note: later testing showed MPEC is not the only heuristic that causes this. See comment below.

As well as the Python file used.

repro_reval_segfault.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions