nortikin / sverchok

Sverchok
http://nortikin.github.io/sverchok/
GNU General Public License v3.0
2.26k stars 233 forks source link

Blender crashes on OSX when FreeCAD path specified in Sverchok extras #3831

Closed foxxis closed 3 years ago

foxxis commented 3 years ago

Problem statement

As title, Blender crashes. Very similar to closed #3594 Catalina 10.15.7 Blender 2.90 / 2.91 Various Sverchok builds (including master and stable builds from the last 6 months)

Output from console: sv: import settings SciPy package is not available. Voronoi nodes and RBF-based nodes will not be available. geomdl package is not available, some NURBS related nodes will not be available SciKit-Image package is not available; SciKit-based implementation of Marching Cubes and Marching Squares will not be available PyMCubes package is not available. PyMCubes-based implementation of Marching Cubes will not be available Circlify package is not available. Circlify node will not be available Writing: /var/folders/gh/t4hz1b516f181s3pz488wj3m0000gn/T/blender.crash.txt Segmentation fault: 11 Stack trace: `Process: Blender [88309] Path: /Applications/Blender290.app/Contents/MacOS/Blender Identifier: org.blenderfoundation.blender Version: 2.90.1 (2.90.1 2020-09-23) Code Type: X86-64 (Native) Parent Process: ??? [1] Responsible: Blender [88309] User ID: 501

Date/Time: 2021-01-16 20:18:47.580 +0100 OS Version: Mac OS X 10.15.7 (19H15) Report Version: 12 Anonymous UUID: x Sleep/Wake UUID: x

Time Awake Since Boot: 510000 seconds Time Since Wake: 1600 seconds

System Integrity Protection: enabled

Crashed Thread: 1

Exception Type: EXC_CRASH (SIGSEGV) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY

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

Thread 0:: Dispatch queue: com.apple.main-thread 0 libpython3.7m.dylib 0x0000000128791f9e PySys_GetObject + 14 1 FreeCAD.so 0x00000001280fdf68 PyInit_FreeCAD + 984 2 org.blenderfoundation.blender 0x00000001134e3d93 _PyImport_LoadDynamicModuleWithSpec + 579 3 org.blenderfoundation.blender 0x00000001134e37e0 _imp_create_dynamic + 352 `

Steps to reproduce

  1. Install Blender and Sverchok on OSX.
  2. Install FreeCad via anaconda with python version set to 3.7.6, set the path to FreeCad/libs via the Node preferences.
  3. Run Blender from the command line.
  4. Crashes immediately.

Expected result

Blender at least running.

Actual result

Immediate crash.

Sverchok version

From sverchok-master.zip , or any late stable release (from github). FreeCAD versions 0.18.x same result. Python 3.7.6 via Anaconda. Running blender from the console with debug flags. FreeCAD version 0.19 does not crash Blender, but does stop Sverchok. See below.

portnov commented 3 years ago

To recover, you need to locate a file named freecad_path.pth somewhere under Blender installation directory and remove it.

foxxis commented 3 years ago

@portnov Thank you for the comment! Yes, I have been removing that file during the process to get sverchok running between attempts. And also regarding various versions of sverchok and freeCAD during the testing process: These have been removed according to the instructions I could find. I nuked the Anaconda installation between freeCAD installs, and removed the sverchok add-on between versions (did not use the upgrade function).

foxxis commented 3 years ago

When attempting to use Freecad 0.19 with Blender 2.90, Blender runs without a crash, but deactivates Sverchok with the following debug output:

PyMCubes package is not available. PyMCubes-based implementation of Marching Cubes will not be available Dependencies available: pip, scipy, geomdl, scikit-image, circlify, lbt-ladybug, FreeCAD. sv: import all modules Traceback (most recent call last): File "/Applications/Blender290.app/Contents/Resources/2.90/scripts/modules/addon_utils.py", line 351, in enable mod = import(module_name) File "/Users/xxx/Library/Application Support/Blender/2.90/scripts/addons/sverchok-master/init.py", line 73, in imported_modules = init_architecture(name, utils_modules, ui_modules) File "/Users/xxx/Library/Application Support/Blender/2.90/scripts/addons/sverchok-master/core/init.py", line 110, in init_architecture import_all_modules(imported_modules, mods_bases) File "/Users/xxx/Library/Application Support/Blender/2.90/scripts/addons/sverchok-master/core/init.py", line 95, in import_all_modules import_modules(mods, base, imported_modules) File "/Users/xxx/Library/Application Support/Blender/2.90/scripts/addons/sverchok-master/core/init.py", line 65, in import_modules im = importlib.import_module('.{}'.format(m), base) File "/Applications/Blender290.app/Contents/Resources/2.90/python/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/Users/xxx/Library/Application Support/Blender/2.90/scripts/addons/sverchok-master/utils/sv_obj_baker.py", line 126, in from sverchok.utils.solid import standard_mesher, mefisto_mesher File "/Users/xxx/Library/Application Support/Blender/2.90/scripts/addons/sverchok-master/utils/solid.py", line 14, in import MeshPart ImportError: dlopen(/usr/local/anaconda3/envs/freecad37/lib/MeshPart.so, 2): Symbol not found: __ZN6netgen7testoutE Referenced from: /usr/local/anaconda3/envs/freecad37/lib/libNETGENPlugin.8.3.dylib Expected in: /usr/local/anaconda3/envs/freecad37/lib/libmesh.so in /usr/local/anaconda3/envs/freecad37/lib/libNETGENPlugin.8.3.dylib

portnov commented 3 years ago

"symbol not found" message usually means that it can't find some library. By googling "osx MeshPart.so, 2): Symbol not found: __ZN6netgen7testoutE" I can find some messages saying this is a known problem. I'll not advise anything specific, since I'm not an OSX expert, but you can try googling that yourself. Also, does FreeCAD launch and work correctly on your system?

foxxis commented 3 years ago

Yes, freecad 0.19 launches successfully (but triggers the symbol not found message in Blender). I will google the symbol not found problem to see if I can rectify it. But in the referenced issue, another user solved the issue by downgrading to freecad 0.18.4. That version crashes Blender on my system though....

foxxis commented 3 years ago

Apparently the symbol not found message in 0.19 is due to dependencies in Freecad making meshing not work on OSX in 0.19. 0.18 works well no matter how I install it (dmg download/brew/anaconda), but crashes Blender with a segmentation fault (as above).

foxxis commented 3 years ago

Further: Freecad recommends running the latest build of 0.19 on OSX (which is from jan 3 2021). That appears to not be recognised by sverchok. Preferences path set to "/Applications/FreeCAD.app/Contents/Resources/lib/" which does contain the expected resources. Yet Sverchok states "FreeCAD package is not available, Solids nodes will not be available". No error, it does not even try to load anything in the lib folder.

So to clarify: Freecad 0.19 installed via anaconda with python version forced to 3.7.6 does launch on OSX, but throws a symbol error in sverchok (as described in earlier comments above). Freecad 0.19 installed via the latest weekly binary from GitHub also launches on OSX, but is not recognised by Sverchok (as described in this comment).