CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.26k stars 4.11k forks source link

Segfault when complete NECC mission "Investigate the Center" #75921

Open cknight828 opened 3 weeks ago

cknight828 commented 3 weeks ago

Describe the bug

I got segfault when wait for finishing the activity "interacting with the NPC" after completing Investigate the Center. Canceling the activity prevents segfault. I experienced this crash also in 0.G. crash.log

Attach save file

necc-trimmed.tar.gz

Steps to reproduce

  1. Complete Investigate the Center
  2. Wait interacting with the NPC
  3. Crash

Expected behavior

No crash

Screenshots

No response

Versions and configuration

Additional context

debug.log

PatrikLundell commented 2 weeks ago

/Confirmed I think... Talking to the first set of Chinese glyphs wasn't it. Talking to the second set of glyphs allowed for a report of success of some unspecified mission followed by a couple of error messages about Stylish inconsistencies and a large floating point value processing and then an access violation in string_formatter.h class string_formatter operation read_conversion case 's'. It seems to try to parse "%s finishes with you...".

That string isn't found in JSON, but IS found in activity_handlers.cpp liine 3117 as you->add_msg_if_player(_("%s finishes with you..."), act->str_values[0]); and str_values is empty in activity_handlers.cpp operation activity_handlers::wait_npc_finish in the call stack. The activity doesn't provide any info allowing me to determine what it is supposed to be.

Edit: It's caused by the MISSION_GODCO_HELENA_VISIT_MERCHANTS mission in godco_missions.json. Removing the line { "u_assign_activity": "ACT_WAIT_NPC", "duration": "30 minutes" } causes the crash to not appear. I don't know what this is supposed to do, but a guess is that it's intended to waste time cooped up in a report meeting, but then crashing because there is nothing specifying who you're meeting with (it just happens to be triggered by talking so a specific person, but this part of the JSON can probably not access that info). I suspect the syntax shouldn't allow for the NPC subject not to be provided, but leave the solution of this to people who actually understand how this stuff is supposed to work.