Running simulation without defined sim command segfaults
Description
Kicad segfaults if you attempt to run a simulation without defining the sim command in the simulation settings gui.
If there isn't a sim command in a text box on the schematic, the "You need to select the simulation settings." popup pops up right before the crash.
If there is a sim command defined in a text box in the schematic, the popup doesn't show up, but kicad still crashes.
Actually, the only thing necessary to prevent the crash is to open Simulation Settings; it's not necessary to actually set a simulation command. You can cancel out of the settings and that's enough to prevent the crash. Maybe something isn't getting initialized until the settings window opens?
This crash doesn't happen on 8831b5a7, so I suspect it was introduced by 6a48e21e.
Backtrace (sorry, Release build today, hopefully this is still useful
Steps to reproduce
- Open sallen-key demo (others will work, including a blank schematic)
- Inspect -> Simulator
- Run Simulation (do not edit the simulation settings to define a sim command)
- Segfault
- Restart kicad
- open same project
- Inspect -> Simulator, Simulator -> Settings, setup simulation (e.g. transient, timestep 1u, end 10m)
- Run Simulation
- No crash
KiCad Version
Application: Eeschema
Version: (5.99.0-8606-g6a48e21eb2), release build
Libraries:
wxWidgets 3.0.5
libcurl/7.74.0 OpenSSL/1.1.1i zlib/1.2.11 zstd/1.4.5 libidn2/2.3.0 libpsl/0.21.1 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.41.0
Platform: Linux 5.4.85-1-lts x86_64, 64 bit, Little endian, wxGTK, KDE, x11
Build Info:
Date: Jan 25 2021 22:42:36
wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.75.0
OCC: 7.5.0
Curl: 7.74.0
ngspice: 33
Compiler: GCC 10.2.0 with C++ ABI 1014
Build settings:
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
KICAD_USE_OCC=ON
KICAD_SPICE=ON