Memory leak in persistence.cc while loading game

Bug #1815277 reported by GunChleoc
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Won't Fix
Undecided
GunChleoc

Bug Description

LSan reports a memory leak when loading a savegame.

To reproduce:

1. Start Widelands
2. Load a singleplayer savegame. Any win condition should trigger this except for endless game.
3. Leave game
4. Close Widelands

  #26 0x559cf5134a4e in unpersist_object(lua_State*, FileRead&, Widelands::MapObjectLoader&, unsigned int) ../src/scripting/persistence.cc:281
    #27 0x559cf5034d9c in LuaGameInterface::read_global_env(FileRead&, Widelands::MapObjectLoader&, unsigned int) ../src/scripting/logic.cc:166
    #28 0x559cf4df5596 in Widelands::MapScriptingPacket::read(FileSystem&, Widelands::EditorGameBase&, bool, Widelands::MapObjectLoader&) ../src/map_io/map_scripting_packet.cc:72
    #29 0x559cf486ecbd in Widelands::WidelandsMapLoader::load_map_complete(Widelands::EditorGameBase&, Widelands::MapLoader::LoadType) ../src/map_io/widelands_map_loader.cc:326

Tags: asan

Related branches

GunChleoc (gunchleoc)
Changed in widelands:
assignee: nobody → GunChleoc (gunchleoc)
status: New → In Progress
Revision history for this message
GunChleoc (gunchleoc) wrote :

I managed to fix 1 of 2 memory leaks in the attached branch: The remaining leak:

Direct leak of 128 byte(s) in 4 object(s) allocated from:
    #0 0x7f7c3fdd2f40 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdef40)
    #1 0x5617582dba7b in l_alloc ../src/third_party/eris/lauxlib.c:1015
    #2 0x5617582e8cb2 in luaM_realloc_ ../src/third_party/eris/lmem.c:86
    #3 0x5617582e3171 in luaF_initupvals ../src/third_party/eris/lfunc.c:48
    #4 0x5617582d29a1 in u_closure ../src/third_party/eris/eris.c:1603
    #5 0x5617582d46a2 in unpersist ../src/third_party/eris/eris.c:2307
    #6 0x5617582d3518 in u_thread ../src/third_party/eris/eris.c:1892
    #7 0x5617582d46be in unpersist ../src/third_party/eris/eris.c:2313
    #8 0x5617582d0d5d in u_literaltable ../src/third_party/eris/eris.c:1013
    #9 0x5617582d13ae in u_special ../src/third_party/eris/eris.c:1154
    #10 0x5617582d13f7 in u_table ../src/third_party/eris/eris.c:1167
    #11 0x5617582d4694 in unpersist ../src/third_party/eris/eris.c:2304
    #12 0x5617582d0d5d in u_literaltable ../src/third_party/eris/eris.c:1013
    #13 0x5617582d13ae in u_special ../src/third_party/eris/eris.c:1154
    #14 0x5617582d13f7 in u_table ../src/third_party/eris/eris.c:1167
    #15 0x5617582d4694 in unpersist ../src/third_party/eris/eris.c:2304
    #16 0x5617582d22ca in u_upval ../src/third_party/eris/eris.c:1426
    #17 0x5617582d46da in unpersist ../src/third_party/eris/eris.c:2319
    #18 0x5617582d2a72 in u_closure ../src/third_party/eris/eris.c:1617
    #19 0x5617582d46a2 in unpersist ../src/third_party/eris/eris.c:2307
    #20 0x5617582d0d5d in u_literaltable ../src/third_party/eris/eris.c:1013
    #21 0x5617582d13ae in u_special ../src/third_party/eris/eris.c:1154
    #22 0x5617582d13f7 in u_table ../src/third_party/eris/eris.c:1167
    #23 0x5617582d4694 in unpersist ../src/third_party/eris/eris.c:2304
    #24 0x5617582d50e1 in unchecked_unpersist ../src/third_party/eris/eris.c:2558
    #25 0x5617582d59e3 in eris_undump ../src/third_party/eris/eris.c:2742
    #26 0x5617581f92d2 in unpersist_object(lua_State*, FileRead&, Widelands::MapObjectLoader&, unsigned int) ../src/scripting/persistence.cc:281
    #27 0x5617580f9524 in LuaGameInterface::read_global_env(FileRead&, Widelands::MapObjectLoader&, unsigned int) ../src/scripting/logic.cc:166
    #28 0x561757eb9cfc in Widelands::MapScriptingPacket::read(FileSystem&, Widelands::EditorGameBase&, bool, Widelands::MapObjectLoader&) ../src/map_io/map_scripting_packet.cc:72
    #29 0x561757933267 in Widelands::WidelandsMapLoader::load_map_complete(Widelands::EditorGameBase&, Widelands::MapLoader::LoadType) ../src/map_io/widelands_map_loader.cc:326

GunChleoc (gunchleoc)
Changed in widelands:
milestone: build20-rc1 → build21-rc1
Revision history for this message
GunChleoc (gunchleoc) wrote :
Changed in widelands:
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.