View Single Post
Old July 19, 2017, 10:00   #2
AndreyB
Scout
 
Join Date: May 2017
Location: Russia
Posts: 26
AndreyB is on a distinguished road
To aid debugging I ran valgrind for you. Here is the part of it's output that seams relevant:

Code:
==4194== Invalid read of size 4
==4194==    at 0x4E653CD: SDL_FreeSurface (in /usr/lib64/libSDL-1.2.so.0.11.4)
==4194==    by 0x4EFD7E: init_windows (main-sdl.c:3402)
==4194==    by 0x4EE136: sdl_HandleEvent (main-sdl.c:2524)
==4194==    by 0x4EE3D7: Term_xtra_sdl_event (main-sdl.c:2615)
==4194==    by 0x4EE63A: Term_xtra_sdl (main-sdl.c:2719)
==4194==    by 0x4D6781: Term_xtra (ui-term.c:433)
==4194==    by 0x4D9806: Term_inkey (ui-term.c:2035)
==4194==    by 0x4B20E1: inkey_aux (ui-input.c:78)
==4194==    by 0x4B237F: inkey_ex (ui-input.c:254)
==4194==    by 0x4B2424: anykey (ui-input.c:289)
==4194==    by 0x4BCA6F: do_cmd_view_map (ui-map.c:794)
==4194==    by 0x4EF50D: Term_view_map_sdl (main-sdl.c:3144)
==4194==  Address 0x7477e84 is 84 bytes inside a block of size 88 free'd
==4194==    at 0x4C2ED4A: free (vg_replace_malloc.c:530)
==4194==    by 0x4EFD4C: init_windows (main-sdl.c:3398)
==4194==    by 0x4EE136: sdl_HandleEvent (main-sdl.c:2524)
==4194==    by 0x4EE3D7: Term_xtra_sdl_event (main-sdl.c:2615)
==4194==    by 0x4EE63A: Term_xtra_sdl (main-sdl.c:2719)
==4194==    by 0x4D6781: Term_xtra (ui-term.c:433)
==4194==    by 0x4D9806: Term_inkey (ui-term.c:2035)
==4194==    by 0x4B20E1: inkey_aux (ui-input.c:78)
==4194==    by 0x4B237F: inkey_ex (ui-input.c:254)
==4194==    by 0x4B2424: anykey (ui-input.c:289)
==4194==    by 0x4BCA6F: do_cmd_view_map (ui-map.c:794)
==4194==    by 0x4EF50D: Term_view_map_sdl (main-sdl.c:3144)
==4194==  Block was alloc'd at
==4194==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==4194==    by 0x4E6553B: SDL_CreateRGBSurface (in /usr/lib64/libSDL-1.2.so.0.11.4)
==4194==    by 0x4EEE48: sdl_BuildTileset (main-sdl.c:2995)
==4194==    by 0x4EEFB4: Term_pict_sdl (main-sdl.c:3045)
==4194==    by 0x4D7741: Term_fresh_row_both (ui-term.c:849)
==4194==    by 0x4D834A: Term_fresh (ui-term.c:1271)
==4194==    by 0x4D9003: Term_redraw (ui-term.c:1732)
==4194==    by 0x4EC3A7: ResizeWin (main-sdl.c:1814)
==4194==    by 0x4EFDAF: init_windows (main-sdl.c:3407)
==4194==    by 0x4EE136: sdl_HandleEvent (main-sdl.c:2524)
==4194==    by 0x4EE3D7: Term_xtra_sdl_event (main-sdl.c:2615)
==4194==    by 0x4EE63A: Term_xtra_sdl (main-sdl.c:2719)
There are a bunch of messages almost identical to this one. This is the first of them.
I ran valgrind 3 times and the output seams consistent. Attached all 3 complete outputs.
Comments:
The first few messages are printed during the initialization of the game and are probably false positives from the optimized sdl. The messages printed after the bug is triggered are below the (probably unrelated) error message about a missing sound.
Attached Files
File Type: zip logs.zip (8.6 KB, 35 views)
AndreyB is offline   Reply With Quote