Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with FordFulkersonTest #42

Closed
lxylxy123456 opened this issue Dec 18, 2020 · 2 comments · Fixed by #50
Closed

Problem with FordFulkersonTest #42

lxylxy123456 opened this issue Dec 18, 2020 · 2 comments · Fixed by #50
Assignees
Labels
bug Something isn't working

Comments

@lxylxy123456
Copy link
Owner

https://github.com/lxylxy123456/algorithms/runs/1574645545?check_suite_focus=true

valgrind --error-exitcode=1 --tool=memcheck --leak-check=full --errors-for-leak-kinds=definite ./bin/FordFulkersonTest valgrind > /dev/null
==8765== Memcheck, a memory error detector
==8765== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==8765== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==8765== Command: ./bin/FordFulkersonTest valgrind
==8765== 
==8765== Invalid write of size 8
==8765==    at 0x10F063: algorithms::Queue<unsigned long>::Enqueue(unsigned long) (Queue.hpp:31)
==8765==    by 0x10CE99: void algorithms::BFS<algorithms::GraphAdjList<unsigned long>, unsigned long>(algorithms::GraphAdjList<unsigned long>&, unsigned long, std::unordered_map<unsigned long, algorithms::BFSInfo<unsigned long>, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, algorithms::BFSInfo<unsigned long> > > >&) (BFS.hpp:51)
==8765==    by 0x10B64E: void algorithms::FordFulkerson<algorithms::GraphAdjList<unsigned long>, unsigned long, int>(algorithms::GraphAdjList<unsigned long>&, std::unordered_map<algorithms::Edge<unsigned long>, int, algorithms::EdgeHash<unsigned long>, std::equal_to<algorithms::Edge<unsigned long> >, std::allocator<std::pair<algorithms::Edge<unsigned long> const, int> > >&, unsigned long, unsigned long, std::unordered_map<algorithms::Edge<unsigned long>, int, algorithms::EdgeHash<unsigned long>, std::equal_to<algorithms::Edge<unsigned long> >, std::allocator<std::pair<algorithms::Edge<unsigned long> const, int> > >&) (FordFulkerson.hpp:52)
==8765==    by 0x109AFA: test(unsigned long, unsigned long) (FordFulkersonTest.cpp:39)
==8765==    by 0x10A1E0: main (FordFulkersonTest.cpp:73)
==8765==  Address 0x5e75200 is 0 bytes after a block of size 0 alloc'd
==8765==    at 0x4C3289F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8765==    by 0x10EFEC: algorithms::Queue<unsigned long>::Queue(unsigned long) (Queue.hpp:29)
==8765==    by 0x10CE83: void algorithms::BFS<algorithms::GraphAdjList<unsigned long>, unsigned long>(algorithms::GraphAdjList<unsigned long>&, unsigned long, std::unordered_map<unsigned long, algorithms::BFSInfo<unsigned long>, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, algorithms::BFSInfo<unsigned long> > > >&) (BFS.hpp:50)
==8765==    by 0x10B64E: void algorithms::FordFulkerson<algorithms::GraphAdjList<unsigned long>, unsigned long, int>(algorithms::GraphAdjList<unsigned long>&, std::unordered_map<algorithms::Edge<unsigned long>, int, algorithms::EdgeHash<unsigned long>, std::equal_to<algorithms::Edge<unsigned long> >, std::allocator<std::pair<algorithms::Edge<unsigned long> const, int> > >&, unsigned long, unsigned long, std::unordered_map<algorithms::Edge<unsigned long>, int, algorithms::EdgeHash<unsigned long>, std::equal_to<algorithms::Edge<unsigned long> >, std::allocator<std::pair<algorithms::Edge<unsigned long> const, int> > >&) (FordFulkerson.hpp:52)
==8765==    by 0x109AFA: test(unsigned long, unsigned long) (FordFulkersonTest.cpp:39)
==8765==    by 0x10A1E0: main (FordFulkersonTest.cpp:73)
==8765== 
==8765== Invalid read of size 8
==8765==    at 0x10F1B0: algorithms::Queue<unsigned long>::Dequeue() (Queue.hpp:43)
==8765==    by 0x10CEBC: void algorithms::BFS<algorithms::GraphAdjList<unsigned long>, unsigned long>(algorithms::GraphAdjList<unsigned long>&, unsigned long, std::unordered_map<unsigned long, algorithms::BFSInfo<unsigned long>, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, algorithms::BFSInfo<unsigned long> > > >&) (BFS.hpp:53)
==8765==    by 0x10B64E: void algorithms::FordFulkerson<algorithms::GraphAdjList<unsigned long>, unsigned long, int>(algorithms::GraphAdjList<unsigned long>&, std::unordered_map<algorithms::Edge<unsigned long>, int, algorithms::EdgeHash<unsigned long>, std::equal_to<algorithms::Edge<unsigned long> >, std::allocator<std::pair<algorithms::Edge<unsigned long> const, int> > >&, unsigned long, unsigned long, std::unordered_map<algorithms::Edge<unsigned long>, int, algorithms::EdgeHash<unsigned long>, std::equal_to<algorithms::Edge<unsigned long> >, std::allocator<std::pair<algorithms::Edge<unsigned long> const, int> > >&) (FordFulkerson.hpp:52)
==8765==    by 0x109AFA: test(unsigned long, unsigned long) (FordFulkersonTest.cpp:39)
==8765==    by 0x10A1E0: main (FordFulkersonTest.cpp:73)
==8765==  Address 0x5e75200 is 0 bytes after a block of size 0 alloc'd
==8765==    at 0x4C3289F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8765==    by 0x10EFEC: algorithms::Queue<unsigned long>::Queue(unsigned long) (Queue.hpp:29)
==8765==    by 0x10CE83: void algorithms::BFS<algorithms::GraphAdjList<unsigned long>, unsigned long>(algorithms::GraphAdjList<unsigned long>&, unsigned long, std::unordered_map<unsigned long, algorithms::BFSInfo<unsigned long>, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, algorithms::BFSInfo<unsigned long> > > >&) (BFS.hpp:50)
==8765==    by 0x10B64E: void algorithms::FordFulkerson<algorithms::GraphAdjList<unsigned long>, unsigned long, int>(algorithms::GraphAdjList<unsigned long>&, std::unordered_map<algorithms::Edge<unsigned long>, int, algorithms::EdgeHash<unsigned long>, std::equal_to<algorithms::Edge<unsigned long> >, std::allocator<std::pair<algorithms::Edge<unsigned long> const, int> > >&, unsigned long, unsigned long, std::unordered_map<algorithms::Edge<unsigned long>, int, algorithms::EdgeHash<unsigned long>, std::equal_to<algorithms::Edge<unsigned long> >, std::allocator<std::pair<algorithms::Edge<unsigned long> const, int> > >&) (FordFulkerson.hpp:52)
==8765==    by 0x109AFA: test(unsigned long, unsigned long) (FordFulkersonTest.cpp:39)
==8765==    by 0x10A1E0: main (FordFulkersonTest.cpp:73)
==8765== 
==8765== 
==8765== HEAP SUMMARY:
==8765==     in use at exit: 0 bytes in 0 blocks
==8765==   total heap usage: 74,567 allocs, 74,567 frees, 4,063,104 bytes allocated
==8765== 
==8765== All heap blocks were freed -- no leaks are possible
==8765== 
==8765== For counts of detected and suppressed errors, rerun with: -v
==8765== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
make: *** [valgrind/FordFulkersonTest] Error 1
@lxylxy123456 lxylxy123456 added the bug Something isn't working label Dec 18, 2020
@lxylxy123456 lxylxy123456 self-assigned this Dec 18, 2020
@lxylxy123456
Copy link
Owner Author

@lxylxy123456
Copy link
Owner Author

Possible random seeds that reproduce this problem: 1709819266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant