Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPC reading crash #35642

Closed
CHJKDM51 opened this issue Nov 21, 2019 · 14 comments
Closed

NPC reading crash #35642

CHJKDM51 opened this issue Nov 21, 2019 · 14 comments
Labels
<Bug> This needs to be fixed [C++] Changes (can be) made in C++. Previously named `Code` <Crash / Freeze> Fatal bug that results in hangs or crashes. NPC / Factions NPCs, AI, Speech, Factions, Ownership

Comments

@CHJKDM51
Copy link

CHJKDM51 commented Nov 21, 2019

Describe the bug

I told NPC to study from a book and left my base for a couple game days. Now when I'm trying to approach my base it crashes the game.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Load save.
  2. Walk south-east.
  3. Get crash.

Expected behavior

Versions and configuration

  • OS: Windows
    • OS Version: 10.0 1903
  • Game Version: 0.D-9511-g32e0c35 [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food]
    ]

Additional context

1)Ingame message:

DEBUG : Lost target of ACT_READ

FUNCTION : void activity_handlers::read_finish(player_activity*, player*)
FILE : src/activity_handlers.cpp
LINE : 2910

2)Error message:

CRASH LOG FILE: config/crash.log
VERSION: 0.D-9511-g32e0c35
TYPE: Signal
MESSAGE: SIGSEGV: Segmentation fault
STACK TRACE:
@0x5D3A25[cataclysm-tiles.exe+0x1D3A25]
@0x5D44F2[cataclysm-tiles.exe+0x1D44F2]
SMPEG_error+0x4B034@0xFBAEB0[cataclysm-tiles.exe+0xBBAEB0]
_C_specific_handler+0x98@0x7FFAB6398048[msvcrt.dll+0x28048]
_chkstk+0x11F@0x7FFAB71611FF[ntdll.dll+0xA11FF]
RtlRaiseException+0x399@0x7FFAB712A289[ntdll.dll+0x6A289]
KiUserExceptionDispatcher+0x2E@0x7FFAB715FE6E[ntdll.dll+0x9FE6E]
@0xB6BAE3[cataclysm-tiles.exe+0x76BAE3]
@0x4505C0[cataclysm-tiles.exe+0x505C0]
@0xCCD82A[cataclysm-tiles.exe+0x8CD82A]
@0xB865DD[cataclysm-tiles.exe+0x7865DD]
@0xB99B54[cataclysm-tiles.exe+0x799B54]
@0xB9D601[cataclysm-tiles.exe+0x79D601]
@0x70D582[cataclysm-tiles.exe+0x30D582]
@0x70ED1C[cataclysm-tiles.exe+0x30ED1C]
IMG_LoadWEBP_RW+0x62F11C@0x16DBE3C[cataclysm-tiles.exe+0x12DBE3C]
@0x4013ED[cataclysm-tiles.exe+0x13ED]
@0x4014FB[cataclysm-tiles.exe+0x14FB]
BaseThreadInitThunk+0x14@0x7FFAB6AC7BD4[KERNEL32.DLL+0x17BD4]
RtlUserThreadStart+0x21@0x7FFAB712CED1[ntdll.dll+0x6CED1]

3)log files:
crash+debug.zip

4)save:
https://drive.google.com/open?id=12Kt93brFDjesQ-DXdfv_fr5_okba2aml

P.S. Any advice how to skip that error and continue playing? If it is possible in the first place.

@Funguss
Copy link
Contributor

Funguss commented Nov 21, 2019

Have you updated the game? It sounds like this:
#35593
Related to this:
#35352
If so, then the best way to deal with it is probably to long-range teleport to their location, talk to the NPC(s) then tell them to stop their current activity. You can get them reading again afterwards and it should be fine.

@CHJKDM51
Copy link
Author

Yes I'm updating game almost every day IRL.
Long range teleport to npc location gives same crash.

@Vollinger
Copy link
Contributor

Try replacing save\Knoxville\o.0.0 with this one, I changed ACT_READ to ACT_NULL, should make your crashy readers back to followers. Have a backup, just in case.
Knoxville_stop_reading.zip

Log says it's version 0.D-9511, over a month old now, sure you're not launching some old misplaced exe or something?

@mlangsdorf mlangsdorf added <Bug> This needs to be fixed NPC / Factions NPCs, AI, Speech, Factions, Ownership [C++] Changes (can be) made in C++. Previously named `Code` <Crash / Freeze> Fatal bug that results in hangs or crashes. labels Nov 22, 2019
@CHJKDM51
Copy link
Author

Log says it's version 0.D-9511, over a month old now, sure you're not launching some old misplaced exe or something?

It was actually 9918 (latest version at the moment of posting). I assume "game version" and "build" is not the same?

Editing save fixed it, thanks!

@ghost
Copy link

ghost commented Nov 23, 2019

This can be closed now?

@eltank
Copy link
Contributor

eltank commented Nov 25, 2019

I can reproduce this bug by asking an NPC to read a book, then waiting half an hour. Same debug message, then segfault. I'll try to figure out which build introduced the bug.

@Funguss
Copy link
Contributor

Funguss commented Nov 25, 2019

Hmm... No such problems for me. What version are you using?

@eltank
Copy link
Contributor

eltank commented Nov 25, 2019

Build 9907 is fine. Build 9908 triggers the bug.
https://ci.narc.ro/job/Cataclysm-Multijob/9908/
Looks like #35538 has something to do with it.

@eltank
Copy link
Contributor

eltank commented Nov 25, 2019

A couple more observations:

  1. I cannot reproduce this with a new game world at 9908 or 9928
  2. If I load a save made after updating to 9928 in my old game world then downgrading to 9900 I also get a crash
    So I probably need to debug my save file and see what got messed up. But I expect that other players who have been playing experimental for a while to also experience this bug under certain (unknown) conditions after updating their game.

@eltank
Copy link
Contributor

eltank commented Nov 25, 2019

Figured it out. If your pre-9908 save has any NPCs that are reading and you update the game you may get a crash when they finish the activity (like the OP). The workaround is to cancel the reading activity (either by talking to the NPC or hacking the save file). Reading activities that are started after updating seem fine.

@Funguss
Copy link
Contributor

Funguss commented Nov 25, 2019

Yeeeees. You probably should have looked at the issues I mentioned in the first comment. In the first issue linked I had commented about this and explained how to sort it out, bar save editing. That is precisely why I linked to it. I suggested teleporting in order to deal with NPCs who are too far away for you to stop.
I hope you didn't spend too much time on this. Do have a look at the linked issues in future, generally speaking they're included for your benefit.

@eltank
Copy link
Contributor

eltank commented Nov 25, 2019

Thank you Funguss, your post was very helpful; I just failed to scroll down and read the pertinent information. Thus I ended up re-discovering what was mentioned in #35593.
Oh well, at least this provides some confirmation. I do believe this bug can be closed since it's infeasible to fix but there is a workaround.

@Funguss
Copy link
Contributor

Funguss commented Nov 25, 2019

No worries, it happens to us all. Yeah, the issue is only really going to hit those updating their game with an ongoing world in which an NPC is reading. I doubted anybody else would have it but here we are! There will probably be another bug report about this in a month or two or something ludicrous whether this gets closed or not. As it only occurs to updated worlds I do believe this should be closed, plus it's easy enough to workaround.

@ghost
Copy link

ghost commented Nov 25, 2019

Yep, depending on how prevalent and serious a bug is that has been caused by saving during a period of bugged experimental, a fix can be made to try and repair the save on load, but I expect this particular one to be minimal and have no further occurences after a while.

@ghost ghost closed this as completed Nov 25, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed [C++] Changes (can be) made in C++. Previously named `Code` <Crash / Freeze> Fatal bug that results in hangs or crashes. NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

No branches or pull requests

5 participants