Thread: Angband 4.2.0
View Single Post
Old September 19, 2019, 17:39   #143
backwardsEric
Rookie
 
Join Date: Aug 2019
Posts: 13
backwardsEric is on a distinguished road
segmentation fault in hit_trap()

With 4.2.0 on Mac OS X 10.14.6, walking into an unseen trap triggered a segmentation fault. It was in a checkerboard half pillar room on level 4. The end of the call stack reported by Apple's crash reporter was:

Code:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   org.rephial.angband           	0x00000001090e50f7 hit_trap + 583
1   org.rephial.angband           	0x000000010909b68a monster_swap + 522
2   org.rephial.angband           	0x0000000109052b7d move_player + 621
3   org.rephial.angband           	0x0000000109052eae do_cmd_walk + 318
4   org.rephial.angband           	0x0000000109053f41 process_command + 369
5   org.rephial.angband           	0x00000001090540ef cmdq_pop + 111
6   org.rephial.angband           	0x0000000109063af9 process_player + 377
7   org.rephial.angband           	0x0000000109063e8e run_game_loop + 46
8   org.rephial.angband           	0x00000001090efe32 play_game + 258
Using the save file with a version compiled with debugging symbols indicates the trap is an ancient mechanism. What seems to be happening is the initial effect_do() gets called. Then when the extra effects of the trap are evaluated, the contents of *trap are no longer valid (from the initial effect_do()?) setting the stage for a crash.

Edited for extra information from debugging and replaced "hitting" with "walking into" for clarity.

Last edited by backwardsEric; September 19, 2019 at 18:59.
backwardsEric is offline   Reply With Quote