Issue677

Title game crashes if shop has a lot of items.
Priority feature Status open
Assigned To Keywords
Linked issues Watchers

Submitted on 2013-08-23 07h57 by matthiaskrgr, last changed by Xenux.

Files
File name Uploaded Type Edit Remove
dudeshop.patch matthiaskrgr, 2013-08-23.07:57:57 text/x-diff
Messages
Author: matthiaskrgr Date: 2013-08-23   07h57
Maybe it is related to a special item, I don't know.
Apply the attached patch and
a) open the editor, playtest => crash

print_trace:  Obtained 17 stack frames.
print_trace:  Obtaining symbols now done.
./src(print_trace+0x12) [0x440432]
/usr/lib/libpthread.so.0(+0xf830) [0x7f51006f8830]
/usr/lib/libc.so.6(_IO_vfprintf+0x1bf2) [0x7f5100129202]
/usr/lib/libc.so.6(vsnprintf+0x79) [0x7f5100153129]
./src() [0x46882e]
./src(autostr_append+0x8e) [0x468aae]
./src(write_string_array+0x3f) [0x460bef]
./src(write_npc+0x7e) [0x46301e]
./src(save_game_data+0x11a) [0x46859a]
./src(SaveGame+0x223) [0x4213e3]
./src(TestMap+0x23) [0x470da3]
./src(DoLevelEditorMainMenu+0xac8) [0x477768]
./src(leveleditor_process_input+0x6e1) [0x475791]
./src(LevelEditor+0x35) [0x470e05]
./src(main+0x155) [0x4149b5]
/usr/lib/libc.so.6(__libc_start_main+0xf5) [0x7f5100102bc5]
./src() [0x414a6d]


addr2line -e ./src/freedroidRPG 0x46882e 0x468aae 0x460bef 0x46301e 0x46859a
0x4213e3 0x470da3 0x477768 0x475791 0x470e05 0x4149b5 0x414a6d
/home/matthias/vcs/git/freedroid/src/string.c:95
/home/matthias/vcs/git/freedroid/src/string.c:138
/home/matthias/vcs/git/freedroid/src/savestruct.c:1934 (discriminator 2)
/home/matthias/vcs/git/freedroid/src/savestruct.c:1183
/home/matthias/vcs/git/freedroid/src/savestruct_internal.c:545 (discriminator 2)
/home/matthias/vcs/git/freedroid/src/saveloadgame.c:289
/home/matthias/vcs/git/freedroid/src/lvledit/lvledit.c:251
/home/matthias/vcs/git/freedroid/src/lvledit/lvledit_menu.c:1091
/home/matthias/vcs/git/freedroid/src/lvledit/lvledit_input.c:193
/home/matthias/vcs/git/freedroid/src/lvledit/lvledit.c:282
/home/matthias/vcs/git/freedroid/src/main.c:185
??:?



or b) start the game as freedroidRPG -e, then to back to the main menu and
launch the editor from there => crash


print_trace:  Obtained 13 stack frames.
print_trace:  Obtaining symbols now done.
./src(print_trace+0x12) [0x440432]
/usr/lib/libpthread.so.0(+0xf830) [0x7f25dc257830]
/usr/lib/libc.so.6(cfree+0x14) [0x7f25dbcbc094]
./src(clear_npcs+0x5d) [0x46a01d]
./src(clear_out_arrays_for_fresh_game+0x6f) [0x432a7f]
./src(PrepareStartOfNewCharacter+0x12) [0x433fa2]
./src(prepare_level_editor+0x43) [0x434123]
./src() [0x417f2d]
./src() [0x416dda]
./src(StartupMenu+0x43) [0x417fc3]
./src(main+0x135) [0x414995]
/usr/lib/libc.so.6(__libc_start_main+0xf5) [0x7f25dbc61bc5]
./src() [0x414a6d]

print_trace():  received SIGSEGV!



addr2line -e ./src/freedroidRPG 0x440432 0x46a01d 0x432a7f 0x433fa2 0x434123
0x417f2d 0x416dda 0x417fc3 0x414995 0x414a6d
/home/matthias/vcs/git/freedroid/src/misc.c:387
/home/matthias/vcs/git/freedroid/src/npc.c:96
/home/matthias/vcs/git/freedroid/src/init.c:86
/home/matthias/vcs/git/freedroid/src/init.c:826
/home/matthias/vcs/git/freedroid/src/init.c:881
/home/matthias/vcs/git/freedroid/src/menu.c:798
/home/matthias/vcs/git/freedroid/src/menu.c:735
/home/matthias/vcs/git/freedroid/src/menu.c:771
/home/matthias/vcs/git/freedroid/src/main.c:176
??:?



commit cd02a57ffaa724cbc037ffb196ff2c830cd52e2e

Attached dudeshop.patch.
Author: Xenux Date: 2013-08-24   09h02
Shop are limited to 100 item. It's not a bug.
Author: matthiaskrgr Date: 2013-08-24   09h12
hmmm
I had changed MAX_ITEMS_IN_NPC_SHOPLIST from 50 to 200, is there something else
I missed?
Author: Xenux Date: 2013-08-30   23h26
We can remove the limit later on.
History
Date User Action Args
2013-08-30 23:26:46Xenuxsetmessages: + msg2543
2013-08-24 09:12:30matthiaskrgrsetmessages: + msg2523
2013-08-24 09:02:14Xenuxsetpriority: bug -> feature
messages: + msg2521
2013-08-23 07:57:57matthiaskrgrcreate