sequential_vertex_coloring out-of-bounds memory access
I maintainer di solito rispondono entro 1 giorno
@Becheler ci sta già lavorando.
Dal 7/10/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia con sequential_vertex_coloring.hpp e il reproducer tests.cpp allegato. Controlla come viene costruita e utilizzata la property map dell’ordine predefinita quando il grafo è filtrato e non viene fornita alcuna property map dell’ordine. Esegui il reproducer sia sul grafo originale sia su quello filtrato; il lavoro è terminato quando la chiamata sul grafo filtrato termina senza accessi fuori dai limiti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The algorithm encoded in sequential_vertex_coloring.hpp accesses memory out of bounds when called with (i) a filtered graph, i.e., one for which num_vertices(g) > distance(vertices(g).first,vertices(g).second), and (ii) no order property map. This is because, for a filtered graph, the order property map constructed by the algorithm is too small. The algorithm documents the order property map to have the following property:
A mapping from integers in the range [0, num_vertices(g)) to the vertices of the graph.
However, it is constructed from vertices(g), not num_vertices(g). For filtered graphs, the former range may be smaller than the latter, yet the algorithm itself accesses all the vertices returned by num_vertices(g), i.e., in the range referred to above. Therefore, out-of-bounds memory access is possible.
See below for a reproducer and a patch that works for me. Although I have tested this only on Boost v1.86.0, the file in question is unchanged for seven years and contains the same code.
Before filing
- [ x] I searched the existing issues and did not find a duplicate.
- [x ] I have reproduced the bug against the
developbranch or the latest Boost release. - [x ] I have a minimal reproducer (or I will paste my full failing code below).
Boost version
1.86.0
Compiler family
- GCC / g++
- [ x] Clang / clang++
- MSVC (Visual Studio)
- Intel / oneAPI
- Other (specify below)
Exact compiler version:
Apple clang version 16.0.0 (clang-1600.0.26.4)
Standard library
- libstdc++
- libc++
- MSVC STL
- Other (specify below)
Operating system
- Linux
- [ x] macOS
- Windows
- Other (specify below)
Kind of component affected
- Graph data structure (e.g.
adjacency_list,adjacency_matrix) - [ x] Algorithm (e.g.
dijkstra_shortest_paths,breadth_first_search) - Property map
- I/O or file-format reader (e.g.
read_graphml,read_graphviz) - Visitor / event hooks
- Other (specify below)
Exact name of the affected component:
sequential_vertex_coloring
Steps to reproduce
(i) create a filtered graph (g) that reduces the number of vertices
(ii) call sequential_vertex_coloring(g,color_map), i.e., without an order property map
See the attached reproducer, which colors both the original and filtered graphs to demonstrate the problem only with the latter.
Expected behavior
The algorithm should complete.
Actual behavior
Segmentation fault, i.e., signal 11.
Are you willing to help?
- I'd like to submit a fix as a pull request.
- I can help diagnose or test a candidate fix.
- [ x] I'm only reporting the issue.
I am happy to help test as needed, but this report should be entirely self-contained with a reproducer and a patch (see below).
- Lingua principale
- C++
- Stelle
- 397
- Fork
- 246
- Merge medio
- 1g 15h
- PR unite (30g)
- 31
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 boostorg/graph
-
Good first issues: start contributing to Boost.Graph hereForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabeginner friendly
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
boostorg/graph#593 · 39 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
algorithm beginner friendly priority: high
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
boostorg/graph#231 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
algorithm
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
boostorg/graph#599 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
I maintainer di solito rispondono entro 1 giorno
-
Implementing personalized PageRank for graph node scoring.Forse già presa @Becheler l’ha presa 135 giorni fa. Apertaalgorithm
boostorg/graph#493 · 22 commenti · 1 reazione · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di boostorg/graph
Issue simili
-
Round video messages start gray and blocky with libx264: encoder is configured for 1,000,000 fpsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
telegramdesktop/tdesktop#31422 ·
I maintainer di solito rispondono entro 9 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
zen-browser/desktop#15809 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ggml-org/whisper.cpp#4103 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
bitcoin-core/gui-qml#987 ·
I maintainer di solito rispondono entro 3 giorni