sequential_vertex_coloring out-of-bounds memory access
メンテナーはふだん 1 日以内に返信
@Becheler がすでに取り組んでいます。
2026年10月7日 から。
評価
調査の方向性
sequential_vertex_coloring.hpp と添付の tests.cpp reproducer から始めます。グラフがフィルタリングされ、order property map が指定されていない場合に、デフォルトの order property map がどのように構築され、使用されるかを確認してください。reproducer を元のグラフとフィルタリング後のグラフの両方で実行します。フィルタリング後のグラフに対する呼び出しが範囲外アクセスなしで完了すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- C++
- スター
- 397
- フォーク
- 246
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 31
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
boostorg/graph のほかの issue
-
Good first issues: start contributing to Boost.Graph here対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbeginner friendly
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
boostorg/graph#593 · コメント 39 件 ·
メンテナーはふだん 1 日以内に返信
-
algorithm beginner friendly priority: high
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
boostorg/graph#231 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
algorithm
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
boostorg/graph#599 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
メンテナーはふだん 1 日以内に返信
-
Implementing personalized PageRank for graph node scoring.対応中かも @Becheler が 135 日前に担当しました。 オープンalgorithm
boostorg/graph#493 · コメント 22 件 · リアクション 1 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
Round video messages start gray and blocky with libx264: encoder is configured for 1,000,000 fpsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
telegramdesktop/tdesktop#31422 ·
メンテナーはふだん 9 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
zen-browser/desktop#15809 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ggml-org/whisper.cpp#4103 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
bitcoin-core/gui-qml#987 ·
メンテナーはふだん 3 日以内に返信