Opened 7 years ago

Closed 7 years ago

#10208 closed defect (fixed)

TITANIC: Memory leaks in TrueTalk

Reported by: csnover Owned by: dreammaster
Priority: normal Component: Engine: Titanic
Version: Keywords:
Cc: Game: Starship Titanic

Description

valgrind reports from dafioram

==16727== 5,488 (64 direct, 5,424 indirect) bytes in 1 blocks are definitely lost in loss record 2,585 of 2,668
==16727==    at 0x4C2E19F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==16727==    by 0x33FBC7: Titanic::TTword::readSyn(Titanic::SimpleFile*) (tt_word.cpp:97)
==16727==    by 0x397AA5: Titanic::TTvocab::load(Titanic::CString const&) (tt_vocab.cpp:61)
==16727==    by 0x397914: Titanic::TTvocab::TTvocab(int) (tt_vocab.cpp:37)
==16727==    by 0x3889C2: Titanic::CScriptHandler::CScriptHandler(Titanic::CTitleEngine*, int, int) (script_handler.cpp:41)
==16727==    by 0x388483: Titanic::CTitleEngine::setup(int, int) (title_engine.cpp:39)
==16727==    by 0x3885E1: Titanic::STtitleEngine::setup(int, int) (title_engine.cpp:57)
==16727==    by 0x331A1B: Titanic::CTrueTalkManager::CTrueTalkManager(Titanic::CGameManager*) (true_talk_manager.cpp:51)
==16727==    by 0x34321E: Titanic::CGameManager::CGameManager(Titanic::CProjectItem*, Titanic::CGameView*, Audio::Mixer*) (game_manager.cpp:41)
==16727==    by 0x347A5D: Titanic::CMainGameWindow::applicationStarting() (main_game_window.cpp:85)
==16727==    by 0x211585: Titanic::TitanicEngine::initialize() (titanic.cpp:125)
==16727==    by 0x211709: Titanic::TitanicEngine::run() (titanic.cpp:152)
==16727== 
==16727== 8,960 bytes in 1 blocks are possibly lost in loss record 2,598 of 2,668
==16727==    at 0x4C2DB2F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==16727==    by 0x37FB23: Common::Array<Titanic::TTsentenceEntry>::allocCapacity(unsigned int) (array.h:281)
==16727==    by 0x38AA8E: Common::Array<Titanic::TTsentenceEntry>::insert_aux(Titanic::TTsentenceEntry*, Titanic::TTsentenceEntry const*, Titanic::TTsentenceEntry const*) (array.h:320)
==16727==    by 0x38A405: Common::Array<Titanic::TTsentenceEntry>::push_back(Titanic::TTsentenceEntry const&) (array.h:90)
==16727==    by 0x3895AD: Titanic::TTsentenceEntries::load(Titanic::CString const&) (script_support.cpp:84)
==16727==    by 0x37C43D: Titanic::DoorbotScript::setupSentences() (doorbot_script.cpp:79)
==16727==    by 0x37C224: Titanic::DoorbotScript::DoorbotScript(int, char const*, int, char const*, int, int, int, int, int, int) (doorbot_script.cpp:56)
==16727==    by 0x33BF36: Titanic::TTscripts::TTscripts() (tt_scripts.cpp:66)
==16727==    by 0x3319A0: Titanic::CTrueTalkManager::CTrueTalkManager(Titanic::CGameManager*) (true_talk_manager.cpp:50)
==16727==    by 0x34321E: Titanic::CGameManager::CGameManager(Titanic::CProjectItem*, Titanic::CGameView*, Audio::Mixer*) (game_manager.cpp:41)
==16727==    by 0x347A5D: Titanic::CMainGameWindow::applicationStarting() (main_game_window.cpp:85)
==16727==    by 0x211585: Titanic::TitanicEngine::initialize() (titanic.cpp:125)

Build: 1.10.0git-4914-g294503f516

Change History (5)

comment:1 by dreammaster, 7 years ago

Owner: set to dreammaster
Resolution: fixed
Status: newclosed

comment:2 by dafioram, 7 years ago

Resolution: fixed
Status: closednew

Here are some more true talk memory leaks.
scummvm: 1.10.0git-4971-g8547c89b86

