pylint segmentation fault when setting Part.Shape placement.

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
dunaden
Posts: 7
Joined: Wed Nov 18, 2020 2:43 pm

pylint segmentation fault when setting Part.Shape placement.

Post by dunaden »

Problem Summary
I'm encountering an error as below when attempting to run pylint on a very simple and reproducible FreeCAD script file. I want to understand the cause and find workarounds.

Code: Select all

$ pylint pylint_test.py 
Segmentation fault (core dumped)
Problem Details
I'm updating some scripts I wrote in the past to include some restrictive CI pipeline checks for merging. I ran into an issue that doesn't appear during normal execution/testing with pytest but only when running pylint on a small reproducible example as below. I'm honestly not sure about the inner workings of pylint and so wanted to see if this is an understood problem in FreeCAD or not first.

Python file to reproduce:

Code: Select all

import FreeCAD
import Part

circ = Part.makeCircle(1, FreeCAD.Vector(0, 0, 0), FreeCAD.Vector(0, 0, 1), 0, 360)
circ.Placement = FreeCAD.Placement()
Then run (I do so from within a virtualenv - my pylint version is 2.17.0):

Code: Select all

pylint file_from_above.py
System Details

Code: Select all

OS: Linux Mint 20.2 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.20.1.
Build type: Release
Branch: unknown
Hash: 1397818c9664d158281339a84be59d3e9887f6ad
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, Vtk 7.1.1, OCC 7.5.2
Locale: English/United States (en_US)
User avatar
naxq0
Posts: 51
Joined: Wed Apr 25, 2018 7:45 am

Re: pylint segmentation fault when setting Part.Shape placement.

Post by naxq0 »

I'm not sure what's going on, but you should be able to get more information about where the segmentation fault is coming from by running it under gdb. So, something like

Code: Select all

gdb python
and then

Code: Select all

(gdb) run your-module-to-run.py 
Post Reply