[BUG] Out-of-bounds read when solving a DataModel with lower/upper constraint bounds
Los mantenedores suelen responder en 1 día
@ramakrishnap-nv ya está trabajando en esto.
Desde el 2/11/2026.
- #2253 de @ramakrishnap-nv — abierto
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 55/100
Línea de trabajo
Start with _compute_slack_csr, the function the report names as reading the rhs and sense arrays, and compare it with how a DataModel built through set_constraint_lower_bounds() and set_constraint_upper_bounds() fills those arrays. Run the reproducer in the issue, which should print slack near zero for x >= 1. Done means the slack is computed from the constraint bounds without reading the empty arrays, and the Cython bounds-checked run no longer reports an out-of-bounds access.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
(AI-assisted bug report)
cuopt.linear_programming.Solve accepts a DataModel whose constraints are supplied through set_constraint_lower_bounds() and set_constraint_upper_bounds(). When it constructs a Solution with a primal vector, its Python/Cython slack calculation instead reads the alternative RHS and row-sense arrays. Those arrays are empty for this valid DataModel representation. Because Cython bounds checking is disabled, the code reads outside both arrays. The read can produce an incorrect slack or terminate the process with SIGSEGV.
Reproducer:
import numpy as np
from cuopt.linear_programming.data_model import DataModel
from cuopt.linear_programming.solver import Solve
from cuopt.linear_programming.solver_settings import SolverMethod, SolverSettings
# Minimize x subject to x >= 1.
dm = DataModel()
dm.set_csr_constraint_matrix(
np.array([1.0]),
np.array([0], dtype=np.int32),
np.array([0, 1], dtype=np.int32),
)
dm.set_objective_coefficients(np.array([1.0]))
dm.set_variable_lower_bounds(np.array([0.0]))
dm.set_variable_upper_bounds(np.array([np.inf]))
dm.set_variable_types(np.array(["C"], dtype="S1"))
dm.set_constraint_lower_bounds(np.array([1.0]))
dm.set_constraint_upper_bounds(np.array([np.inf]))
print(
"rows=1",
"rhs=", len(dm.get_constraint_bounds()),
"sense=", len(dm.get_row_types()),
"lower=", len(dm.get_constraint_lower_bounds()),
"upper=", len(dm.get_constraint_upper_bounds()),
flush=True,
)
settings = SolverSettings()
settings.set_parameter("method", SolverMethod.PDLP)
settings.set_parameter("log_to_console", False)
solution = Solve(dm, settings)
print(solution.get_termination_reason())
print("x=", solution.get_primal_solution())
print("slack=", solution.get_slack())
Observed locally:
rows=1 rhs= 0 sense= 0 lower= 1 upper= 1
Optimal
x= [1.]
slack= [-1.]
The constraint is x >= 1 so we'd expect the slack to be zero. I observed segfaults on other instances.
The source of the issue is _compute_slack_csr which reads from the rhs and sense vectors which aren't initialized in this DataModel code path. Running with bounds checking enabled in Cython confirms the out of bounds access.
- Lenguaje dominante
- Cuda
- Estrellas
- 1.1k
- Forks
- 249
- Merge medio
- 1 d 16 h
- PR fusionados (30 d)
- 127
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NVIDIA/cuopt
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
[FEA] Break load windowsAbiertofeature request
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
NVIDIA/cuopt#2239 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
Los mantenedores suelen responder en 1 día
-
[BUG] Java: Problem.addConstraint accepts the same Constraint twicePosiblemente ocupada @akhil9tiet la tomó hace 6 días. Abiertobug
NVIDIA/cuopt#2224 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 63/100
Los mantenedores suelen responder en 1 día
Todos los issues de NVIDIA/cuopt
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nexu-io/open-design#9262 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[BUG] LLM conflict check ignores MNEMOSYNE_LLM_MAX_TOKENS, so reasoning models return empty repliesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
mnemosyne-oss/mnemosyne#1325 ·
Los mantenedores suelen responder en 1 día
-
enhancement meshtastic-2.8
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
pskillen/meshflow-api#459 ·
-
agent-assisted bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
bug lobby
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
alastair-smith/card-games#372 ·
Los mantenedores suelen responder en 1 día