-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Segfault after Main Menu #17714
Comments
Small update: the problem occurs on other Macs too, I tried the latest Jenkins build (5254) on another Mac (El Capitan) and the same crash happened. I also tried the Curses build, with the same results. |
Process: cataclysm-tiles [19017] Date/Time: 2016-07-17 16:56:53.443 +0200 Sleep/Wake UUID: 9E3B02B6-7A60-463B-B813-386F293976AE Time Awake Since Boot: 54000 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Thread 0 Crashed:: Dispatch queue: com.apple.main-thread Thread 1: Thread 2:: Dispatch queue: com.apple.libdispatch-manager Thread 3: Thread 4:: SDLTimer Thread 5: Thread 6: Thread 7:: com.apple.NSEventThread Thread 0 crashed with X86 Thread State (64-bit): Logical CPU: 0 Binary Images: External Modification Summary: VM Region Summary:
REGION TYPE SIZE COUNT (non-coalesced) Model: MacBookAir4,2, BootROM MBA41.0077.B14, 2 processors, Intel Core i5, 1,7 GHz, 4 GB, SMC 1.73f66 |
Another update: I've done a few builds and the culprit seems to be commit 65ccc57 . Also, commit 65ccc57 is the one that introduces a call to npc_class::finalize_all() in the init.cpp file, which a comment describes as "Horrible - can't be done better?". |
Could you please compile a debug version, so everybody could see the call stack and know which place causes the crash. |
Uhm.. Can you help me with that? Where do I find the call stack? |
Sorry, I closed it by mistake.. |
Launch cataclysm within the debugger by |
This is all I got: lldb output.txt (I'm uploading it as a file because it displays wrong if I paste it here directly). As before, I compiled with: |
Sorry forgot to tell you, you'd better compile with |
It still doesn't know function names, for some reason. Am I doing something wrong? |
Weird. How about building in this way:
If you see |
With the Now I have tried omitting that and compiled it with And.. It works T_T no segfault this time. Here is the build output, I don't know if it can be useful: debug build output.txt |
Oh it is weird, crash on release builds, no problem on debug builds. A compiler optimization bug? |
Yeah, that seems likely. But I'm not a C++ developer, so I have no idea how to look for a solution. But if you, or anyone else, needs somebody with a Mac to test potential solutions, I'm available. |
Tried with
|
For some reason I cannot compile with |
I installed Mac OS X 10.11.6 just a few hours ago, and I can reproduce this crash.
That's easy to resolve, with Homebrew package manager, install it by
You mean with |
So terrible. The program executes perfectly in debug version, only crashes in release version. Although I tried to generate debug information inside the release version binary by that dirty hack, lots of important variable are optimized out, and a lot of functions are inlined....
|
Thanks about the tip, now it compiles with your settings. I'm on OS X 10.11.5 and I get no crash even with localization (using the options above, I still crash with a release build). I'll update to 10.11.6 and see if I get your results. Also it might be worth to check whether commit 67d8e1f is still the last working one and 65ccc57 still the first to crash. |
Thanks for your update. Now I give up debugging, begin to statically checking the code. |
I installed GCC 6.1.0 compiler, and the binary built by GCC has no problem, either debug or release. |
Cool! Does the Jenkins build work for you? If not, maybe it should be changed to build with GCC? |
Ok I tried on my Mac too, I can confirm that it works perfectly with |
However, binary produced by GCC on Mac OS X since 4.9 is not debuggable. |
GNU's compilers and debuggers aren't very acclimatized on OS X, I personally feel. When building tests, it produces massive So there are two solutions for this issue:
|
It looks like the crash happens because of map addressing. |
Tried with LLVM/Clang 3.8.1. Also crashes.
|
Any update on this? I'd really like to play the binaries posted at http://dev.narc.ro/cataclysm/jenkins-latest/OSX/Tiles/ :/ |
"Release debugging" is kinda hard to do... I can only suggest tests, but I can't fix it myself since I don't have mac os anywhere nearby. Since the crashing line seems to be
It could be tested by extracting the
The double debugmsg would help catch a possible crash with initialization. |
Two IDs are identical.
|
Options I see:
|
Oh you're right @Coolthulhu ! I printed the address of that |
I can confirm that the bug is still present on my Macbook Pro running El Capitan 10.11. Compiling the lastest version with "make NATIVE=osx OSX_MIN=10.11 TILES=1 SOUND=1 LOCALIZE=0 CLANG=1 LUA=1 FRAMEWORK=1 RELEASE=1 USE_HOME_DIR=1 DEBUGINFO=1" It crashes at world gen with the following back trace:
Since we're suspicious of optimization by the compiler as the culprit, I compiled the source using the "-O3", "-O2", and "-O1" optimization flags, each in turn. The crash was present each time with the same backtrace. Using "-O0" (optimizations off?) resulted in a functioning binary. |
Fixed in my #17898 , but hasn't been merged by core developers yet. |
This bug is now fixed via #18092 . |
In the latest experimental builds the game crashes with a SIGSEGV as soon as I enter character creation or load a game.
The issue is only present in latest builds, I currently play build 5194 which is version 0.C-16370-g75a3362 with no crashes.
I've been using the tiles version on OS X 10.11 (El Capitan), both from the Jenkins build, homebrew install and building from source myself.
Here is a screenshot of the last thing I see before the crash.
Here is the debug log from the game:
debug.log.txt
And here is the crash report from the OS:
Crash Report.txt
The text was updated successfully, but these errors were encountered: