Cataclysm-dda: Segmentation Fault when teleporting

Created on 12 Apr 2019  路  8Comments  路  Source: CleverRaven/Cataclysm-DDA

Describe the bug
The game instantly crashes with a segment fault when using the long distance debug teleport. This isn't game breaking and will probably never happen during a normal play session. But not being able to teleport around in Debug Mode is pretty inconvenient.

To Reproduce
Steps to reproduce the behavior:

  1. Teleport somewhere with the Debug Menu

Screenshots
image

Versions and configuration(please complete the following information):

  • OS: Win 10
  • Game Version: Expirimental Build 8765
  • Graphics version: Tiles
  • Mods loaded: Defaults
(S2 - Confirmed) <Bug> <Crash / Freeze> Character / Player

All 8 comments

Probably a duplicate of #29049 (see @Ilysen comment here which is also about a crash while teleporting).

I was going to make a post about this later today until I saw this this. Getting a mostly similar crash report (see the crash log attached), but its not just from teleporting around for me. This crash occurs when attempting to open the (m)ap and moving around for a few turns as well with the long teleport. I somehow found a work around yesterday in-game and thought nothing else about this crash after that. Only now when loading my save does attempting to do of the listed actions will end up making the game have the same crash log after a few seconds of play. If this is different enough from this issue then I can make a separate post and go over it in more detail.

crash.log

@Zachert45 If it involves a crash while (or just after) opening the map then it might be related to #29472.

@neitsa I think you are right about that, I never thought to test (m)ap until the middle of writing my original post, I think my issue is more along that issue line than this one, sorry for the confusion and thanks for the clarification for on my end.

Did a quick review of the binary for this crash using the crash log provided in the OP. I can't really explain the bug though. Also note that I haven't triggered the bug on my side, it is just an analysis of the root cause.

Here how the stack trace goes (read from bottom to top);

  • The last cata function is in red
  • The green functions are the CRT (C Runtime) functions
  • In blue are the system crash handler (+ cata crash handler at the very end).

image

If you look at the last cata function (in red) you can see that the address of this last function call is 0x66738E (note: stack traces always point after the problematic call).

Here is the assembly version:

.text:0000000000667378                 mov     rcx, cs:qword_187C168
.text:000000000066737F                 lea     rdx, aBoth      ; "both"
.text:0000000000667386                 mov     r12, rax
.text:0000000000667389                 call    std::__cxx11::basic_string<char,std::char_traits<char>,std::allocator<char>>::compare(char const*) // CRASH HERE!!!
.text:000000000066738E                 test    eax, eax

The bug happens in game::place_player(game *this) :

https://github.com/CleverRaven/Cataclysm-DDA/blob/46f5ee42e52f9f380c0eb3679ebc99713c80e8cd/src/game.cpp#L10553-L10560

On this line:

                const bool forage_everything = forage_type == "both";

The stack trace leads to memcmp() (called from std::string::compare() so I guess a pointer is either bogus or null.

@Substance455 : can you please upload your config folder (zipped)? (if you haven't changed anything since the teleport crash). You can zip it and drag and drop it while answering.

If not, can you tell me if, in the game options (General), you have:

  • Additional auto features set to True
  • What is the value for Auto Foraging option?

Also, did you use Teleport Short or Long range?

Many thanks :)

config.zip
image

Here ya go. I'm sorry it took me so long. I toggle the auto features frequently and I have a pretty large auto-pickup list.

No problem @Substance455! Thanks a lot for your help , this will be helpful.

Was this page helpful?
0 / 5 - 0 ratings