pcbnew action plugin can crash kicad
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KiCad |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
In master branch a python script can crash pcbnew.
Tested with ReplicateLayout plugin from
https:/
To replicate it:
-Install the replicateLayout plugin
-Open the attached project
-Open pcbnew
-Select R15
-Tools->External Plugins->Replicate Layout
-in the dialog in "Hierarchy level select file5D...FA.sch
-Click OK
-Now the layout seems correctly replicated but exiting pcbnew (don't save) there is a segfault.
If, after running the script you try to undo it with ctrl-z you can get some other weird behaviour (like some new components without any label and not selectable on the board).
On 5.1.2 and 5.1.4 stable versions the script seems to work correctly (although it needed some modifications since the "Flip" function in dev version gets 3 arguments and in stable it did get two. May be overloading it with the old behaviour can help in not braking old scripts when V6 will be released)
gdb reports:
Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
0x00007ffff3b11078 in main_arena () from /lib/x86_
(gdb) backtrace
#0 0x00007ffff3b11078 in main_arena () from /lib/x86_
#1 0x00007fffd34da849 in PICKED_
#2 0x00007fffd2e74e80 in PCB_SCREEN:
#3 0x00007fffd31b09c9 in BASE_SCREEN:
#4 0x00007fffd2deb985 in PCB_EDIT_
#5 0x00007fffd2e1e5ef in PCB_EDIT_
#6 0x00007ffff634440e in wxAppConsoleBas
from /usr/lib/
#7 0x00007ffff64c9ea5 in wxEvtHandler:
from /usr/lib/
#8 0x00007ffff64c9f9b in wxEventHashTabl
#9 0x00007ffff64ca34b in wxEvtHandler:
#10 0x00007fffd3462e99 in EDA_BASE_
#11 0x00007ffff64ca153 in wxEvtHandler:
#12 0x00007ffff64ca435 in wxEvtHandler:
#13 0x00007ffff64ca1a7 in wxEvtHandler:
#14 0x00007ffff6e57be7 in wxWindowBase:
#15 0x00007ffff634440e in wxAppConsoleBas
from /usr/lib/
#16 0x00007ffff64c9ea5 in wxEvtHandler:
from /usr/lib/
#17 0x00007ffff64c9f9b in wxEventHashTabl
#18 0x00007ffff64ca34b in wxEvtHandler:
#19 0x00007fffd3462e99 in EDA_BASE_
#20 0x00007ffff64ca153 in wxEvtHandler:
#21 0x00007ffff64ca435 in wxEvtHandler:
#22 0x00007ffff6e562f8 in wxWindowBase:
#23 0x00007ffff64ca1a7 in wxEvtHandler:
#24 0x00007ffff6dfb2df in wxMenuBase:
#25 0x00007ffff6cdec1b in ?? () from /usr/lib/
#26 0x00007ffff2c35f75 in g_closure_invoke () from /usr/lib/
#27 0x00007ffff2c47f82 in ?? () from /usr/lib/
#28 0x00007ffff2c50bdc in g_signal_
#29 0x00007ffff2c50fbf in g_signal_emit () from /usr/lib/
---Type <return> to continue, or q <return> to quit---
#30 0x00007ffff337662e in gtk_widget_activate () from /usr/lib/
#31 0x00007ffff32714dd in gtk_menu_
#32 0x00007ffff3271846 in ?? () from /usr/lib/
#33 0x00007ffff325f7bc in ?? () from /usr/lib/
#34 0x00007ffff2c35f75 in g_closure_invoke () from /usr/lib/
#35 0x00007ffff2c4837d in ?? () from /usr/lib/
#36 0x00007ffff2c5067f in g_signal_
#37 0x00007ffff2c50fbf in g_signal_emit () from /usr/lib/
#38 0x00007ffff33778ac in ?? () from /usr/lib/
#39 0x00007ffff325df84 in gtk_propagate_event () from /usr/lib/
#40 0x00007ffff325e33b in gtk_main_do_event () from /usr/lib/
#41 0x00007ffff2ed3cbc in ?? () from /usr/lib/
#42 0x00007ffff21ac7f7 in g_main_
#43 0x00007ffff21aca60 in ?? () from /lib/x86_
#44 0x00007ffff21acd82 in g_main_loop_run () from /lib/x86_
#45 0x00007ffff325d3b7 in gtk_main () from /usr/lib/
#46 0x00007ffff6c41e65 in wxGUIEventLoop:
#47 0x00007ffff638627b in wxEventLoopBase
#48 0x00007ffff634b776 in wxAppConsoleBas
#49 0x00005555555d3536 in ?? ()
#50 0x00007ffff63d7cd0 in wxEntry(int&, wchar_t**) () from /usr/lib/
#51 0x00005555555af568 in ?? ()
#52 0x00007ffff37972e1 in __libc_start_main (main=0x5555555
rtld_
#53 0x00005555555bac8a in _start ()
*******
Application: Pcbnew
Version: (5.99.0-
Libraries:
wxWidgets 3.0.2
libcurl/7.52.1 OpenSSL/1.0.2s zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
Platform: Linux 4.9.0-8-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.2 (wchar_t,wx containers,
Boost: 1.69.0
OpenCASCADE Community Edition: 6.8.0
Curl: 7.52.1
Compiler: GCC 6.3.0 with C++ ABI 1010
Build settings:
KICAD_
KICAD_
KICAD_
KICAD_
KICAD_
KICAD_
BUILD_
KICAD_
KICAD_
KICAD_SPICE=ON
Changed in kicad: | |
milestone: | none → 6.0.0-rc1 |
status: | Incomplete → Fix Committed |
@Dino, does this plugin work correctly in the 5.1 branch? If not, it could be an issue with the plugin. The Python plugin exposes the low level internals of the board editor so you can write a script that can crash KiCad.