get invalid pointer or invalid free() error when copying adjacency_matrix to a vector
Maintainers usually reply within 1 day
@jeremy-murphy is already working on this.
Since Dec 19, 2022.
Assessment
This issue has not been assessed yet.
Description
I have been trying to preload adjacency matrices with bundled properties to a std::vector of adjacency matrices in order to benchmark some uni project algorithm and not by chance measure the time to set up the graph.
In that instance i tried different approaches to copy a prototype g0:
- std::fill wouldn't work as AM is not a value type.
- boost::copy_graph() wouldn't work due to AM not being a list type
- using std::vector::emplace to construct the graph in place using a constructor declared in the documentation and the AM.hpp: one (of 2) with the edge iterators and num_nodes. * Luckily boost::edges(graph_t) provides such a thing. But it wouldn't work as the edge-iterator-pair provided does not include a .first member. There is one that needs an a property iterator ep_it. i haven't found any information on how do make one and if this is meant for bundled properties.
- using std::vector::push_back(g0) which works until the final "}" and then crashes when freeing or with a "munmap_chunk(): invalid pointer" error. g0 being a predefined graph i want to fill the vector with. It seems plausible as AM seems to be copy constructible. But apparently not entirely. Or maybe the property maps aren't.
However: after running through the algorithms there seems to be no change to g0. So it does not seem to be a "shallow copy" problem. Also valgrind does not report any memory leaks. But lots of errors.
This also happens when copy constructing only 2 graphs.
- on a sidenote: the documentation for iterator constructible suggests passing the number of edges too as it may speed up some processes. The AM does not seem to provide such a thing in the documentation in the section member functions (i.e. constructors).
- Dominant language
- C++
- Stars
- 396
- Forks
- 244
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 29
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/graph
-
Good first issues: start contributing to Boost.Graph herePossibly taken A pull request linked to this issue is open or already merged. Openbeginner friendly
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
boostorg/graph#593 · 35 comments ·
Maintainers usually reply within 1 day
-
algorithm beginner friendly priority: high
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
boostorg/graph#231 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
boostorg/graph#599 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Maintainers usually reply within 1 day
-
State of warnings in CI `develop`May be free again @Becheler claimed this 121 days ago, and no pull request is open. Openpriority: high warning
boostorg/graph#496 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
espressif/esp-matter#1874 ·
-
cudev: Fix MSVC build failures with 64-bit integers (int64_t/uint64_t) in vec_traits.hppPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opencv/opencv_contrib#4231 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MiSTer-devel/Main_MiSTer#1341 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
linux-test-project/lcov#552 ·
Maintainers usually reply within 1 day