[Bug 2048906] Re: [SRU] ngspice-36 crashes in various ways

2024-06-05 Thread Launchpad Bug Tracker
This bug was fixed in the package ngspice - 36+ds-1ubuntu0.1

---
ngspice (36+ds-1ubuntu0.1) jammy; urgency=medium

  * d/p/fixes/segfault-fix-modprobe.patch: Fix ngspice crash with
trivial input. (LP: #2048906)

 -- Sudip Mukherjee   Mon, 11 Mar 2024
21:44:53 +

** Changed in: ngspice (Ubuntu Jammy)
   Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2048906

Title:
  [SRU] ngspice-36 crashes in various ways

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ngspice/+bug/2048906/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2048906] Re: [SRU] ngspice-36 crashes in various ways

2024-05-04 Thread Sudip Mukherjee
I can confirm that ngspice from jammy-proposed has fixed the bug for me.

Test done:

Install ngspice on a jammy installation.
create the test.netlist file with the content from the testplan
execute ngspice
run "source test.netlist" on the ngspice prompt.
confirm that ngspice fails with coredump.

Add jammy-proposed to apt sources
update ngspice from jammy-proposed
run "source test.netlist" on the ngspice prompt.
confirm that ngspice does not fail and prints the title "Circuit: KiCad 
schematic".

Test result: the issue with ngspice has been fixed.

Package tested:

$ apt-cache policy ngspice
ngspice:
  Installed: 36+ds-1ubuntu0.1
  Candidate: 36+ds-1ubuntu0.1
  Version table:
 *** 36+ds-1ubuntu0.1 500
500 http://gb.archive.ubuntu.com/ubuntu jammy-proposed/universe amd64 
Packages
100 /var/lib/dpkg/status
 36+ds-1 500
500 http://gb.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages

** Tags removed: verification-needed verification-needed-jammy
** Tags added: verification-done verification-done-jammy

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2048906

Title:
  [SRU] ngspice-36 crashes in various ways

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ngspice/+bug/2048906/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2048906] Re: [SRU] ngspice-36 crashes in various ways

2024-04-10 Thread Robie Basak
Hello Denys, or anyone else affected,

Accepted ngspice into jammy-proposed. The package will build now and be
available at
https://launchpad.net/ubuntu/+source/ngspice/36+ds-1ubuntu0.1 in a few
hours, and then in the -proposed repository.

Please help us by testing this new package.  See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed.  Your feedback will aid us getting this
update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, what testing has been
performed on the package and change the tag from verification-needed-
jammy to verification-done-jammy. If it does not fix the bug for you,
please add a comment stating that, and change the tag to verification-
failed-jammy. In either case, without details of your testing we will
not be able to proceed.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification .  Thank you in
advance for helping!

N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.

** Description changed:

  [ 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.
+ 
+ [racb] The modprobenames function will now do nothing under some
+ circumstances. This seems OK and is the intention of this change, but if
+ there's a regression then it is likely to be because of a consequence of
+ this. It always needs to dereference a pointer, and a null pointer
+ deference is always bad, so in the worst case it seems like it would be
+ that the bug isn't really fixed, eg. some kind of silent failure or
+ logic error.
  
  [ 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: 

[Bug 2048906] Re: [SRU] ngspice-36 crashes in various ways

2024-03-25 Thread Dave Jones
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
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2048906

Title:
  [SRU] ngspice-36 crashes in various ways

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ngspice/+bug/2048906/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2048906] Re: [SRU] ngspice-36 crashes in various ways

2024-03-11 Thread Sudip Mukherjee
debdiff attached.

** Summary changed:

- ngspice-36 crashes in various ways
+ [SRU] ngspice-36 crashes in various ways

** Description changed:

+ [ 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 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)

** Patch added: "ngspice.debdiff"
   
https://bugs.launchpad.net/ubuntu/jammy/+source/ngspice/+bug/2048906/+attachment/5754976/+files/ngspice.debdiff

** Description changed:

  [ 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 but the real change is only:
+ 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;
+ Called from inp.c*/
+  void