SetCoverLagrangian: stale ThreePhase() declaration, and ComputeLowerBound() segfaults if UseNumThreads() was not called
I maintainer di solito rispondono entro 1 giorno
@bdb-git ci sta già lavorando.
Dal 11/9/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Two small things in ortools/set_cover/set_cover_lagrangian.h, found while writing #5122.
Neither comes from that PR. Checked on main @5a1b660. set_cover_lagrangian.cc is
identical on stable, so both apply to the released wheels too.
1. ThreePhase() is declared but has no definition
set_cover_lagrangian.h:135 declares void ThreePhase(Cost upper_bound);. Nothing defines
it in ortools/set_cover. The three-phase procedure now lives in set_cover_cft.cc as
RunThreePhase, so this looks like a leftover from before CFT moved to its own file.
It is harmless in C++ until someone calls it (link error). Through pybind11 it is worse:
&SetCoverLagrangian::ThreePhase compiles, and the failure only shows up at module import
as undefined symbol: _ZN19operations_research18SetCoverLagrangian10ThreePhaseEd, which takes down the whole set_cover extension.
Suggest deleting the declaration.
2. ComputeLowerBound() needs UseNumThreads() first but has undocumented condition
thread_pool_ is nullptr until UseNumThreads() runs (set_cover_lagrangian.h:60,
:64). ComputeLowerBound() calls the Parallel* methods unconditionally, and they do
thread_pool_->Schedule(...). set_cover_solve.cc:335 calls UseNumThreads() first, so the
solver binary is fine. A fresh SetCoverLagrangian however results in:
lag = set_cover.SetCoverLagrangian(inv)
lag.compute_lower_bound(model.subset_costs, upper_bound) # SIGSEGV
lag.use_num_threads(1) # fine if called first
The header does not mention the precondition. One could: i) Either default thread_pool_ to one thread in the constructor, or ii) CHECK(thread_pool_ != nullptr) with a message naming UseNumThreads(), or iii) a comment on ComputeLowerBound()`.
Drafted with Claude; reproduced and verified by me.
- Lingua principale
- C++
- Stelle
- 14.5k
- Fork
- 2.6k
- Merge medio
- 9h 43m
- PR unite (30g)
- 53
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/or-tools
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
I maintainer di solito rispondono entro 1 giorno
-
CP-SAT: TimeTableEdgeFinding can report false INFEASIBLE for large cumulative scheduling modelsForse già presa @lperron l’ha presa oggi. ApertaBug Solver: CP-SAT Solver
google/or-tools#5672 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Python (v10.0-rc.1): Model.restore_assignment() and Assignment.objective() take ownership of C++-owned objects (segfault)Forse già presa @Mizux l’ha presa oggi. ApertaLang: Python Solver: Routing & CP Solver
google/or-tools#5670 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[CP-SAT] Duplicate timer registration in StartDirectSolver when UserTimer aliases WallTimerForse già presa @lperron l’ha presa 1 giorno fa. ApertaSolver: CP-SAT Solver
Difficoltà 3/5 Mezza giornata Idoneità per principianti 85/100
google/or-tools#5659 · 5 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di google/or-tools
Issue simili
-
bug data-types
Difficoltà 2/5 1-3 ore Idoneità per principianti 71/100
ClickHouse/clickhouse-odbc#680 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
ionut-mihalache/aqua#31 · 1 commento ·
-
LWG
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 2 giorni
-
needs-kind
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
villagesql/villagesql-server#1702 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/vcpkg-tool#2191 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno