sequential_vertex_coloring out-of-bounds memory access
Los mantenedores suelen responder en 1 día
@Becheler ya está trabajando en esto.
Desde el 7/10/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Empieza con sequential_vertex_coloring.hpp y el reproducer tests.cpp adjunto. Comprueba cómo se construye y utiliza el mapa de propiedades de orden predeterminado cuando el grafo está filtrado y no se proporciona ningún mapa de propiedades de orden. Ejecuta el reproducer tanto en el grafo original como en el filtrado; el trabajo estará terminado cuando la llamada sobre el grafo filtrado se complete sin acceder fuera de los límites.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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).
- Lenguaje dominante
- C++
- Estrellas
- 399
- Forks
- 247
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 40
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 boostorg/graph
-
Good first issues: start contributing to Boost.Graph hereQuizá libre de nuevo @andreacassioli la tomó hace 8 días y no hay ningún pull request abierto. Abiertobeginner friendly
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
boostorg/graph#593 · 47 comentarios ·
Los mantenedores suelen responder en 1 día
-
algorithm beginner friendly priority: high
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
boostorg/graph#231 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Trivial Minimum Cycle Ratio FailingPosiblemente ocupada @Becheler la tomó hace 11 días. Abiertoalgorithm
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
boostorg/graph#599 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
Los mantenedores suelen responder en 1 día
-
Implementing personalized PageRank for graph node scoring.Posiblemente ocupada @Becheler la tomó hace 146 días. Abiertoalgorithm
boostorg/graph#493 · 22 comentarios · 1 reacción · 2 asignados ·
Los mantenedores suelen responder en 1 día
Todos los issues de boostorg/graph
Issues similares
-
bug question
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
-
test(python): the CPU-bound tool overlap check compares two wall-clock samples and fails under loadAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
CachyOS/New-Cli-Installer#50 ·
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 90/100
Qiskit/qiskit-aer#2482 ·
Los mantenedores suelen responder en 1 día