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

've you ever tried to valgrind ? #57

Closed
dougmencken opened this issue Oct 15, 2023 · 3 comments
Closed

've you ever tried to valgrind ? #57

dougmencken opened this issue Oct 15, 2023 · 3 comments

Comments

@dougmencken
Copy link
Owner

here's how to

valgrind --tool=memcheck --leak-check=yes bin/headoverheels
@dougmencken
Copy link
Owner Author

==124529== Mismatched free() / delete / delete []
==124529==    at 0x4846AFF: operator delete(void*, unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==124529==    by 0x1AF705: iso::Room::~Room() (Room.cpp:154)
==124529==    by 0x1B002C: iso::Room::~Room() (Room.cpp:174)
==124529==    by 0x19947E: iso::MapManager::clear() (MapManager.cpp:35)
==124529==    by 0x177FF9: game::GameManager::cleanUp() (GameManager.cpp:71)
==124529==    by 0x12347C: main (main.cpp:228)
==124529==  Address 0xbee6770 is 0 bytes inside a block of size 252 alloc'd
==124529==    at 0x4845283: operator new[](unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==124529==    by 0x1B124E: iso::Room::Room(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Room.cpp:40)
==124529==    by 0x1A6E40: iso::RoomBuilder::buildRoom(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (RoomBuilder.cpp:99)
==124529==    by 0x19E9E8: iso::MapManager::getOrBuildRoomByFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (MapManager.cpp:783)
==124529==    by 0x18D153: iso::Miniature::calculatePositionOfConnectedMiniature(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned short) (Miniature.cpp:800)
==124529==    by 0x193B34: iso::Isomot::updateMe() (Isomot.cpp:295)
==124529==    by 0x182053: game::GameManager::update() (GameManager.cpp:139)
==124529==    by 0x20C094: gui::ContinueGame::doAction() (ContinueGame.cpp:34)
==124529==    by 0x1FC2C4: doIt (Action.hpp:33)
==124529==    by 0x1FC2C4: handleKey (Label.cpp:91)
==124529==    by 0x1FC2C4: gui::Label::handleKey(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (Label.cpp:87)
==124529==    by 0x1FB1F3: gui::GuiManager::begin() (GuiManager.cpp:101)
==124529==    by 0x12346F: main (main.cpp:222)
==124529== 

@dougmencken
Copy link
Owner Author

dougmencken commented Oct 18, 2023

this tool also helped me to dive into the reason of “ the game crashes on the second play(because the descriptions of items are deleted and re-read) problem which has been (re)solved with 0b07d50

@dougmencken
Copy link
Owner Author

So now everyone knows about valgrind... okay 😏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant