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

Cross-compiled macOS experimentals crash on open #23171

Closed
bpwatts opened this issue Mar 10, 2018 · 74 comments · Fixed by #26564
Closed

Cross-compiled macOS experimentals crash on open #23171

bpwatts opened this issue Mar 10, 2018 · 74 comments · Fixed by #26564
Labels
<Crash / Freeze> Fatal bug that results in hangs or crashes. OS: macOS Issues related to macOS / OSX operating system (P2 - High) High priority (for ex. important bugfixes) (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@bpwatts
Copy link

bpwatts commented Mar 10, 2018

Game version: Latest

Operating system: Mac OS X

Tiles or curses: Tiles

Mods active: Tried with no mods (deleted the directory) and still same Segfault

Expected behavior: Game

Actual behavior: Crash to terminal

Steps to reproduce the behavior: Download/Compile latest and attempt to run

This is what I receive when it crashes:
Process: cataclysm-tiles [1028]
Path: /Users/USER/Downloads/*/cataclysm-tiles
Identifier: cataclysm-tiles
Version: ???
Code Type: X86-64 (Native)
Parent Process: bash [1011]
Responsible: cataclysm-tiles [1028]
User ID: 501

Date/Time: 2018-03-10 07:50:50.134 -0600
OS Version: Mac OS X 10.12.6 (16G29)
Report Version: 12
Anonymous UUID: 073FF86E-450F-70A7-8B91-2276ED84FF04

Time Awake Since Boot: 480 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]

@Zireael07
Copy link
Contributor

Hmm, your GPU and RAM?

@bpwatts
Copy link
Author

bpwatts commented Mar 10, 2018

Intel HD Graphics 4000 1536 MB GPU
8 GB 1600 MHz DDR3
I used to play quite a bit from the .C experimental line, not sure when it failed.

@ZhilkinSerg ZhilkinSerg added <Crash / Freeze> Fatal bug that results in hangs or crashes. (S1 - Need confirmation) Report waiting on confirmation of reproducibility OS: macOS Issues related to macOS / OSX operating system SDL: Tiles / Sound Tiles visual interface and sounds. labels Mar 10, 2018
@Leland
Copy link
Contributor

Leland commented Mar 11, 2018

10.13.2 here, no issues

@bpwatts
Copy link
Author

bpwatts commented Mar 11, 2018 via email

@Leland
Copy link
Contributor

Leland commented Mar 11, 2018

Ah, just kidding. Downloaded version crashes on me. Self-compiled runs just fine, however

@Leland Leland added (S2 - Confirmed) Bug that's been confirmed to exist and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Mar 11, 2018
@bpwatts
Copy link
Author

bpwatts commented Mar 11, 2018 via email

@bpwatts
Copy link
Author

bpwatts commented Mar 11, 2018 via email

@Leland
Copy link
Contributor

Leland commented Mar 12, 2018

@bpwatts this is the command I use to build make app NATIVE=osx OSX_MIN=10.7 RELEASE=0 TILES=1 USE_HOME_DIR=1 SOUND=1 LOCALIZE=0 CLANG=1

@bpwatts
Copy link
Author

bpwatts commented Mar 12, 2018

Even using that build command I still get a segfault when starting. Maybe clean out my mods directory / options file?

Process: cataclysm-tiles [5275]
Path: /Users/USER/Downloads/*/Cataclysm.app/Contents/Resources/./cataclysm-tiles
Identifier: com.cataclysmdda.en.cataclysm
Version: 1.0 (1)
Code Type: X86-64 (Native)
Parent Process: ??? [5270]
Responsible: cataclysm-tiles [5275]
User ID: 501

Date/Time: 2018-03-11 20:51:57.265 -0500
OS Version: Mac OS X 10.13.3 (17D47)
Report Version: 12
Anonymous UUID: 073FF86E-450F-70A7-8B91-2276ED84FF04

Time Awake Since Boot: 1800 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]

@Leland
Copy link
Contributor

Leland commented Mar 12, 2018

Do you have all the libraries installed? I prefer Homebrew. brew update && brew install sdl2 sdl2_image sdl2_ttf sdl2_mixer libvorbis libogg

@bpwatts
Copy link
Author

bpwatts commented Mar 12, 2018 via email

@Leland
Copy link
Contributor

Leland commented Mar 12, 2018

Yeah, I'd bet an outdated Xcode could be the culprit.

@Leland
Copy link
Contributor

Leland commented Mar 12, 2018

Just got CDDA compiled on another Mac running 10.13.3 and Xcode 9.2. Installed the Brew libraries, ran my above make command and it compiled successfully

@bpwatts
Copy link
Author

bpwatts commented Mar 12, 2018 via email

@bpwatts
Copy link
Author

bpwatts commented Mar 12, 2018

And that was it, self-compile is back running again. sheepish kick of the can

@bpwatts bpwatts closed this as completed Mar 12, 2018
@Leland
Copy link
Contributor

Leland commented Mar 12, 2018

Awesome, glad to hear it worked 👏

@illi-kun
Copy link
Contributor

@Leland what's the conclusion here? Our pre-compiled versions don't work? Do we need to update the mentioned libraries on server side to make them work again?

@Leland
Copy link
Contributor

Leland commented Mar 13, 2018 via email

@illi-kun illi-kun reopened this Mar 13, 2018
@Myrkalgen
Copy link

@illi-kun Seems to be the case. Getting more reports with an identical error to @bpwatts' and fixed the same way: self-compiling with updated libs. I was told @narc0tiq is the one to do that.

@narc0tiq
Copy link
Contributor

I'm certainly the person to talk to about getting it updated, but it'll have to be someone else updating the osxcross environment, as I literally have no idea what's in there. I can provide SSH access to the build machine for this purpose.

@Heaper327
Copy link

@Leland my self-compiled game is running, but for some reason I changing language in the settings doesn't work. USE_HOME_DIR=1 seems doesn't work as well

@Heaper327
Copy link

When will this be fixed? All experimental versions available for download crash

@Leland
Copy link
Contributor

Leland commented Sep 14, 2018

All the macOS experimental served on https://cataclysmdda.org/ crash on open still, so no, not fixed unfortunately.

The Homebrew work does offer a viable alternative route to enterprising CLI folks, but it doesn't fix this issue.

@jakwings
Copy link

jakwings commented Sep 16, 2018

Both Tiles and curses builds crashed on MacOS 10.11 right after loading the game data and building the config directory (with files in it). Similar reports.

I managed to compile the apps and it seems to run well: https://github.com/auto-load/Cataclysm-DDA/releases/tag/0.C-E006

Not sure where the problem is, but you can try not to strip the binary or to make the OPTLEVEL=-O2.

I'd like to test it if you can provide the builds.

@narc0tiq
Copy link
Contributor

If it crashes on 10.11 as well, is there anyone for whom it does work?

@AdriaanRenting
Copy link

AdriaanRenting commented Sep 20, 2018

Both Tiles and curses builds crashed on MacOS 10.11 right after loading the game data and building the config directory (with files in it). Similar reports.

I managed to compile the apps and it seems to run well: https://github.com/auto-load/Cataclysm-DDA/releases/tag/0.C-E006

Not sure where the problem is, but you can try not to strip the binary or to make the OPTLEVEL=-O2.

The problem is not that it doesn't compile or run when built on a Mac natively with the latest Xcode environment installed. That's also why the homebrew work around does work, as it compiles the code on the users machine.

The problem is that the automated Jenkins build environment that the cdda developers use to provide the builds on the website runs on Linux and uses the osxcross (https://github.com/tpoechtrager/osxcross) tool to compile for OSX. This tool is not compatible with the newer OSX versions. See tpoechtrager/osxcross#103
It has something to do with Apple not providing all the needed libraries or something like that.

If it crashes on 10.11 as well, is there anyone for whom it does work?

I can't confirm if it works on 10.11 or not, iology seems to have tested that. osxcross seems to be compatible with 10.11, so there might be more (or a new) issues.

I assumed it works on 10.8-10.11 for those that still use an older version of OSX because they're on an old Mac. From the discussions I came across, a significant number of cdda players seem to be on old hardware, so that probably includes a few old macs. I'm not sure how much effort you want to put into what must be a relatively small user base.

@jakwings
Copy link

@AdriaanRenting I knew it is the problem with the cross-compilation. Ow, my edit removed that info. btw I compiled two standalone apps for mac users, not just for a dev machine. It shouldn't be hard to automate the experimental builds through GitHub & Travis CI, but it is still up to the devs whether to stick with Jenkins. I proposed this idea 2 years ago.

Stripping the binary with the program "strip" or some special optimization levels can give unexpected output sometimes. Since cross-compilation worked well before, the crash is not necessarily due to the fault of osxcross.

@AdriaanRenting
Copy link

@AdriaanRenting I knew it is the problem with the cross-compilation. Ow, my edit removed that info. btw I compiled two standalone apps for mac users, not just for a dev machine. It shouldn't be hard to automate the experimental builds through GitHub & Travis CI, but it is still up to the devs whether to stick with Jenkins. I proposed this idea 2 years ago.

Stripping the binary with the program "strip" or some special optimization levels can give unexpected output sometimes. Since cross-compilation worked well before, the crash is not necessarily due to the fault of osxcross.

From my perspective you are reporting a new issue, unrelated to the problems with osxcross on newer OSX versions that have been discussed in this thread so far. Maybe the title of the thread needs to be updated and your report should become a new discussion? I can't test on 10.11 myself so I don't know.

@jakwings
Copy link

@AdriaanRenting Don't play words with me, okay? Can the title of this issue be more clear?

You can see this comment: #23171 (comment)

@AdriaanRenting
Copy link

@AdriaanRenting Don't play words with me, okay? Can the title of this issue be more clear?

You can see this comment: #23171 (comment)

I'm not trying to argue with you, just wondering if we're now mixing up two issues.
I've been mostly focussed on helping vircung getting the homebrew work around working.

I might have misunderstood you. Are you saying that with less aggressive compile options, you get a build using osxcross that does work on 10.13?

@narc0tiq
Copy link
Contributor

narc0tiq commented Sep 20, 2018 via email

@jakwings
Copy link

Any clear reason for excluding 10.11 except my report is too late? I just wanted to provide some ideas for a solution, hopefully can resolve this issue for 10.11, 10.12, 10.13 and 10.14. I never tried to urge anyone to keep the support for 10.11. You have too much presumption about my words. Good luck finding a better guy to collaborate with you. The guy who introduced osxcross should know how to edit the makefile.

@narc0tiq
Copy link
Contributor

Nobody's excluding anything, what we're saying is that it's supposed to be working for 10.11, and if it doesn't, that's not the osxcross bug and it needs to be tracked in its own issue. Because it's another issue.

@jakwings
Copy link

I just pointed out the crash might not be caused by some bug of osxcross. Just make a good title for this issue if you're so sure about it. I'm really tired of your word playing.

@Leland
Copy link
Contributor

Leland commented Sep 20, 2018 via email

@ZhilkinSerg
Copy link
Contributor

Which MacOS versions do we need to test Cataclysm on?

I have 10.13.6 on VM. Should I install 10.9-10.12 too?

@BrettDong
Copy link
Member

BrettDong commented Sep 28, 2018 via email

@ZhilkinSerg
Copy link
Contributor

A little bit tangent to the issue itself, how did you make it to install Mac OS inside a VM?

There are ways.

@Veid
Copy link
Contributor

Veid commented Oct 9, 2018

Heads up I'm running 10.11.6 and compiled latest as of today. Segfaults, at launch, like so:

0   cataclysm-tiles    	0x000000010f5e640e std::__1::__tree<std::__1::__value_type<string_id<mutation_branch>, player_morale::mutation_data>, std::__1::__map_value_compare<string_id<mutation_branch>, std::__1::__value_type<string_id<mutation_branch>, player_morale::mutation_data>, std::__1::less<string_id<mutation_branch> >, true>, std::__1::allocator<std::__1::__value_type<string_id<mutation_branch>, player_morale::mutation_data> > >::__move_assign(std::__1::__tree<std::__1::__value_type<string_id<mutation_branch>, player_morale::mutation_data>, std::__1::__map_value_compare<string_id<mutation_branch>, std::__1::__value_type<string_id<mutation_branch>, player_morale::mutation_data>, std::__1::less<string_id<mutation_branch> >, true>, std::__1::allocator<std::__1::__value_type<string_id<mutation_branch>, player_morale::mutation_data> > >&, std::__1::integral_constant<bool, true>) + 70 (__tree:1301)
1   cataclysm-tiles    	0x000000010f5c5a6d player_morale::operator=(player_morale&&) + 93 (map:955)
2   cataclysm-tiles    	0x000000010f5a0652 player::operator=(player&&) + 1664 (player.cpp:566)
3   cataclysm-tiles    	0x000000010f288247 main_menu::opening_screen() + 1007 (main_menu.cpp:395)
4   cataclysm-tiles    	0x000000010f282953 main + 2867 (main.cpp:643)
5   libdyld.dylib      	0x00007fff9b6205ad start + 1

@Veid
Copy link
Contributor

Veid commented Oct 9, 2018

Seems like this might be similar to #17714?

I tried compiling debug/release versions with both clang and gcc. Didn't seem to make a difference. For those that have compiled working versions, what version of clang do you have installed?

$ clang -v
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0

EDIT:
I was doing this, randomly, late last night -- so I must've not saved the makefile or something when I was trying for a debug build. But I can confirm that using -O0 results in a functioning binary. Just like in the issue I referenced above.

@AdriaanRenting
Copy link

clang -v
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0

@narc0tiq
Copy link
Contributor

narc0tiq commented Nov 1, 2018

Ok, so, regarding the experimental builds: I've understood that they currently aren't working at all, for anyone. I also haven't seen anyone trying to fix them. I definitely can't -- I don't have access to a Mac I could use for this purpose.

If homebrew (which strikes me as something like gentoo for Mac -- i.e., packages are built locally) can fill the gap, and especially if it's a thing that people are actually supporting, then I see no reason to maintain the confusing broken downloads at https://dev.narc.ro/cataclysm/jenkins-latest/OSX.

What I need, really, is for someone to step up and actually fix the OSX builds or declare them unfixable. This limbo we're currently in isn't working for me, and we're wasting storage space for no apparent benefit.

@Veid
Copy link
Contributor

Veid commented Nov 1, 2018

@narc0tiq Homebrew is just a package manager. It's not really something most people have installed.

As for the builds -- if you give me ssh access to the build machine, I'd be willing to take a crack at it. It might be the case that we can have the build server generate non-optimized (-O0) versions for osx, for now.

Here's a version I compiled as of today, if anyone wants it. Built with home directory, sound, tiles, lua, RRFSounds, and Cata-MSX-DeadPeopleTileset:
https://mega.nz/#!i3pzFQTY!WmjhPpp4pr2hzsaP7VNUA_wz2Io4_q7cdlYTY1XEDG0

@narc0tiq
Copy link
Contributor

narc0tiq commented Nov 2, 2018

@Veid

if you give me ssh access to the build machine, I'd be willing to take a crack at it.

Sure, absolutely -- pass me an SSH public key by email (should be available in my profile) or other means, and I'll set you up with an account and pass back the details.

It might be the case that we can have the build server generate non-optimized (-O0) versions for osx, for now.

If that works, we should consider putting it in the regular Makefile for when OSX cross-compiles are being done.

I find it strange (and disappointing) that clang-for-osx needs optimizations turned off like that -- is that specific to using osxcross? Does a less-aggressive (e.g., -O2) level work?

@Leland Leland changed the title Compiled macOS experimentals crash on open Cross-compiled macOS experimentals crash on open Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Crash / Freeze> Fatal bug that results in hangs or crashes. OS: macOS Issues related to macOS / OSX operating system (P2 - High) High priority (for ex. important bugfixes) (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.