Opened 9 years ago
Last modified 7 years ago
#9493 new Bugs
labeled_graph may refer to and operate on released memory after removing a vertex by label
Reported by: | Owned by: | Jeremiah Willcock | |
---|---|---|---|
Milestone: | To Be Determined | Component: | graph |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Although labeled_graph
is not officially part of BGL API some people try to use it.
Unfortunately, the current implementation has a serious bug that might lead to a crash. The problem appears when removing a vertex from labeled_graph by its label. My investigation shown that despite of vertex being actually removed, the label is not and it still refers to the removed vertex.
The problem is "easier" to reproduce when adjacency_list's VertexList is set to a container like boost::listS.
The attached test case shows the problem. I also attached the output from a valgrind run on the test case code and a patch that fixes the issue for the "configuration" that I use (a more generic fix will probably be needed).
Attachments (3)
Change History (5)
by , 9 years ago
by , 9 years ago
Attachment: | valgrind.txt added |
---|
by , 9 years ago
Attachment: | boost_labeled_graph_fix.patch added |
---|
comment:1 by , 9 years ago
comment:2 by , 7 years ago
This bug is still present in 1.59.0. I would greatly appreciate if the patch finds its way into the next release.
Having this issue, the patch worked like a charm. Thanks
Replying to Adam Romanek <romanek.adam@…>: