Calling BOARD.AddNative twice with same aItem causes hard freeze
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KiCad |
Invalid
|
Undecided
|
Unassigned |
Bug Description
In some cases it freezes right away while calling .AddNative in other cases (like the example) it doesn't freeze until calling .Save() and
may result in a Core Dump.
CPU consumption hits 100%
import pcbnew
b = pcbnew.BOARD()
a = pcbnew.VIA(b)
p = pcbnew.wxPoint(10, 10)
a.SetPosition(p)
print("Adding first")
b.AddNative(a)
print("Adding second")
b.AddNative(a)
print("done")
b.Save(
Application: kicad
Version: 4.0.6-e0-
wxWidgets: Version 3.0.2 (debug,
Platform: Linux 4.4.0-72-generic x86_64, 64 bit, Little endian, wxGTK
Boost version: 1.58.0
Curl version: libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
description: | updated |
AddNative should not be called via Python unless you explicitly declare that your interface no longer owns the item. Otherwise python will assign the element to garbage collection (hence the intermittent freeze) when it still exists in the board.
Use Add() instead.