2019-05-07 22:09:52 |
Richard Graham |
description |
When using the python interface, Kicad crashes with a segfault following refresh when a filled zone is added in some cases.
Following code is a minimal example reproducing the problem:
import pcbnew
from pcbnew import FromMM
board = pcbnew.GetBoard()
zone = pcbnew.ZONE_CONTAINER(board)
sps = pcbnew.SHAPE_POLY_SET()
chain = pcbnew.SHAPE_LINE_CHAIN()
chain.Append( FromMM(0.0), FromMM(0.0) )
chain.Append( FromMM(20.0), FromMM(0.0) )
chain.Append( FromMM(20.0), FromMM(20.0) )
chain.Append( FromMM(0.0), FromMM(20.0) )
chain.SetClosed(True)
sps.AddOutline(chain)
zone.SetOutline(sps)
board.Add(zone)
pcbnew.Refresh()
Interestingly, problem only occurs when the shape is square, i.e. when last chain append is to (0.0,20) as above. If changed to (0.1, 20), or omitted (to make a triangle) then it works fine. |
When using the python interface, Kicad crashes with a segfault following refresh when a filled zone is added in some cases.
Following code is a minimal example reproducing the problem:
import pcbnew
from pcbnew import FromMM
board = pcbnew.GetBoard()
zone = pcbnew.ZONE_CONTAINER(board)
sps = pcbnew.SHAPE_POLY_SET()
chain = pcbnew.SHAPE_LINE_CHAIN()
chain.Append( FromMM(0.0), FromMM(0.0) )
chain.Append( FromMM(20.0), FromMM(0.0) )
chain.Append( FromMM(20.0), FromMM(20.0) )
chain.Append( FromMM(0.0), FromMM(20.0) )
chain.SetClosed(True)
sps.AddOutline(chain)
zone.SetOutline(sps)
board.Add(zone)
pcbnew.Refresh()
Interestingly, problem only occurs when the shape is square, i.e. when last chain append is to (0.0,20) as above. If changed to (0.1, 20), or omitted (to make a triangle) then it works fine.
Application: kicad
Version: 6.0.0-unknown-r15606.f1a38a6d4.fc30, debug build
Libraries:
wxWidgets 3.0.4
libcurl/7.64.0 OpenSSL/1.1.1b zlib/1.2.11 brotli/1.0.7 libidn2/2.1.1 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.8.7/openssl/zlib nghttp2/1.38.0
Platform: Linux 5.0.11-300.fc30.x86_64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
Boost: 1.69.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.64.0
Compiler: GCC 9.0.1 with C++ ABI 1013
Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON |
|