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

Crash log not generated after abrupt termination #73721

Open
jtmusky opened this issue May 12, 2024 · 18 comments
Open

Crash log not generated after abrupt termination #73721

jtmusky opened this issue May 12, 2024 · 18 comments
Labels
OS: macOS Issues related to macOS / OSX operating system (S1 - Need confirmation) Report waiting on confirmation of reproducibility

Comments

@jtmusky
Copy link

jtmusky commented May 12, 2024

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 jtmusky added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label May 12, 2024
@jtmusky
Copy link
Author

jtmusky commented May 12, 2024

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

@NetSysFire
Copy link
Member

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 NetSysFire added the OS: macOS Issues related to macOS / OSX operating system label May 12, 2024
@jtmusky
Copy link
Author

jtmusky commented May 12, 2024

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

@NetSysFire
Copy link
Member

Where is your complete terminal output I asked for?

@jtmusky
Copy link
Author

jtmusky commented May 13, 2024

@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)

@perryprog
Copy link
Contributor

perryprog commented May 13, 2024

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
Copy link
Author

jtmusky commented May 14, 2024

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.

@perryprog
Copy link
Contributor

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)?

@jtmusky
Copy link
Author

jtmusky commented May 14, 2024

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

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

@perryprog
Copy link
Contributor

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/?

@jtmusky
Copy link
Author

jtmusky commented May 15, 2024

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
Copy link
Author

jtmusky commented May 15, 2024

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.

@perryprog
Copy link
Contributor

perryprog commented May 15, 2024

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.

@jtmusky
Copy link
Author

jtmusky commented May 15, 2024

@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
Copy link
Author

jtmusky commented May 15, 2024

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

@perryprog
Copy link
Contributor

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
Copy link
Contributor

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).

@jtmusky
Copy link
Author

jtmusky commented May 15, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: macOS Issues related to macOS / OSX operating system (S1 - Need confirmation) Report waiting on confirmation of reproducibility
Projects
None yet
Development

No branches or pull requests

3 participants