==16918== 375,264 (35,840 direct, 339,424 indirect) bytes in 560 blocks are definitely lost in loss record 2,425 of 2,435
==16918==    at 0x4C2E19F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==16918==    by 0x345935: Titanic::TTword::readSyn(Titanic::SimpleFile*) (tt_word.cpp:97)
==16918==    by 0x39D99B: Titanic::TTvocab::load(Titanic::CString const&) (tt_vocab.cpp:62)
==16918==    by 0x39D80A: Titanic::TTvocab::TTvocab(Titanic::VocabMode) (tt_vocab.cpp:38)
==16918==    by 0x38E8C2: Titanic::CScriptHandler::CScriptHandler(Titanic::CTitleEngine*, int, Titanic::VocabMode) (script_handler.cpp:41)
==16918==    by 0x38E371: Titanic::CTitleEngine::setup(int, Titanic::VocabMode) (title_engine.cpp:40)
==16918==    by 0x38E4E1: Titanic::STtitleEngine::setup(int, Titanic::VocabMode) (title_engine.cpp:58)
==16918==    by 0x3363E9: Titanic::CTrueTalkManager::CTrueTalkManager(Titanic::CGameManager*) (true_talk_manager.cpp:51)
==16918==    by 0x348F8C: Titanic::CGameManager::CGameManager(Titanic::CProjectItem*, Titanic::CGameView*, Audio::Mixer*) (game_manager.cpp:41)
==16918==    by 0x34D819: Titanic::CMainGameWindow::applicationStarting() (main_game_window.cpp:87)
==16918==    by 0x2146A7: Titanic::TitanicEngine::initialize() (titanic.cpp:127)
==16918==    by 0x21482B: Titanic::TitanicEngine::run() (titanic.cpp:154)
==16918== 48 bytes in 1 blocks are possibly lost in loss record 1,642 of 2,435
==16918==    at 0x4C2E19F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==16918==    by 0x344936: Titanic::TTstring::operator=(char const*) (tt_string.cpp:83)
==16918==    by 0x345084: Titanic::TTsynonym::TTsynonym(int, char const*, Titanic::FileHandle) (tt_synonym.cpp:38)
==16918==    by 0x345954: Titanic::TTword::readSyn(Titanic::SimpleFile*) (tt_word.cpp:97)
==16918==    by 0x39D99B: Titanic::TTvocab::load(Titanic::CString const&) (tt_vocab.cpp:62)
==16918==    by 0x39D80A: Titanic::TTvocab::TTvocab(Titanic::VocabMode) (tt_vocab.cpp:38)
==16918==    by 0x38E8C2: Titanic::CScriptHandler::CScriptHandler(Titanic::CTitleEngine*, int, Titanic::VocabMode) (script_handler.cpp:41)
==16918==    by 0x38E371: Titanic::CTitleEngine::setup(int, Titanic::VocabMode) (title_engine.cpp:40)
==16918==    by 0x38E4E1: Titanic::STtitleEngine::setup(int, Titanic::VocabMode) (title_engine.cpp:58)
==16918==    by 0x3363E9: Titanic::CTrueTalkManager::CTrueTalkManager(Titanic::CGameManager*) (true_talk_manager.cpp:51)
==16918==    by 0x348F8C: Titanic::CGameManager::CGameManager(Titanic::CProjectItem*, Titanic::CGameView*, Audio::Mixer*) (game_manager.cpp:41)
==16918==    by 0x34D819: Titanic::CMainGameWindow::applicationStarting() (main_game_window.cpp:87)

comment:3 by dreammaster, 7 years ago

Resolution: fixed
Status: newclosed

comment:4 by csnover, 7 years ago

Resolution: fixed
Status: closednew

