Issue690

Title ASAN crash while reloading savegame.
Priority release-blocker Status resolved
Assigned To fluzz Keywords
Linked issues Watchers fluzz

Submitted on 2013-09-19 13h58 by matthiaskrgr, last changed by fluzz.

Messages
Author: matthiaskrgr Date: 2013-09-19   13h58
Was in the tutorial, tried to load previous or backup (don't remember) savegame
and it crashed:

INFO: AddressSanitizer ignores mlock/mlockall/munlock/munlockall
^[a=================================================================
==12717== ERROR: AddressSanitizer: attempting free on address which was not
malloc()-ed: 0x6036001da940
    #0 0x7fec3e02f47a (/usr/lib/libasan.so.0.0.0+0x1547a)
    #1 0x7fec3d02ea98 (/usr/lib/liblua.so.5.2.1+0x19a98)
0x6036001da940 is located 0 bytes inside of 22-byte region
[0x6036001da940,0x6036001da956)
==12717== AddressSanitizer CHECK failed:
/build/gcc-multilib/src/gcc-4.8-20130725/libsanitizer/asan/asan_thread_registry.cc:153
"((tid < n_threads_)) != (0)" (0x0, 0x0)
    #0 0x7fec3e02c44d (/usr/lib/libasan.so.0.0.0+0x1244d)
    #1 0x7fec3e033283 (/usr/lib/libasan.so.0.0.0+0x19283)
    #2 0x7fec3e02d9f8 (/usr/lib/libasan.so.0.0.0+0x139f8)
    #3 0x7fec3e030f51 (/usr/lib/libasan.so.0.0.0+0x16f51)
    #4 0x7fec3e031883 (/usr/lib/libasan.so.0.0.0+0x17883)
    #5 0x7fec3e022b3f (/usr/lib/libasan.so.0.0.0+0x8b3f)
    #6 0x7fec3e02f4a7 (/usr/lib/libasan.so.0.0.0+0x154a7)
    #7 0x7fec3d02ea98 (/usr/lib/liblua.so.5.2.1+0x19a98)
    #8 0x7fec3d02613c (/usr/lib/liblua.so.5.2.1+0x1113c)
    #9 0x7fec3d02a0cf (/usr/lib/liblua.so.5.2.1+0x150cf)
    #10 0x7fec3d02321f (/usr/lib/liblua.so.5.2.1+0xe21f)
    #11 0x7fec3d0248d1 (/usr/lib/liblua.so.5.2.1+0xf8d1)
    #12 0x7fec3d029c9d (/usr/lib/liblua.so.5.2.1+0x14c9d)
    #13 0x44851b (/home/matthias/vcs/git/freedroid/src/freedroidRPG+0x44851b)
    #14 0x437490 (/home/matthias/vcs/git/freedroid/src/freedroidRPG+0x437490)
    #15 0x41a084 (/home/matthias/vcs/git/freedroid/src/freedroidRPG+0x41a084)
    #16 0x41bd83 (/home/matthias/vcs/git/freedroid/src/freedroidRPG+0x41bd83)
    #17 0x41e1fd (/home/matthias/vcs/git/freedroid/src/freedroidRPG+0x41e1fd)
    #18 0x4ac769 (/home/matthias/vcs/git/freedroid/src/freedroidRPG+0x4ac769)
    #19 0x4accb5 (/home/matthias/vcs/git/freedroid/src/freedroidRPG+0x4accb5)
    #20 0x4a8b57 (/home/matthias/vcs/git/freedroid/src/freedroidRPG+0x4a8b57)
    #21 0x4ae6e6 (/home/matthias/vcs/git/freedroid/src/freedroidRPG+0x4ae6e6)
    #22 0x415c99 (/home/matthias/vcs/git/freedroid/src/freedroidRPG+0x415c99)
    #23 0x7fec3c577bc4 (/usr/lib/libc-2.18.so+0x21bc4)
    #24 0x41644c (/home/matthias/vcs/git/freedroid/src/freedroidRPG+0x41644c)


addr2line -e ./src/freedroidRPG 0x44851b 0x437490 0x41a084 0x41bd83 0x41e1fd
0x4ac769 0x4accb5 0x4a8b57 0x4ae6e6 0x415c99 0x41644c     matthias@t400 99.9
/home/matthias/vcs/git/freedroid/src/lua.c:1889
/home/matthias/vcs/git/freedroid/src/saveloadgame.c:351
/home/matthias/vcs/git/freedroid/src/menu.c:949
/home/matthias/vcs/git/freedroid/src/menu.c:735
/home/matthias/vcs/git/freedroid/src/menu.c:764
/home/matthias/vcs/git/freedroid/src/keyboard.c:681
/home/matthias/vcs/git/freedroid/src/keyboard.c:818
/home/matthias/vcs/git/freedroid/src/input.c:119
/home/matthias/vcs/git/freedroid/src/main.c:89
/home/matthias/vcs/git/freedroid/src/main.c:182


c6c1c71f24d429e55afec847f59a177f179656d4 + soft code changes
Author: jesusalva Date: 2014-08-30   14h44
It's saying that somewhere on the code there was a free() call but whatever it
tried to free was not yet allocated w/ malloc().

It also printed the memory address so any pro-mega-ultra-expert on FDRPG code
can locate which memory address (variable) you tried to free.

Please make also sure that the backup/latest was not from an old commit of
FDRPG! In this case it's very possible to happen: Although I would expect worse,
I admit.

BTW, can you reproduce the bug at any time? Can you save the game again? Can you
load the latest saved game after you save the game again? etc etc etc...
Author: fluzz Date: 2014-09-08   16h25
This was fixed in b1a73aebeba (Oct. 16 2013).
We forgot to close the ticket at that time.
History
Date User Action Args
2014-09-08 16:25:09fluzzsetstatus: open -> resolved
assignedto: fluzz
messages: + msg2891
nosy: + fluzz
2014-08-30 14:44:59jesusalvasetmessages: + msg2878
2014-08-29 15:22:32Xenuxsetpriority: important -> release-blocker
2013-09-19 13:58:57matthiaskrgrcreate