iiag / iiag-legacy

Iiag is a game
Other
7 stars 7 forks source link

Memory corruption issues #23

Closed BahaVv closed 10 years ago

BahaVv commented 10 years ago

iiag currently exits with a core dump, and a memory trace. I'm including a valgrind log to hopefully make it easier to fix this.

==27055== Memcheck, a memory error detector ==27055== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==27055== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info ==27055== Command: ./iiag ==27055== ==27055== Invalid write of size 1 ==27055== at 0x4C2B8B3: strcat (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==27055== by 0x40C4B6: load_syl (names.c:22) ==27055== by 0x40C676: load_ethnicity (names.c:57) ==27055== by 0x40287E: assure_world (world.c:58) ==27055== by 0x40D7EB: lcf_creature (form.c:149) ==27055== by 0x53A8D5C: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53B4123: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53A90C8: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53A52C7: lua_callk (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53B839F: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53A8D5C: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53B4123: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== Address 0x5b96f0b is 0 bytes after a block of size 27 alloc'd ==27055== at 0x4C28750: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==27055== by 0x40C45A: load_syl (names.c:17) ==27055== by 0x40C676: load_ethnicity (names.c:57) ==27055== by 0x40287E: assure_world (world.c:58) ==27055== by 0x40D7EB: lcf_creature (form.c:149) ==27055== by 0x53A8D5C: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53B4123: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53A90C8: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53A52C7: lua_callk (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53B839F: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53A8D5C: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53B4123: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== ==27055== Syscall param open(filename) points to unaddressable byte(s) ==27055== at 0x56AA590: open_nocancel (in /usr/lib/libc-2.19.so) ==27055== by 0x5643B01: _IO_file_open (in /usr/lib/libc-2.19.so) ==27055== by 0x5643C8F: _IO_file_fopen@@GLIBC_2.2.5 (in /usr/lib/libc-2.19.so) ==27055== by 0x5638C83: fopen_internal (in /usr/lib/libc-2.19.so) ==27055== by 0x40C4D3: load_syl (names.c:26) ==27055== by 0x40C676: load_ethnicity (names.c:57) ==27055== by 0x40287E: assure_world (world.c:58) ==27055== by 0x40D7EB: lcf_creature (form.c:149) ==27055== by 0x53A8D5C: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53B4123: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53A90C8: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53A52C7: lua_callk (in /usr/lib/liblua.so.5.2.3) ==27055== Address 0x5b96f0b is 0 bytes after a block of size 27 alloc'd ==27055== at 0x4C28750: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==27055== by 0x40C45A: load_syl (names.c:17) ==27055== by 0x40C676: load_ethnicity (names.c:57) ==27055== by 0x40287E: assure_world (world.c:58) ==27055== by 0x40D7EB: lcf_creature (form.c:149) ==27055== by 0x53A8D5C: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53B4123: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53A90C8: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53A52C7: lua_callk (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53B839F: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53A8D5C: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== by 0x53B4123: ??? (in /usr/lib/liblua.so.5.2.3) ==27055== ==27055== Invalid read of size 8 ==27055== at 0x40E215: deinit_commands (commands.c:95) ==27055== by 0x402774: main (main.c:135) ==27055== Address 0x5e31ed0 is 8 bytes after a block of size 600 alloc'd ==27055== at 0x4C28750: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==27055== by 0x40DEFA: init_commands (commands.c:45) ==27055== by 0x40262E: main (main.c:87) ==27055== ==27055== ==27055== HEAP SUMMARY: ==27055== in use at exit: 2,044,360 bytes in 9,641 blocks ==27055== total heap usage: 10,253 allocs, 612 frees, 2,128,772 bytes allocated ==27055== ==27055== LEAK SUMMARY: ==27055== definitely lost: 135 bytes in 5 blocks ==27055== indirectly lost: 0 bytes in 0 blocks ==27055== possibly lost: 0 bytes in 0 blocks ==27055== still reachable: 2,044,225 bytes in 9,636 blocks ==27055== suppressed: 0 bytes in 0 blocks ==27055== Rerun with --leak-check=full to see details of leaked memory ==27055== ==27055== For counts of detected and suppressed errors, rerun with: -v ==27055== ERROR SUMMARY: 12 errors from 11 contexts (suppressed: 1 from 1)

sjrct commented 10 years ago

Should be fixed