Calling BOARD.AddNative twice with same aItem causes hard freeze

Bug #1683085 reported by captain_morgan
6
This bug affects 1 person
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("/tmp/sdfsdf.kicad_pcb")

Application: kicad
Version: 4.0.6-e0-6349~53~ubuntu16.04.1 release build
wxWidgets: Version 3.0.2 (debug,wchar_t,compiler with C++ ABI 1009,GCC 5.4.0,wx containers,compatible with 2.8)
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
         USE_WX_GRAPHICS_CONTEXT=OFF
         USE_WX_OVERLAY=OFF
         KICAD_SCRIPTING=ON
         KICAD_SCRIPTING_MODULES=ON
         KICAD_SCRIPTING_WXPYTHON=ON
         USE_FP_LIB_TABLE=HARD_CODED_ON
         BUILD_GITHUB_PLUGIN=ON

description: updated
Revision history for this message
Seth Hillbrand (sethh) wrote :

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.

Changed in kicad:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.