Issue816

Title editor: memleak cut and pasting items
Priority bug Status open
Assigned To Keywords
Linked issues Watchers

Submitted on 2015-06-03 19h26 by matthiaskrgr, last changed by matthiaskrgr.

Messages
Author: matthiaskrgr Date: 2015-06-03   19h26
select some obstacles, cut, paste, =>

Direct leak of 10920 byte(s) in 455 object(s) allocated from:
    #0 0x7f4f5c31ab79 in __interceptor_calloc
/build/gcc-multilib/src/gcc-5-20150519/libsanitizer/asan/asan_malloc_linux.cc:54
    #1 0x4e4862 in MyMalloc /home/matthias/vcs/git/freedroid/src/text_public.c:68
    #2 0x5ea247 in level_editor_copy_selection lvledit/lvledit_tool_select.c:992
    #3 0x5ed68a in level_editor_cut_selection lvledit/lvledit_tool_select.c:1189
    #4 0x51360a in input_key /home/matthias/vcs/git/freedroid/src/keyboard.c:747
    #5 0x5141f8 in input_key_event
/home/matthias/vcs/git/freedroid/src/keyboard.c:804
    #6 0x5144a4 in input_key_press
/home/matthias/vcs/git/freedroid/src/keyboard.c:821
    #7 0x50b1e8 in input_handle /home/matthias/vcs/git/freedroid/src/input.c:119
    #8 0x5b77dc in leveleditor_process_input lvledit/lvledit_input.c:186
    #9 0x5a22f2 in LevelEditor lvledit/lvledit.c:282
    #10 0x514bb7 in main /home/matthias/vcs/git/freedroid/src/main.c:188
    #11 0x7f4f59ccb78f in __libc_start_main (/usr/lib/libc.so.6+0x2078f)

@ f96377ec3b90dfacc5dcd3b19a9232f8998a71b7
Author: matthiaskrgr Date: 2016-04-10   20h55
Still occurs ( c0d13df8537eade30e4781f2887caa808bbea440 ).
The memleak happens while cutting a single obstacle (the more you cut, the 
bigger the leak).

updated stacktrace:

Direct leak of 48 byte(s) in 2 object(s) allocated from:
    #0 0x4c36a1 in __interceptor_calloc 
/home/matthias/LLVM/LLVM_pure/stage_2/llvm/projects/compiler-
rt/lib/asan/asan_malloc_linux.cc:66:3
    #1 0x69cee5 in MyMalloc 
/home/matthias/vcs/git/freedroid/src/text_public.c:68:14
    #2 0x71ab4a in level_editor_copy_selection 
/home/matthias/vcs/git/freedroid/src/lvledit/lvledit_tool_select.c:992:8
    #3 0x722678 in level_editor_cut_selection 
/home/matthias/vcs/git/freedroid/src/lvledit/lvledit_tool_select.c:1189:2
    #4 0x5e6496 in input_key 
/home/matthias/vcs/git/freedroid/src/keyboard.c:749:4
    #5 0x5e37ce in input_key_event 
/home/matthias/vcs/git/freedroid/src/keyboard.c:806:21
    #6 0x5e37ce in input_key_press 
/home/matthias/vcs/git/freedroid/src/keyboard.c:823
    #7 0x5bf9a3 in input_handle 
/home/matthias/vcs/git/freedroid/src/input.c:119:4
    #8 0x6fdb96 in leveleditor_process_input 
/home/matthias/vcs/git/freedroid/src/lvledit/lvledit_input.c:186:2
    #9 0x6e1e47 in LevelEditor 
/home/matthias/vcs/git/freedroid/src/lvledit/lvledit.c:282:3
    #10 0x60fc02 in main /home/matthias/vcs/git/freedroid/src/main.c:183:4
    #11 0x7f627040d57f in __libc_start_main (/lib64/libc.so.6+0x2057f)
Author: matthiaskrgr Date: 2016-04-10   20h56
Direct leak of 48 byte(s) in 2 object(s) allocated from:
    #0 0x4c36a1 in __interceptor_calloc /home/matthias/LLVM/LLVM_pure/stage_2/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:66:3
    #1 0x69cee5 in MyMalloc /home/matthias/vcs/git/freedroid/src/text_public.c:68:14
    #2 0x71ab4a in level_editor_copy_selection /home/matthias/vcs/git/freedroid/src/lvledit/lvledit_tool_select.c:992:8
    #3 0x722678 in level_editor_cut_selection /home/matthias/vcs/git/freedroid/src/lvledit/lvledit_tool_select.c:1189:2
    #4 0x5e6496 in input_key /home/matthias/vcs/git/freedroid/src/keyboard.c:749:4
    #5 0x5e37ce in input_key_event /home/matthias/vcs/git/freedroid/src/keyboard.c:806:21
    #6 0x5e37ce in input_key_press /home/matthias/vcs/git/freedroid/src/keyboard.c:823
    #7 0x5bf9a3 in input_handle /home/matthias/vcs/git/freedroid/src/input.c:119:4
    #8 0x6fdb96 in leveleditor_process_input /home/matthias/vcs/git/freedroid/src/lvledit/lvledit_input.c:186:2
    #9 0x6e1e47 in LevelEditor /home/matthias/vcs/git/freedroid/src/lvledit/lvledit.c:282:3
    #10 0x60fc02 in main /home/matthias/vcs/git/freedroid/src/main.c:183:4
    #11 0x7f627040d57f in __libc_start_main (/lib64/libc.so.6+0x2057f)

(somehow formatting got messed up)
Author: fluzz Date: 2017-02-18   20h13
There is no more memleak for obstacles, afaik.
Memleak with waypoints was fixed in commit 24c832f

There is still a memleak for items.
Other kind of objects have to be checked.
History
Date User Action Args
2017-02-21 21:57:38matthiaskrgrsettitle: editor: memleak cut and pasting obstacles -> editor: memleak cut and pasting items
2017-02-18 20:13:44fluzzsetmessages: + msg3409
2016-04-10 20:56:31matthiaskrgrsetmessages: + msg3329
2016-04-10 20:55:54matthiaskrgrsetmessages: + msg3328
2015-06-03 19:26:04matthiaskrgrcreate