Crash when exporting Spice Netlist to read-only directory
Description
KiCad crashes when you attempt to export a Spice netlist to a directory without write permissions. "terminate called after throwing an instance of 'IO_ERROR'" is printed to the terminal.
Other netlist formats give an error message rather than crashing, although the error message is different depending on which netlist format is selected.
- KiCad: "Permission denied"
- OrCAD: "Failed to create file 'usr/share/kicad/demos/simulation/sallen_key/sallen_key.net"
- CADSTAR: same as OrCAD
- Spice: crash
Steps to reproduce
- Project Manager: File -> Open Demo Project -> browse to
simulation/sallen_key/sallen_key.pro
. Note that the demos should be installed to a read-only directory for these steps to reproduce -- for me the demos are in/usr/share/kicad/demos/
. - Open the schematic
- File -> Export -> Netlist...
- Select "Spice" format
- Click "Export Netlist"
- Select a read-only location, such as the project directory if the demo is in a read-only directory
- KiCad crashes
KiCad Version
Application: KiCad
Version: (6.0.4), release build
Libraries:
wxWidgets 3.0.5
libcurl/7.82.0 OpenSSL/1.1.1n zlib/1.2.12 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.2 libpsl/0.21.1 (+libidn2/2.3.0) libssh2/1.10.0 nghttp2/1.47.0
Platform: Linux 5.15.34-1-lts x86_64, 64 bit, Little endian, wxGTK, KDE, x11
Build Info:
Date: Mar 18 2022 08:05:28
wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.78.0
OCC: 7.5.3
Curl: 7.82.0
ngspice: 36
Compiler: GCC 11.2.0 with C++ ABI 1016
Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON