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

Stonesense segfault on OS X #649

Closed
ELLIOTTCABLE opened this issue Jun 26, 2015 · 8 comments
Closed

Stonesense segfault on OS X #649

ELLIOTTCABLE opened this issue Jun 26, 2015 · 8 comments

Comments

@ELLIOTTCABLE
Copy link

I'm getting the same segmentation-fault described later-on in #576; but I wanted to open a new Issue to record it. As soon as I invoke stonesense at the DFhack prompt, I get a segmentation-fault:

[DFHack]# stonesense
Stonesense launched
Using allegro version 5.0.9 r1
!! /opt/homebrew-cask/Caskroom/dwarf-fortress/0.40.24/df_osx/dfhack: line 15: 20843 Segmentation fault: 11  DYLD_INSERT_LIBRARIES=./hack/libdfhack.dylib ./dwarfort.exe "$@"

Here are the CLI-output, stdout.log, and stderr.log, from my original invocation: f9c3c46d9ae019f6357d

Here's the same, as well as the OS X ‘crash report’ (basically, stack trace) from the same command, with DFHACK_LOG_MEM_RANGES enabled: 03471f43b7fd30c8229a

I'm running a freshly-installed (via Homebrew) v0.40.24 of DF, with DFhack from dfhack-0.40.24-r3-OSX.

@ELLIOTTCABLE
Copy link
Author

Note: I tried to use the prebuilt and updated liballegro.5.0.11 files that @lethosor suggested, downloaded from here, but those weren't built for my arch, and I'm not sure how to go about building them:

Output:

Can't load plugin .../df_osx/hack/plugins/stonesense.plug.dylib

stderr.log:

dlopen(.../df_osx/hack/plugins/stonesense.plug.dylib, 6): Library not loaded: /Volumes/MacintoshHD/brew-mavericks/lib/libfreetype.6.dylib
  Referenced from: .../df_osx/./hack/libs/liballegro_ttf.5.0.dylib
  Reason: no suitable image found.  Did find:
    /usr/local/lib/libfreetype.6.dylib: mach-o, but wrong architecture
Can't load plugin .../df_osx/hack/plugins/stonesense.plug.dylib

@lethosor
Copy link
Member

The allegro libraries should be fine - what's missing is a 32-bit version of libfreetype. Try updating the SDL_ttf library from here.

@ELLIOTTCABLE
Copy link
Author

@lethosor hm, I'm averse to manipulating /Library/Frameworks; is there a pre-built SDL_ttf that I can drop into df_osx/hack/libs/ instead? Or, alternatively, a way to use a Homebrew-built SDL? (I've got libSDL_ttf-2.0.0.dylib in /usr/local/Cellar/sdl_ttf/2.0.11/lib, but I'm not too familiar with how dynamic linking works, and how to get DFhack to use that.)

@lethosor
Copy link
Member

is there a pre-built SDL_ttf that I can drop into df_osx/hack/libs/ instead?

That's what I meant (download SDL_ttf-2.0.11.dmg and drop SDL_ttf.framework into DF/libs/ or DF/hack/ - DF/hack/libs/ probably won't work, unless you modify the dfhack script).

I think ~/Library/Frameworks would also work.

@ELLIOTTCABLE
Copy link
Author

Do I need to remove liballegro_ttf? It's still not working; same error:

dlopen(/opt/homebrew-cask/Caskroom/dwarf-fortress/0.40.24/df_osx/hack/plugins/stonesense.plug.dylib, 6): Library not loaded: /Volumes/MacintoshHD/brew-mavericks/lib/libfreetype.6.dylib
  Referenced from: /opt/homebrew-cask/Caskroom/dwarf-fortress/0.40.24/df_osx/./hack/libs/liballegro_ttf.5.0.dylib
  Reason: no suitable image found.  Did find:
/usr/local/lib/libfreetype.6.dylib: mach-o, but wrong architecture
Can't load plugin /opt/homebrew-cask/Caskroom/dwarf-fortress/0.40.24/df_osx/hack/plugins/stonesense.plug.dylib

@lethosor
Copy link
Member

lethosor commented Jul 1, 2015

Removing liballegro_ttf will break Stonesense. Did you update SDL_ttf? If you did and it still doesn't work, you could try adding libs/SDL_ttf.framework/Frameworks to DYLD_LIBRARY_PATH in the df and dfhack scripts.

@lethosor
Copy link
Member

lethosor commented Jul 1, 2015

Actually, SDL_ttf would only fix DF's libfreetype dependency, not allegro's - is there a libfreetype.6.dylib in hack/libs? Try copying that to the libs or hack folders.

@ELLIOTTCABLE
Copy link
Author

Success! (For future reference: copying df_osx/hack/libs/libfreetype.6.dylib to df_osx/hack, and then replacing df_osx/hack/libs with the unpacked contents of liballegro.5.0.11 provided above.)

I can finally try Stonesense! So excited! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants