[Bug 2048906] Re: [SRU] ngspice-36 crashes in various ways
Dave Jones
2048906 at bugs.launchpad.net
Mon Mar 25 15:55:31 UTC 2024
Confirmed the issue on jammy, patch looks good, so I'll sponsor this for
jammy. Thanks!
--
You received this bug notification because you are a member of Ubuntu
Sponsors, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/2048906
Title:
[SRU] ngspice-36 crashes in various ways
Status in ngspice package in Ubuntu:
Fix Released
Status in ngspice source package in Jammy:
Confirmed
Bug description:
[ Impact ]
ngspice will sometimes crash on some trivial circuits and will result in Segmentation fault.
Though upstream mentioned these types of circuits causing the segfault as "strange input".
[ Test Plan ]
* create a test file named "test.netlist" with the following content:
.title KiCad schematic
.save all
.probe alli
.end
* execute "ngspice" command
* run this command: "source test.netlist" on the ngspice prompt.
With the fixed package it will print:
Circuit: KiCad schematic
[ Where problems could occur ]
It is an upstream patch which only adds an check for a pointer before
dereferencing it and there is a little chance of any regression
because of this patch.
[ Other Info ]
The patch in the debdiff looks quite big due to the indentation
changes but the real change is only:
@@ -1130,6 +1130,7 @@ static char* get_terminal_number(char* e
Called from inp.c*/
void modprobenames(INPtables* tab) {
GENinstance* GENinst;
+ if (tab->defVmod) {
for (GENinst = tab->defVmod->GENinstances; GENinst; GENinst = GENinst->GENnextInstance) {
char* name = GENinst->GENname;
/* Do not inlude the x in the new name, XU1 -> U1 */
@@ -1159,4 +1160,5 @@ void modprobenames(INPtables* tab) {
}
}
}
+ }
}
[ Original Bug Description ]
$ lsb_release -rd
Description: Ubuntu 22.04.3 LTS
Release: 22.04
ngspice version: 36+ds-1
The following happens:
=============================================
ngspice is used by KiCad to simulate circuits.
I have noticed that ngspice tends to crash or fail on relatively simple circuits.
Taking KiCad out of equation I can see that even trivialities lead to
crashes.
For example, create a text file "test.netlist" with the following
content:
--- CUT ---
.title KiCad schematic
.save all
.probe alli
.end
--- CUT ---
Then start ngspice command line tool and run this command: "source
test.netlist".
The results would be this:
--- CUT ---
No compatibility mode selected!
Circuit: KiCad schematic
Segmentation fault (core dumped)
--- CUT ---
Other than segmentation faults, sometimes ngspice attempts to allocate
a negative amount of memory (which also results in crashes).
The following is expected:
=============================================
I expect that ngspice would not crash and would instead either do what it is asked to do or report errors.
Suggested change:
=============================================
Update ngspice from version 3.6 to version 4.2: I have built v4.2 myself and checked - it appears to work or report genuine errors in all cases where the old ngspice simply crashes with no apparent reason.
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: ngspice 36+ds-1
ProcVersionSignature: Ubuntu 6.2.0-35.35~22.04.1-generic 6.2.16
Uname: Linux 6.2.0-35-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: GNOME
Date: Wed Jan 10 14:32:41 2024
InstallationDate: Installed on 2021-07-03 (921 days ago)
InstallationMedia: Ubuntu-MATE 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: ngspice
UpgradeStatus: Upgraded to jammy on 2023-09-12 (119 days ago)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ngspice/+bug/2048906/+subscriptions
More information about the Ubuntu-sponsors
mailing list