TrueTalk is currently leaking in these areas:

   2 libc++abi.dylib operator new(unsigned long)
   3 scummvm Titanic::TTpicture::copy() const scummvm/engines/titanic/true_talk/tt_picture.cpp:64
   4 scummvm Titanic::TTconcept::initializeWordRef(Titanic::TTword*) scummvm/engines/titanic/true_talk/tt_concept.cpp:139
   5 scummvm Titanic::TTconcept::TTconcept(Titanic::TTconcept&) scummvm/engines/titanic/true_talk/tt_concept.cpp:84
   6 scummvm Titanic::TTparser::filterConcepts(int, int) scummvm/engines/titanic/true_talk/tt_parser.cpp:1627
   7 scummvm Titanic::TTparser::checkForAction() scummvm/engines/titanic/true_talk/tt_parser.cpp:1490
   8 scummvm Titanic::TTparser::findFrames(Titanic::TTsentence*) scummvm/engines/titanic/true_talk/tt_parser.cpp:524
   9 scummvm Titanic::CScriptHandler::processInput(Titanic::TTroomScript*, Titanic::TTnpcScript*, Titanic::TTstring const&) scummvm/engines/titanic/true_talk/script_handler.cpp:96
  10 scummvm Titanic::CTrueTalkManager::processInput(Titanic::CTrueTalkNPC*, Titanic::CTextInputMsg*, Titanic::CViewItem*) scummvm/engines/titanic/true_talk/true_talk_manager.cpp:334
  11 scummvm Titanic::CTrueTalkNPC::processInput(Titanic::CTextInputMsg*, Titanic::CViewItem*) scummvm/engines/titanic/npcs/true_talk_npc.cpp:232
  12 scummvm Titanic::CTrueTalkNPC::TextInputMsg(Titanic::CTextInputMsg*) scummvm/engines/titanic/npcs/true_talk_npc.cpp:83
  13 scummvm Titanic::CMessage::perform(Titanic::CTreeItem*) scummvm/engines/titanic/messages/messages.cpp:107
  14 scummvm Titanic::CMessage::execute(Titanic::CTreeItem*, Titanic::ClassDef const*, int) scummvm/engines/titanic/messages/messages.cpp:60
  15 scummvm Titanic::CPetConversations::textLineEntered(Titanic::CString const&) scummvm/engines/titanic/pet_control/pet_conversations.cpp:507
  16 scummvm Titanic::CPetConversations::handleKey(Common::KeyState const&) scummvm/engines/titanic/pet_control/pet_conversations.cpp:490
  17 scummvm Titanic::CPetConversations::KeyCharMsg(Titanic::CKeyCharMsg*) scummvm/engines/titanic/pet_control/pet_conversations.cpp:224
  18 scummvm Titanic::CPetControl::KeyCharMsg(Titanic::CKeyCharMsg*) scummvm/engines/titanic/pet_control/pet_control.cpp:339
  19 scummvm Titanic::CMessage::perform(Titanic::CTreeItem*) scummvm/engines/titanic/messages/messages.cpp:107
  20 scummvm Titanic::CMessage::execute(Titanic::CTreeItem*, Titanic::ClassDef const*, int) scummvm/engines/titanic/messages/messages.cpp:60
  21 scummvm Titanic::CInputHandler::dispatchMessage(Titanic::CMessage*) scummvm/engines/titanic/input_handler.cpp:154
  22 scummvm Titanic::CInputHandler::processMessage(Titanic::CMessage*) scummvm/engines/titanic/input_handler.cpp:84
  23 scummvm Titanic::CInputHandler::handleMessage(Titanic::CMessage&, bool) scummvm/engines/titanic/input_handler.cpp:72
  24 scummvm Titanic::CInputTranslator::keyDown(Common::KeyState const&) scummvm/engines/titanic/input_translator.cpp:91
  25 scummvm Titanic::CMainGameWindow::keyDown(Common::KeyState) scummvm/engines/titanic/main_game_window.cpp:367
  26 scummvm Titanic::Events::pollEvents() scummvm/engines/titanic/events.cpp:95
  27 scummvm Titanic::Events::pollEventsAndWait() scummvm/engines/titanic/events.cpp:112
  28 scummvm Titanic::TitanicEngine::run() scummvm/engines/titanic/titanic.cpp:157
   2 libc++abi.dylib operator new(unsigned long)
   3 scummvm Titanic::TTstring::TTstring(char const*) scummvm/engines/titanic/true_talk/tt_string.cpp:32
   4 scummvm Titanic::TTconcept::TTconcept(Titanic::TTword*, Titanic::ScriptType) scummvm/engines/titanic/true_talk/tt_concept.cpp:56
   5 scummvm Titanic::TTparser::processModifiers(int, Titanic::TTword*) scummvm/engines/titanic/true_talk/tt_parser.cpp:1657
   6 scummvm Titanic::TTparser::considerRequests(Titanic::TTword*) scummvm/engines/titanic/true_talk/tt_parser.cpp:946
   7 scummvm Titanic::TTparser::processRequests(Titanic::TTword*) scummvm/engines/titanic/true_talk/tt_parser.cpp:1310
   8 scummvm Titanic::TTparser::findFrames(Titanic::TTsentence*) scummvm/engines/titanic/true_talk/tt_parser.cpp:515
   9 scummvm Titanic::CScriptHandler::processInput(Titanic::TTroomScript*, Titanic::TTnpcScript*, Titanic::TTstring const&) scummvm/engines/titanic/true_talk/script_handler.cpp:96
  10 scummvm Titanic::CTrueTalkManager::processInput(Titanic::CTrueTalkNPC*, Titanic::CTextInputMsg*, Titanic::CViewItem*) scummvm/engines/titanic/true_talk/true_talk_manager.cpp:334
  11 scummvm Titanic::CTrueTalkNPC::processInput(Titanic::CTextInputMsg*, Titanic::CViewItem*) scummvm/engines/titanic/npcs/true_talk_npc.cpp:232
  12 scummvm Titanic::CTrueTalkNPC::TextInputMsg(Titanic::CTextInputMsg*) scummvm/engines/titanic/npcs/true_talk_npc.cpp:83
  13 scummvm Titanic::CMessage::perform(Titanic::CTreeItem*) scummvm/engines/titanic/messages/messages.cpp:107
  14 scummvm Titanic::CMessage::execute(Titanic::CTreeItem*, Titanic::ClassDef const*, int) scummvm/engines/titanic/messages/messages.cpp:60
  15 scummvm Titanic::CPetConversations::textLineEntered(Titanic::CString const&) scummvm/engines/titanic/pet_control/pet_conversations.cpp:507
  16 scummvm Titanic::CPetConversations::handleKey(Common::KeyState const&) scummvm/engines/titanic/pet_control/pet_conversations.cpp:490
  17 scummvm Titanic::CPetConversations::KeyCharMsg(Titanic::CKeyCharMsg*) scummvm/engines/titanic/pet_control/pet_conversations.cpp:224
  18 scummvm Titanic::CPetControl::KeyCharMsg(Titanic::CKeyCharMsg*) scummvm/engines/titanic/pet_control/pet_control.cpp:339
  19 scummvm Titanic::CMessage::perform(Titanic::CTreeItem*) scummvm/engines/titanic/messages/messages.cpp:107
  20 scummvm Titanic::CMessage::execute(Titanic::CTreeItem*, Titanic::ClassDef const*, int) scummvm/engines/titanic/messages/messages.cpp:60
  21 scummvm Titanic::CInputHandler::dispatchMessage(Titanic::CMessage*) scummvm/engines/titanic/input_handler.cpp:154
  22 scummvm Titanic::CInputHandler::processMessage(Titanic::CMessage*) scummvm/engines/titanic/input_handler.cpp:84
  23 scummvm Titanic::CInputHandler::handleMessage(Titanic::CMessage&, bool) scummvm/engines/titanic/input_handler.cpp:72
  24 scummvm Titanic::CInputTranslator::keyDown(Common::KeyState const&) scummvm/engines/titanic/input_translator.cpp:91
  25 scummvm Titanic::CMainGameWindow::keyDown(Common::KeyState) scummvm/engines/titanic/main_game_window.cpp:367
  26 scummvm Titanic::Events::pollEvents() scummvm/engines/titanic/events.cpp:95
  27 scummvm Titanic::Events::pollEventsAndWait() scummvm/engines/titanic/events.cpp:112
  28 scummvm Titanic::TitanicEngine::run() scummvm/engines/titanic/titanic.cpp:157
   2 libc++abi.dylib operator new(unsigned long)
   3 scummvm Titanic::TTstring::TTstring(char const*) scummvm/engines/titanic/true_talk/tt_string.cpp:32
   4 scummvm Titanic::TTconcept::TTconcept(Titanic::TTword*, Titanic::ScriptType) scummvm/engines/titanic/true_talk/tt_concept.cpp:56
   5 scummvm Titanic::TTparser::processModifiers(int, Titanic::TTword*) scummvm/engines/titanic/true_talk/tt_parser.cpp:1657
   6 scummvm Titanic::TTparser::considerRequests(Titanic::TTword*) scummvm/engines/titanic/true_talk/tt_parser.cpp:946
   7 scummvm Titanic::TTparser::processRequests(Titanic::TTword*) scummvm/engines/titanic/true_talk/tt_parser.cpp:1310
   8 scummvm Titanic::TTparser::findFrames(Titanic::TTsentence*) scummvm/engines/titanic/true_talk/tt_parser.cpp:515
   9 scummvm Titanic::CScriptHandler::processInput(Titanic::TTroomScript*, Titanic::TTnpcScript*, Titanic::TTstring const&) scummvm/engines/titanic/true_talk/script_handler.cpp:96
  10 scummvm Titanic::CTrueTalkManager::processInput(Titanic::CTrueTalkNPC*, Titanic::CTextInputMsg*, Titanic::CViewItem*) scummvm/engines/titanic/true_talk/true_talk_manager.cpp:334
  11 scummvm Titanic::CTrueTalkNPC::processInput(Titanic::CTextInputMsg*, Titanic::CViewItem*) scummvm/engines/titanic/npcs/true_talk_npc.cpp:232
  12 scummvm Titanic::CTrueTalkNPC::TextInputMsg(Titanic::CTextInputMsg*) scummvm/engines/titanic/npcs/true_talk_npc.cpp:83
  13 scummvm Titanic::CMessage::perform(Titanic::CTreeItem*) scummvm/engines/titanic/messages/messages.cpp:107
  14 scummvm Titanic::CMessage::execute(Titanic::CTreeItem*, Titanic::ClassDef const*, int) scummvm/engines/titanic/messages/messages.cpp:60
  15 scummvm Titanic::CPetConversations::textLineEntered(Titanic::CString const&) scummvm/engines/titanic/pet_control/pet_conversations.cpp:507
  16 scummvm Titanic::CPetConversations::handleKey(Common::KeyState const&) scummvm/engines/titanic/pet_control/pet_conversations.cpp:490
  17 scummvm Titanic::CPetConversations::KeyCharMsg(Titanic::CKeyCharMsg*) scummvm/engines/titanic/pet_control/pet_conversations.cpp:224
  18 scummvm Titanic::CPetControl::KeyCharMsg(Titanic::CKeyCharMsg*) scummvm/engines/titanic/pet_control/pet_control.cpp:339
  19 scummvm Titanic::CMessage::perform(Titanic::CTreeItem*) scummvm/engines/titanic/messages/messages.cpp:107
  20 scummvm Titanic::CMessage::execute(Titanic::CTreeItem*, Titanic::ClassDef const*, int) scummvm/engines/titanic/messages/messages.cpp:60
  21 scummvm Titanic::CInputHandler::dispatchMessage(Titanic::CMessage*) scummvm/engines/titanic/input_handler.cpp:154
  22 scummvm Titanic::CInputHandler::processMessage(Titanic::CMessage*) scummvm/engines/titanic/input_handler.cpp:84
  23 scummvm Titanic::CInputHandler::handleMessage(Titanic::CMessage&, bool) scummvm/engines/titanic/input_handler.cpp:72
  24 scummvm Titanic::CInputTranslator::keyDown(Common::KeyState const&) scummvm/engines/titanic/input_translator.cpp:91
  25 scummvm Titanic::CMainGameWindow::keyDown(Common::KeyState) scummvm/engines/titanic/main_game_window.cpp:367
  26 scummvm Titanic::Events::pollEvents() scummvm/engines/titanic/events.cpp:95
  27 scummvm Titanic::Events::pollEventsAndWait() scummvm/engines/titanic/events.cpp:112
  28 scummvm Titanic::TitanicEngine::run() scummvm/engines/titanic/titanic.cpp:157

comment:5 by dreammaster, 7 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.