sequential_vertex_coloring out-of-bounds memory access
Maintainer thường phản hồi trong vòng 1 ngày
@Becheler đang làm issue này rồi.
Từ ngày 7/10/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Bắt đầu với sequential_vertex_coloring.hpp và reproducer tests.cpp đính kèm. Kiểm tra cách bản đồ thuộc tính thứ tự mặc định được tạo và sử dụng khi đồ thị được lọc và không có bản đồ thuộc tính thứ tự nào được cung cấp. Chạy reproducer trên cả đồ thị gốc lẫn đồ thị đã lọc; hoàn thành khi lời gọi trên đồ thị đã lọc kết thúc mà không truy cập vượt giới hạn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- C++
- Star
- 397
- Fork
- 246
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 31
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của boostorg/graph
-
beginner friendly
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
boostorg/graph#593 · 40 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
algorithm beginner friendly priority: high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
boostorg/graph#231 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Trivial Minimum Cycle Ratio FailingCó thể đã có người làm @Becheler đã nhận 2 ngày trước. Đang mởalgorithm
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
boostorg/graph#599 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Implementing personalized PageRank for graph node scoring.Có thể đã có người làm @Becheler đã nhận 137 ngày trước. Đang mởalgorithm
boostorg/graph#493 · 22 bình luận · 1 reaction · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của boostorg/graph
Issue tương tự
-
Status: Awaiting triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
espressif/arduino-esp32#12984 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
torch_ops/logprob.cu does not compile with the serving container's nvcc (13.3.73); check_torch_ops.py cannot run as shippedCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 72/100
ashhart/TensorFold#535 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày