Crash when importing python modules on MacOS #49549

Closed
opened 2016-10-03 18:10:23 +02:00 by Nicolas Antille · 15 comments

System Information
MacOSX El Capitan, 10.11.6, 3.5GHz i7, 32GB Ram

Blender Version
Broken: 2.78 0e5089c, I tried with versions as old as 2.71 b984489
Worked: this problem doesn't appear on Linux and Windows under the same conditions

Short description of error
Crash when importing some Python modules

Exact steps for others to reproduce the error
Prior to this, install vtk (for instance with homebrew)
Run this: brew install vtk --with-python3 --without-python

Open Blender, go in its Python Console
Write the following:
import sys
sys.path.append('/usr/local/Cellar/vtk/7.0.0_2/lib/python3.5/site-packages')
import vtk
Results in direct crash

Comments
A colleague wrote an open source library for neuroscience files parsing called Brain, it also uses Boost.
We built his library on my iMac with python bindings and then the very same behaviour happened: crash at import time

When I open a regular python3 in my Terminal, I import vtk or brain or other libraries without problem.
I am not familiar with C++ but somebody told me this might be related to incompatible Boost versions or something similar.

I attached the trace I get after Blender 2.78 crashes on my iMac if that helps.
vtk_import_crash.log

**System Information** MacOSX El Capitan, 10.11.6, 3.5GHz i7, 32GB Ram **Blender Version** Broken: 2.78 0e5089c, I tried with versions as old as 2.71 b984489 Worked: this problem doesn't appear on Linux and Windows under the same conditions **Short description of error** Crash when importing some Python modules **Exact steps for others to reproduce the error** Prior to this, install vtk (for instance with homebrew) Run this: brew install vtk --with-python3 --without-python Open Blender, go in its Python Console Write the following: import sys sys.path.append('/usr/local/Cellar/vtk/7.0.0_2/lib/python3.5/site-packages') import vtk Results in direct crash **Comments** A colleague wrote an open source library for neuroscience files parsing called Brain, it also uses Boost. We built his library on my iMac with python bindings and then the very same behaviour happened: crash at import time When I open a regular python3 in my Terminal, I import vtk or brain or other libraries without problem. I am not familiar with C++ but somebody told me this might be related to incompatible Boost versions or something similar. I attached the trace I get after Blender 2.78 crashes on my iMac if that helps. [vtk_import_crash.log](https://archive.blender.org/developer/F373335/vtk_import_crash.log)

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @nantille

Added subscriber: @nantille

Added subscribers: @MartijnBerger, @brecht, @Sergey

Added subscribers: @MartijnBerger, @brecht, @Sergey

Not sure if that's something to do with symbol collision, but hard to give any specific info without being able to reproduce the issue with debug version of Blender.

Might also be difference in particular version of Python the module is linked against.

@MartijnBerger, @brecht: you have more direct access to OSX, might having a check if there's something wrong from Blender side?

Not sure if that's something to do with symbol collision, but hard to give any specific info without being able to reproduce the issue with debug version of Blender. Might also be difference in particular version of Python the module is linked against. @MartijnBerger, @brecht: you have more direct access to OSX, might having a check if there's something wrong from Blender side?
Martijn Berger was assigned by Sergey Sharybin 2016-10-04 15:04:03 +02:00

Closed as duplicate of #49508

Closed as duplicate of #49508

I'm sorry, I fail to see where this is related to Windows stuff with .dll...

In this #49508 ticket, some people talk about creating a new installer but Blender for MacOS comes as precompiled and ready to use.
Does this mean that at some point you will recompile Blender for MacOS and the problem will be solved?

I'm sorry, I fail to see where this is related to Windows stuff with .dll... In this #49508 ticket, some people talk about creating a new installer but Blender for MacOS comes as precompiled and ready to use. Does this mean that at some point you will recompile Blender for MacOS and the problem will be solved?

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Duplicate' to: 'Open'

Changed status from 'Duplicate' to: 'Open'

Sorry, wrong task number xD

Sorry, wrong task number xD

Haha ok. :)

Haha ok. :)
Member

can you do a:

otool -L /usr/local/Cellar/vtk/7.0.0_2/lib/python3.5/site-packages/vtk/vtkFiltersCorePython.so

it might be linked against a wrong python version

can you do a: ``` otool -L /usr/local/Cellar/vtk/7.0.0_2/lib/python3.5/site-packages/vtk/vtkFiltersCorePython.so ``` it might be linked against a wrong python version

Here's my result with the above otool command line:

/usr/local/Cellar/vtk/7.0.0_2/lib/python3.5/site-packages/vtk/vtkFiltersCorePython.so:
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkFiltersCorePython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkFiltersCore-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonExecutionModelPython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonExecutionModel-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonDataModelPython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonDataModel-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonMiscPython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonMisc-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonSystemPython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonSystem-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonTransformsPython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonMathPython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonTransforms-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonMath-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonCorePython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkWrappingPython35Core-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.5/Python (compatibility version 3.5.0, current version 3.5.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtksys-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonCore-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
Here's my result with the above otool command line: /usr/local/Cellar/vtk/7.0.0_2/lib/python3.5/site-packages/vtk/vtkFiltersCorePython.so: /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkFiltersCorePython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkFiltersCore-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonExecutionModelPython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonExecutionModel-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonDataModelPython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonDataModel-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonMiscPython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonMisc-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonSystemPython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonSystem-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonTransformsPython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonMathPython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonTransforms-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonMath-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonCorePython35D-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkWrappingPython35Core-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/opt/python3/Frameworks/Python.framework/Versions/3.5/Python (compatibility version 3.5.0, current version 3.5.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtksys-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/local/Cellar/vtk/7.0.0_2/lib/libvtkCommonCore-7.0.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Member

Blender is still compiled with the deprecated libstdc++ ABI on MacOS. there is an agreement between the developers not to change this for the 2.7x series. As such this will not be fixed anytime soon.

You could compile all this by hand and patch it where needed to link against libstdc++ by hand or use older version.

Blender is still compiled with the deprecated libstdc++ ABI on MacOS. there is an agreement between the developers not to change this for the 2.7x series. As such this will not be fixed anytime soon. You could compile all this by hand and patch it where needed to link against libstdc++ by hand or use older version.

If the problem here is indeed C++ symbol collisions, couldn't we just hide all those symbols? Adding __Z in osx_locals.map should hide all Blender C++ symbols. We already hide Boost symbols but maybe there are some that we missed.

As far as I know an extension build with libc++ can work even if Blender is built with libstdc++, as long as we keep the symbols from interfering.

If the problem here is indeed C++ symbol collisions, couldn't we just hide all those symbols? Adding *__Z* in osx_locals.map should hide all Blender C++ symbols. We already hide Boost symbols but maybe there are some that we missed. As far as I know an extension build with libc++ can work even if Blender is built with libstdc++, as long as we keep the symbols from interfering.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#49549
No description provided.