Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork4.9k
Description
Is there an existing issue for this?
- I have searched the existing issues
Problem description
I'm trying to run FreeCAD headlessly via Python. Noting that I'm using the latest available weekly Mac build (Development Build weekly-2025.10.22), so that might be why this issue is happening. I want to flag the problem in case it's helpful as development is made towards the 1.1 release.
Steps to reproduce.
Download theDevelopment Build weekly-2025.10.22 for Mac. (As of writing this, this is the latest for Mac)
Install this version of FreeCAD (I fully removed my previous installation of FreeCAD)
Try to
import FreeCADvia the Python version packaged with FreeCAD
/Applications/FreeCAD.app/Contents/Resources/bin/python -X faulthandler<< 'EOF'import syssys.path.append('/Applications/FreeCAD.app/Contents/Resources/lib')print("About to import FreeCAD...")import FreeCADprint("Success!")EOF
This will flag a segfault
About to import FreeCAD...Fatal Python error: Segmentation faultCurrent thread 0x0000000207942140 (most recent call first): File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed File "<frozen importlib._bootstrap_external>", line 1233 in create_module File "<frozen importlib._bootstrap>", line 573 in module_from_spec File "<frozen importlib._bootstrap>", line 676 in _load_unlocked File "<frozen importlib._bootstrap>", line 1147 in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 1176 in _find_and_load File "<stdin>", line 4 in <module>zsh: segmentation fault /Applications/FreeCAD.app/Contents/Resources/bin/python -X faulthandler <<<''Using lldb I can see more details. See here
lldb /Applications/FreeCAD.app/Contents/Resources/bin/python(lldb) target create "/Applications/FreeCAD.app/Contents/Resources/bin/python"Current executable set to '/Applications/FreeCAD.app/Contents/Resources/bin/python' (arm64).(lldb) env DYLD_LIBRARY_PATH=/Applications/FreeCAD.app/Contents/Resources/lib(lldb) env PYTHONPATH=/Applications/FreeCAD.app/Contents/Resources/lib(lldb) runProcess 71265 launched: '/Applications/FreeCAD.app/Contents/Resources/bin/python' (arm64)Python 3.11.13 | packaged by conda-forge | (main, Jun 4 2025, 14:52:34) [Clang 18.1.8 ] on darwinType "help", "copyright", "credits" or "license" for more information.>>> import sys>>> sys.path.append('/Applications/FreeCAD.app/Contents/Resources/lib')>>> import FreeCADProcess 71265 stopped* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x60) frame #0: 0x0000000106a711d0 libpython3.11.dylib`PySys_GetObject + 36libpython3.11.dylib`PySys_GetObject:-> 0x106a711d0 <+36>: ldr q0, [x23, #0x60] 0x106a711d4 <+40>: ldr x20, [x23, #0x70] 0x106a711d8 <+44>: stp xzr, xzr, [x23, #0x68] 0x106a711dc <+48>: str xzr, [x23, #0x60]Target 0: (python) stopped.(lldb) bt* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x60) * frame #0: 0x0000000106a711d0 libpython3.11.dylib`PySys_GetObject + 36 frame #1: 0x0000000101842774 FreeCAD.so`PyInit_FreeCAD + 496 frame #2: 0x000000010019f130 python`_imp_create_dynamic + 1204 frame #3: 0x00000001000bb1f0 python`cfunction_vectorcall_FASTCALL + 256 frame #4: 0x0000000100167b6c python`_PyEval_EvalFrameDefault + 53108 frame #5: 0x000000010016a218 python`_PyEval_Vector + 184 frame #6: 0x000000010006499c python`object_vacall + 328 frame #7: 0x000000010006478c python`PyObject_CallMethodObjArgs + 108 frame #8: 0x000000010019a01c python`PyImport_ImportModuleLevelObject + 1676 frame #9: 0x0000000100162778 python`_PyEval_EvalFrameDefault + 31616 frame #10: 0x0000000100159c1c python`PyEval_EvalCode + 204 frame #11: 0x00000001001c0080 python`run_mod + 144 frame #12: 0x00000001001c0690 python`PyRun_InteractiveOneObjectEx + 868 frame #13: 0x00000001001bf41c python`_PyRun_InteractiveLoopObject + 168 frame #14: 0x00000001001beaf4 python`_PyRun_AnyFileObject + 112 frame #15: 0x00000001001c379c python`PyRun_AnyFileExFlags + 156 frame #16: 0x00000001001e66d0 python`pymain_run_stdin + 796 frame #17: 0x00000001001e5ae8 python`Py_RunMain + 2548 frame #18: 0x00000001001e6f6c python`pymain_main + 1284 frame #19: 0x0000000100004c38 python`main + 56 frame #20: 0x0000000199646b98 dyld`start + 6076(lldb) frame infoframe #0: 0x0000000106a711d0 libpython3.11.dylib`PySys_GetObject + 36(lldb) register readGeneral Purpose Registers: x0 = 0x0000000101843e30 "path" x1 = 0x0000000101843e30 "path" x2 = 0xfffffffffffffff0 x3 = 0x0000600001db7a30 x4 = 0x0000600001db7a80 x5 = 0x00000000a6008ffb x6 = 0x0000000026200000 x7 = 0x0000000000000000 x8 = 0x0000000106d1f000 runpy_toplevel_consts_20_consts_5 + 8 x9 = 0x0000000065757274 x10 = 0x0000000000000001 x11 = 0x0000000000003a20 x12 = 0x0000000000000050 x13 = 0x0000000000000001 x14 = 0x00000000ffffffee x15 = 0x00000000000007fb x16 = 0x0000000106a711ac libpython3.11.dylib`PySys_GetObject x17 = 0x000000020899b650 x18 = 0x0000000000000000 x19 = 0x0000000102074420 x20 = 0x000000010204b7f0 x21 = 0x0000000000000000 x22 = 0x000000010204b7f0 x23 = 0x0000000000000000 x24 = 0x0000000102074420 x25 = 0x0000000102067360 x26 = 0x00000001004a4000 python`_PyRuntime + 165136 x27 = 0x0000000000000000 x28 = 0x000000010047b000 runpy_toplevel_consts_20_consts_5 + 16 fp = 0x000000016fdfe170 lr = 0x0000000101842774 FreeCAD.so`PyInit_FreeCAD + 496 sp = 0x000000016fdfe130 pc = 0x0000000106a711d0 libpython3.11.dylib`PySys_GetObject + 36 cpsr = 0x20001000I hope this is helpful. Happy to do more digging on my side
Full version info
OS: macOS 15.7.1Architecture: arm64Version: 1.1.0dev.14555 (Git shallow)Build date: 2025/10/21 12:07:13Build type: ReleaseBranch: mainHash: 2096d0bd8603b429fdc0c746c34b3d73c3289fe1Python 3.11.14, Qt 6.8.3, Coin 4.0.3, Vtk 9.3.1, boost 1_86, Eigen3 3.4.0, PySide 6.8.3shiboken 6.8.3, xerces-c 3.3.0, IfcOpenShell 0.8.2, OCC 7.8.1Locale: English/United States (en_US)Navigation Style/Orbit Style/Rotation Mode: Gesture/Trackball/Drag at cursorStylesheet/Theme/QtStyle: FreeCAD Dark.qss/FreeCAD Dark/Logical DPI/Physical DPI/Pixel Ratio: 72/128.5/2
Subproject(s) affected?
None
Anything else?
Forumpost
Code of Conduct
- I agree to follow this project's Code of Conduct