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

"zsh segmentation fault" with aspose.slides on MacOS #7570

Closed
bowespublishing opened this issue Apr 14, 2023 · 2 comments
Closed

"zsh segmentation fault" with aspose.slides on MacOS #7570

bowespublishing opened this issue Apr 14, 2023 · 2 comments

Comments

@bowespublishing
Copy link

I can successfully create and package the following script on Windows however when using MacOS I get "zsh segmentation" fault when performing the same task. Simple example below

import aspose.slides as slides

# Instantiate a Presentation object that represents a presentation file
with slides.Presentation() as presentation:
    slide = presentation.slides[0]
    slide.shapes.add_auto_shape(slides.ShapeType.LINE, 50, 150, 300, 0)
    presentation.save("NewPresentation_out.pptx", slides.export.SaveFormat.PPTX)

I used - pyinstaller --noconfirm --onedir --windowed --collect-all "aspose" "script.py"

@bowespublishing bowespublishing added the triage Please triage and relabel this issue label Apr 14, 2023
@bwoodsend
Copy link
Member

aspose.slides looks pretty broken to me even without PyInstaller.

> otool -L /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aspose/slides.cpython-39-darwin.dylib 
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aspose/slides.cpython-39-darwin.dylib:
	@rpath/slides.cpython-39-darwin.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/local/lib/libpython3.9.dylib (compatibility version 3.9.0, current version 3.9.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.23.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)

It's linked against itself for some bizarre reason and against a libpython with a hardcoded location /usr/local/lib/libpython3.9.dylib. Since my Python environment is not using the /usr/local/ prefix, I can't even import aspose.slides in normal Python.

I suspect that you are using Python installed via brew which does use the /usr/local prefix. In which case, it should load ok under normal Python but when PyInstaller runs on it, there will be two copies of libpython getting loaded - the one PyInstaller put in your application and the original one at /usr/local/lib/libpython3.9.dylib. macOS treats loading two copies of the same library as criminal and kills the process.

@bwoodsend bwoodsend added not-our-bug and removed triage Please triage and relabel this issue labels Apr 15, 2023
@bwoodsend bwoodsend closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2023
@rokm
Copy link
Member

rokm commented Apr 15, 2023

Recent builds of homebrew (e.g., python@3.9) also seem to be framework-based, and have no libpython3.9.dylib. Of course, if symlink was manually created to work around this, then PyInstaller will create a duplicate due to lack of symlink support, and you'll find both Python (the original library from e.g., /usr/local/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/Python) and libpython3.9.dylib in your frozen application. If that's the case, you should remove libpython3.9.dylib and replace it with symlink to Python.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants