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

[mac os] Mandelbulber2 crash due to missing libc++abi.1.dylib (possible fix) #930

Open
Luthien-in-edhil opened this issue Jul 20, 2022 · 6 comments
Assignees
Labels
BUG mac MacOS related

Comments

@Luthien-in-edhil
Copy link

Luthien-in-edhil commented Jul 20, 2022

System information (version)
  • mandelbulber2 => 2.28
  • Operating System / Platform => Mac OS Intel, 12.4
  • Compiler => xcode12.5
Detailed description

I've seen several other tickets relating to this issue for the last two (or maybe more) versions of Mandelbulber2.

I tried installing the current version v2.28 yesterday on an iMac running Monterey (12.4) and could not get it to work with a suggestion I read in one of the related tickets: to manually copy libc++abi.1.dylib to mandelbulber2.app/Contents/Frameworks. Since I did not have that file anywhere on that computer I tried with one I found in another Github repository, but that didn't work either.

Today I tried installing v2.28 on my laptop. That has a (still) working v2.24, but I had the same immediate crash with v2.28.

The crash report says:

Termination Reason:    Namespace DYLD, Code 1 Library missing
Library not loaded: @rpath/libc++abi.1.dylib
Referenced from: /Applications/mandelbulber2.app/Contents/Frameworks/libc++.1.dylib
Reason: tried: 
'/Applications/mandelbulber2.app/Contents/Frameworks/../lib/libc++abi.1.dylib' (no such file), 
'/Applications/mandelbulber2.app/Contents/MacOS/../Frameworks/libc++abi.1.dylib' (no such file), 
'/usr/local/Cellar/llvm/14.0.6/lib/libc++abi.1.dylib' (no such file), 
'/Applications/mandelbulber2.app/Contents/MacOS/../Frameworks/libc++abi.1.dylib' (no such file), 
'/usr/local/Cellar/llvm/14.0.6/lib/libc++abi.1.dylib' (no such file), 
'/usr/local/lib/libc++abi.1.dylib' (no such file), 
'/usr/lib/libc++abi.1.dylib' (no such file)

With things like Frameworks/../ and the duplicate entries removed the search path comes down to:

'/Applications/mandelbulber2.app/Contents/lib/libc++abi.1.dylib' (no such file), 
'/Applications/mandelbulber2.app/Contents/Frameworks/libc++abi.1.dylib' (no such file), 
'/usr/local/Cellar/llvm/14.0.6/lib/libc++abi.1.dylib' (no such file), 
'/usr/local/lib/libc++abi.1.dylib' (no such file), 
'/usr/lib/libc++abi.1.dylib' (no such file)

Directory /Applications/mandelbulber2.app/Contents/lib/ does not exist in the .app package, and neither /usr/lib/ nor /usr/local/lib/ have a copy of libc++abi.1.dylib, which I suppose depends on what happens to be installed on your machine.
I did happen to have llvm installed (homebrew, I think it came with Android Studio), but that was v13.0.something - and unfortunately, brew upgrade llvm gave me /usr/local/Cellar/llvm/14.0.6_1, not /usr/local/Cellar/llvm/14.0.6.

So I copied /usr/local/Cellar/llvm/14.0.6_1/lib/libc++abi.1.dylib ( a simlink to-> libc++abi.1.0.dylib) to /Applications/mandelbulber2.app/Contents/Frameworks/ and that did work.
This makes sense, because that file WAS available in v2.24.

I'll admit right away that I don't know that much about packaging an app for Mac OS, but it looks as if you will only need to add libc++abi.1.0.dylib to /Applications/mandelbulber2.app/Contents/Frameworks/ to make the app work for everyone (including those who don't happen to have the DYLIB installed by another app).

Steps to reproduce
  • on any mac where mandelbulber2.app v2.28 works, rename all instances of libc++abi.1.dylib, for instance:
$> cd /usr/lib
$> sudo mv libc++abi.1.dylib temp-libc++abi.1.dylib
$> cd ../local/lib
$> mv libc++abi.1.dylib temp-libc++abi.1.dylib
$> cd ../Cellar/llvm/14.0.6
$> mv libc++abi.1.dylib temp-libc++abi.1.dylib

(whichever one applies)

  • start mandelbulber2.app, watch it crash
    $> mv temp-libc++abi.1.dylib /Applications/mandelbulber2.app/Contents/Frameworks/libc++abi.1.dylib

  • start mandelbulber2.app, watch it not crash

  • and don't forget to revert the above name changes 😇

I hope this helps someone!

@Luthien-in-edhil Luthien-in-edhil changed the title Mandelbulber2 problem with missing libc++abi.1.dylib (Namespace DYLD, Code 1 Library missing) Mandelbulber2 crash due to missing libc++abi.1.dylib (possible fix) Jul 20, 2022
@Luthien-in-edhil Luthien-in-edhil changed the title Mandelbulber2 crash due to missing libc++abi.1.dylib (possible fix) [mac os] Mandelbulber2 crash due to missing libc++abi.1.dylib (possible fix) Jul 20, 2022
@Luthien-in-edhil
Copy link
Author

Luthien-in-edhil commented Jul 20, 2022

However, there seem to be a few more packaging-related issues.

First I noticed was the app complaining it could not find the fractal formula under mandelbulber.app/Contents/Resources.
Understandably so, because they're in the root of the app package mandelbulber.app/.

Same issue when I tried enabling OpenCL.

It looks as if the developer working on the application decided to start following the convention for the app package:

mandelbulber2.app
   /Contents
      /Frameworks
      /info.plist
      /Library
      /MacOS
      /PkgInfo
      /Plugins
      /Resources
         /examples
         /formula
         /opencl
         etcetera...

... but the one packaging the app still put the files directly under mandelbulber.app/ as was the case for v2.24.

mandelbulber2 path issues

@buddhi1980 buddhi1980 self-assigned this Jul 21, 2022
@buddhi1980 buddhi1980 added mac MacOS related BUG labels Jul 21, 2022
@buddhi1980
Copy link
Owner

I have corrected file structure in the dmg files for Intel builds. I hope everything will be fine. Unfortunately I cannot test it, because I don't have any Mac with Intel CPU.
You can try two latest packages from here: https://sourceforge.net/projects/mandelbulber/files/Mandelbulber%20v2/MacOS/
Please let me know it it works.

@Luthien-in-edhil
Copy link
Author

Wow, that's fast.

I just installed it, it opens and runs fine as far as I can see, though I can test it more thoroughly tomorrow.
I had a look at the .app package, and I noticed some leftover source directories in there:

  • doc
  • makefiles
  • qt
  • src

but that's not a big deal.
If you like I can test the Intel mac builds for you!

Thanks 👍

@buddhi1980
Copy link
Owner

Great! Thanks for the feedback. Which version did you tried version compiled with xcode 12 or 14?

@Luthien-in-edhil
Copy link
Author

That was the latest one for v14, mandelbulber2-macOS-2.28-1-xcode14-intel.dmg

@Luthien-in-edhil
Copy link
Author

I just tried mandelbulber2-macOS-2.28-1-xcode14-intel.dmg on my work iMac as well and there it did not work.
The crash log mentioned it couldn't find libc++abi.1.dylib as before, so I downloaded the older mandelbulber2-macOS-2.25.dmg, unpacked it and copied libc++abi.1.dylib to mandelbulber2.app/Contents/Frameworks:

mandelbulber2.app
   Contents
      Frameworks
         libc++abi.1.dylib

and then it worked again. I suppose it worked on my laptop because I had libc++abi.1.dylib somewhere else available 😊

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

No branches or pull requests

2 participants