Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Crash log not generated after abrupt termination

Open jtmusky opened this issue 1 year ago • 10 comments
trafficstars

Describe the bug

crash.log file is either missing or not generated after abrupt termination.

Attach save file

N/A

Steps to reproduce

  1. Create a new custom character
  2. pick world
  3. use default pool type
  4. tab to "scenario" Crashes at this point

navigate to ~/Library/Application Support/Cataclysm/config crash.log file is missing

Expected behavior

Expect a crash.log file

Screenshots

No response

Versions and configuration

OSX 14.4.1 game version osx-curses: 0.H Release Candidate, Build 8985D54

Additional context

No response

jtmusky avatar May 12 '24 19:05 jtmusky

Terminal shows: LIBC++ABI: Terminating due to uncaught exception of type IO::INVALIDENUMSTRING: INVALID ENUM STRING 'CHARACTER_ATTEMPT_TO_FALL_ASLEEP' FOR 'EVENT_TYPE'

Unable to create a debug report. Unable to use "main menu" from main menu

jtmusky avatar May 12 '24 19:05 jtmusky

unfamiliar with macos but try ls -ltrh in your home directory. in some rare cases the game will mangle the crash.log location and create files that have corrupted names.

When you run it in your terminal and the game crashes, pay attention to the crash log file location. When it is corrupted it will look like this:

The program has crashed.
See the log file for a stack trace.
CRASH LOG FILE: �=N�DV��^�DVame/.config/cataclysm-dda/crash.log

And the file name may be ''$'\220''=N'$'\245''DV' in this case.

Please paste the entire output from when you run the game in your terminal and it crashes.

NetSysFire avatar May 12 '24 20:05 NetSysFire

unfamiliar with macos but try ls -ltrh in your home directory. in some rare cases the game will mangle the crash.log location and create files that have corrupted names.

no dice... no crash log hidden OR garbled anywhere

jtmusky avatar May 12 '24 20:05 jtmusky

Where is your complete terminal output I asked for?

NetSysFire avatar May 12 '24 20:05 NetSysFire

@NetSysFire Please see the attached terminal screenshot of both the file listing and crash

image

Screenshot of iTerm2 at May 12, 2024 at 20_31_10 (Duplicate)

jtmusky avatar May 13 '24 01:05 jtmusky

I'm not able to reproduce on curses, macOS, with the same version you're using when building from source. Are you using a precompiled binary, or are you building from source? If the latter, could you share the build flags you're using? Otherwise, where are you getting the binary? It looks like your debug.log is also being updated. After the crash happens, can you paste the tail end of the log, starting from the very last bit that looks something like:

-----------------------------------------
10:56:36.160 : Starting log.

perryprog avatar May 13 '24 14:05 perryprog

Precompiled binary. I have a link to the binary in the initial post, and here for your convenience

I'm not able to reproduce on curses, macOS, with the same version you're using when building from source. Are you using a precompiled binary, or are you building from source? If the latter, could you share the build flags you're using? Otherwise, where are you getting the binary? It looks like your debug.log is also being updated. After the crash happens, can you paste the tail end of the log, starting from the very last bit that looks something like:

-----------------------------------------
10:56:36.160 : Starting log.

jtmusky avatar May 14 '24 02:05 jtmusky

That comes as a .app, but I see you're running it in the terminal. Are you running the .sh (Contents/MacOS/Cataclysm.sh) within the bundle, or the actual binary (Contents/Resources/cataclysm)?

perryprog avatar May 14 '24 02:05 perryprog

I have a file called playcat located in my ~/bin

#!/usr/local/bin/bash
cd '/Applications/Cataclysm.app/Contents/Resources' && ./cataclysm; exit

jtmusky avatar May 14 '24 02:05 jtmusky

Interesting; running it in that manner I don't see the same crash as you (I do see some errors which I thick are just forward-compatibility errors with some of my memorial files that I'm able to ignore just fine), but when I force a crash I do see crash.log not being updated despite this being the case when run as a self-compiled binary. I'll look into that tomorrow, though I'm not sure I have a good idea on what's causing your issue...

I don't think it should make a difference, but from a fresh download of that .app, could you try running in the Resources directory ./cataclysm --datadir data/?

perryprog avatar May 14 '24 03:05 perryprog

No difference running it directly. The exact same crash style as before. However, I did pull "a" crash report from the console app. Maybe some clues there...
catcrash.log

I don't think it should make a difference, but from a fresh download of that .app, could you try running in the Resources directory ./cataclysm --datadir data/?

jtmusky avatar May 15 '24 00:05 jtmusky

Ugh, I renamed my Application Support/Cataclysm folder to force the creation of a new one. No crash. So maybe something from there. Granted, been using "Experimental" for a while, so maybe that is the main culprit.

jtmusky avatar May 15 '24 01:05 jtmusky

Ah, good! This would be a forwards compatibility issue, then—I suspect the culprit is one of your memorial files or one of your .sav files. If you go to your (bad) Application Support folder and run grep -rl character_attempt_to_fall_asleep . this will tell you what files are the issue. You can either remove those, switch back to experimental, or try to surgery out the bad part of those files by replacing the part that'll look like this (albeit with no newlines or spaces):

"character_attempt_to_fall_asleep": {
  "event_counts": [
    [
      {
        "character": [
          "character_id",
          "1"
        ]
      },
      {
        "count": 2,
        "first": 5212800,
        "last": 5220001
      }
    ]
  ]
},

with nothing.

perryprog avatar May 15 '24 01:05 perryprog

@perryprog Yep, that was it. Removed 3 files in the memorial folder and ran just fine.

Not sure if this issue needs to be closed, as the crash still didn't generate a crash.log But at least we discovered the underlying reason for the crash.¯\_(ツ)_/¯

jtmusky avatar May 15 '24 01:05 jtmusky

If it is any help, this was the memorial files that was causing the crash.

Anastacia Branham-2024-02-04-11-10-54.json Anastacia Branham-2024-02-04-11-10-54.txt

jtmusky avatar May 15 '24 02:05 jtmusky

Yeah, I'd leave it open. I'm able to reproduce via the distributed binary but not from anything compiled from source (yet), but I'm still poking around.

perryprog avatar May 15 '24 02:05 perryprog

Yeah, no real clue and I'm only seeing it in this precompiled version (I haven't tested other precompiled versions). The only reason this seems to be happening is there's a segfault happening... somewhere (presumably near or during crash handling), and I can't tell where without debug symbols. That ended up preventing the crash.log from being written (hence the lack of message saying it generated one).

perryprog avatar May 15 '24 03:05 perryprog

I'm at my capacity at this point as software engineering isn't my trade... if there is anything I can do to help, let me know. good luck

jtmusky avatar May 15 '24 04:05 jtmusky

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

github-actions[bot] avatar Jun 14 '24 04:06 github-actions[bot]