Spice: dlopen failure on MacOS with sallen_key demo

Bug #1836104 reported by Christian Conkle
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
High
Unassigned

Bug Description

Running Kicad 5.1.2-1 release on MacOS, simulating the sallen_key demo fails. Error message below. The other three simulation demos do not exhibit this problem, and I have not encountered it in any of my own projects.

Error message:

Circuit: KiCad schematic
Original line no.: 4, new internal line no.: 112:
Mismatch: 0 formal but 1 actual params.
Copies=120 Evals=119 Placeholders=0 Symbols=7 Errors=1
Numparam expansion errors: Problem with input file.
Error: ngspice.dll cannot recover and awaits to be detached
Note: can't find init file.
******
** ngspice-26 shared library
** Creation Date: Wed Apr 24 18:39:08 PDT 2019
******
dlopen(/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/ciderinit, 2): no suitable image found. Did find:
/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/ciderinit: file too short
/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/ciderinit: file too short
Error: Library /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/ciderinit couldn't be loaded!
dlopen(/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/spinit, 2): no suitable image found. Did find:
/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/spinit: file too short
/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/spinit: file too short
Error: Library /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/spinit couldn't be loaded!
dlopen(/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/devaxis, 2): no suitable image found. Did find:
/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/devaxis: file too short
/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/devaxis: file too short
Error: Library /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/devaxis couldn't be loaded!
dlopen(/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/devload, 2): no suitable image found. Did find:
/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/devload: file too short
/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/devload: file too short
Error: Library /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/devload couldn't be loaded!
dlopen(/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/spectrum, 2): no suitable image found. Did find:
/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/spectrum: unknown file type, first eight bytes: 0x2A 0x20 0x46 0x6F 0x75 0x72 0x69 0x65
/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/spectrum: unknown file type, first eight bytes: 0x2A 0x20 0x46 0x6F 0x75 0x72 0x69 0x65
Error: Library /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/spectrum couldn't be loaded!
dlopen(/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/setplot, 2): no suitable image found. Did find:
/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/setplot: file too short
/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/setplot: file too short
Error: Library /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/setplot couldn't be loaded!
Error: there aren't any circuits loaded.

Version info:

Application: kicad
Version: (5.1.2-1)-1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Platform: Mac OS X (Darwin 18.6.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (UTF-8,STL containers,compatible with 2.8)
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.54.0
    Compiler: Clang 9.0.0 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=ON
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

tags: added: macos ngspice
Revision history for this message
Adam Wolf (adamwolf) wrote : Re: [Bug 1836104] [NEW] Spice: dlopen failure on MacOS with sallen_key demo
Download full text (6.9 KiB)

Thanks nick!

Does this happen when you run via the sub application directly, rather
than from kicad.app?

On Wed, Jul 10, 2019 at 4:53 PM Launchpad Bug Tracker
<email address hidden> wrote:
>
> You have been subscribed to a public bug by Nick Østergaard (nickoe):
>
> Running Kicad 5.1.2-1 release on MacOS, simulating the sallen_key demo
> fails. Error message below. The other three simulation demos do not
> exhibit this problem, and I have not encountered it in any of my own
> projects.
>
> Error message:
>
> Circuit: KiCad schematic
> Original line no.: 4, new internal line no.: 112:
> Mismatch: 0 formal but 1 actual params.
> Copies=120 Evals=119 Placeholders=0 Symbols=7 Errors=1
> Numparam expansion errors: Problem with input file.
> Error: ngspice.dll cannot recover and awaits to be detached
> Note: can't find init file.
> ******
> ** ngspice-26 shared library
> ** Creation Date: Wed Apr 24 18:39:08 PDT 2019
> ******
> dlopen(/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/ciderinit, 2): no suitable image found. Did find:
> /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/ciderinit: file too short
> /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/ciderinit: file too short
> Error: Library /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/ciderinit couldn't be loaded!
> dlopen(/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/spinit, 2): no suitable image found. Did find:
> /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/spinit: file too short
> /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/spinit: file too short
> Error: Library /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/spinit couldn't be loaded!
> dlopen(/private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/devaxis, 2): no suitable image found. Did find:
> /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/devaxis: file too short
> /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/AppTranslocation/F9162324-ED31-4D36-9F19-0C393091D3D1/d/kicad.app/Contents/PlugIns/sim/ngspice/scripts/devaxis: file too short
> Error: Library /private/var/folders/0_/g58ld9zs70x__mjp5z9pvrzh0000gp/T/...

Read more...

Revision history for this message
Holger Vogt (h+vogt) wrote :

In https://bugs.launchpad.net/kicad/+bug/1835296/comments/25
we had the error message:

Circuit: KiCad schematic
Original line no.: 5, new internal line no.: 113:
Mismatch: 0 formal but 1 actual params.

here it is:
Circuit: KiCad schematic
Original line no.: 4, new internal line no.: 112:
Mismatch: 0 formal but 1 actual params.

So a least one line less is sent to ngspice, if the error is caused by the same specific line.

Christian, could you post the ngspice netlist here, that has been created by eeschema?

The ngspice error message is somewhat cryptic, but provides a hint. It is about the subcircuit (.subckt line in the OpAmp model) and its call here in the circuit (An instance line starting with the letter X). The .subckt line from the model does not have any parameters (0 formal), but the call to it by the X line has a parameter (1 actual). This does not match, ngspice gives up. Parameters are following the nodes and subckt names, towards the end of the line. This might be visible in the netlist, line no. 4.

Some speculation:
Might it happen that when this X line is generated by eeschema and sent to ngspice, something is added (a token, maybe a strange line ending)?

Revision history for this message
Christian Conkle (conklech) wrote :

The Spice netlist for the failing simulation:

.title KiCad schematic
.include "/Volumes/KiCad/demos/simulation/sallen_key/ad8051.lib"
V1 Net-_R1-Pad2_ GND AC 1
XU1 Net-_C2-Pad1_ "/lowpass" VDD VSS "/lowpass" AD8051
V2 VDD GND DC 10
V3 GND VSS DC 10
R2 Net-_C2-Pad1_ Net-_C1-Pad2_ 1k
R1 Net-_C1-Pad2_ Net-_R1-Pad2_ 1k
C1 "/lowpass" Net-_C1-Pad2_ 100n
C2 Net-_C2-Pad1_ GND 100n
.save @v1[i]
.save @v2[i]
.save @v3[i]
.save @r2[i]
.save @r1[i]
.save @c1[i]
.save @c2[i]
.save V(/lowpass)
.save V(GND)
.save V(Net-_C1-Pad2_)
.save V(Net-_C2-Pad1_)
.save V(Net-_R1-Pad2_)
.save V(VDD)
.save V(VSS)
.ac dec 10 1 1Meg
.end

The referenced .lib file (included with KiCad; copied here for convenience):

* AD8051 SPICE Macro-model
* Description: Amplifier
* Generic Desc: Single 110 MHz rail-to-rail op amp - 3V
* Developed by: JCH / ADI
* Revision History: 08/10/2012 - Updated to new header style
* 0.0 (09/1998)
* Copyright 1998, 2012 by Analog Devices, Inc.
*
* Refer to http://www.analog.com/Analog_Root/static/techSupport/designTools/spiceModels/license/spice_general.html for License Statement. Use of this model
* indicates your acceptance with the terms and provisions in the License Statement.
*
* BEGIN Notes:
*
* Not Modeled:
* CMRR IS NOT MODELED
*
* Parameters modeled include:
* THIS MODEL IS FOR SINGLE SUPPLY OPERATION (+5V)
*
* END Notes
*
* Node assignments
* noninverting input
* | inverting input
* | | positive supply
* | | | negative supply
* | | | | output
* | | | | |
* | | | | |
.SUBCKT AD8051 1 2 99 50 45
*
* INPUT STAGE
*
Q1 4 3 5 QPI
Q2 6 2 7 QPI
RC1 50 4 20.5k
RC2 50 6 20.5k
RE1 5 8 5k
RE2 7 8 5k
EOS 3 1 POLY(1) 53 98 1.7E-3 1
IOS 1 2 0.1u
FNOI1 1 0 VMEAS2 1E-4
FNOI2 2 0 VMEAS2 1E-4

CPAR1 3 50 1.7p
CPAR2 2 50 1.7p
VCMH1 99 9 1
VCMH2 99 10 1
D1 5 9 DX
D2 7 10 DX
IBIAS 99 8 73u
*
* INTERNAL VOLTAGE REFERENCE
*
EREF1 98 0 POLY(2) 99 0 50 0 0 0.5 0.5
EREF2 97 0 POLY(2) 1 0 2 0 0 0.5 0.5
GREF2 97 0 97 0 1E-6
*
*VOLTAGE NOISE STAGE
*
DN1 51 52 DNOI1
VN1 51 98 0.61
VMEAS 52 98 0
RNOI1 52 98 6.5E-3

H1 53 98 VMEAS 1
RNOI2 53 98 1
*
*CURRENT NOISE STAGE
*
DN2 61 62 DNOI2
VN2 61 98 0.545
VMEAS2 62 98 0
RNOI3 62 98 2E-4
*
* INTERMEDIATE GAIN STAGE WITH POLE = 96MHz
*
G1 98 20 4 6 1E-3
RP1 98 20 550
CP1 98 20 3p
*
* GAIN STAGE WITH DOMINANT POLE
*
G4 98 30 20 98 2.6E-3
RG1 30 98 155k
CF1 30 45 13.5p
D5 31 99 DX
D6 50 32 DX
V1 31 30 0.6
V2 30 32 0.6
*
* OUTPUT STAGE
*
Q3 45 42 99 QPOX
Q4 45 44 50 QNOX
EO3 99 42 POLY(1) 98 30 0.7175 0.5
EO4 44 50 POLY(1) 30 98 0.7355 0.5
*
* MODELS
*
.MODEL QPI PNP (IS=8.6E-18,BF=91,VAF=30.6)
.MODEL QNOX NPN(IS=6.37E-16,BF=100,VAF=90,RC=3)
.MODEL QPOX PNP(IS=1.19E-15,BF=112,VAF=19.2,RC=6)
.MODEL DX D(IS=1E-16)
.MODEL DZ D(IS=1E-14,BV=6.6)
.MODEL DNOI1 D(KF=9E-10)
.MODEL DNOI2 D(KF=1E-8)
.ENDS AD8051

Revision history for this message
Holger Vogt (h+vogt) wrote :

This looks reasonable. I get he same with 5.1.2 release under Windows.

O.k., this is what Eeschema thinks it is sending to ngspice.

Another test, what really has been sent:

Could you please place a text box into the Eeschema ciruit diagram window containing the following:

.control
listing
.endc

If you then run the simulation, you will get (among some other output) a listing of the input file, as has been aquired by ngspice.

Revision history for this message
Holger Vogt (h+vogt) wrote :

I just made a check, reading a defect input file.

Unfortunately the 'listing' command could not be executed, probably because the input file could not be parsed successfully. So maybe we have to find another way for analysing the problem.

Revision history for this message
Holger Vogt (h+vogt) wrote :

There is another way:

Place a spice.rc file into yout HOME directory.

Enter a string

set ngdebug

into the second row (keep the first row empty).

ngspice now emits a file debug-out.txt into its 'current directory'. You (KiCAD) needs to have write access to this folder.

debug-out.txt contains the transmitted input file, before subcircuit handling is done. Attach the file here, I will compare it to my output.

Revision history for this message
Holger Vogt (h+vogt) wrote :

Addendum:

You have to re-start KiCAD (Eeschema) for reading spice.rc.

Revision history for this message
Christian Conkle (conklech) wrote :

@Holger - Here you go.

For reference, I had to use ~/.spiceinit not ~/spice.rc (nothing happened with the latter), and I also had to start KiCad from the command line (to set $PWD to something sane). If I start KiCad normally (e.g. by double-clicking on it), libngspice segfaults in system_c/flockfile. Presumably the default $PWD is something sandboxed or write-protected. Should I open a new bug for that?

Revision history for this message
Holger Vogt (h+vogt) wrote :

Both ddebug_out.txt (ngspice-26 or ngspice-30) are the same in the critical lines.

Befrore putting too much additional effort into debugging:

If I run the netlist from https://bugs.launchpad.net/kicad/+bug/1836104/comments/3 in ngspice-26 standard executable, it produces the same error

Original line no.: 4, new internal line no.: 112:
Mismatch: 0 formal but 1 actual params.

If I run it in ngspice-27, it moves beyond that error, but finally crashes. From ngspice-28 on running this netlist is o.k.

Old ngspice has had problems with complex net names like Net-_C2-Pad1_ . For example '-' was not aknowledged. Maybe that net names generation in KiCAD has changed, so that the old examples now fail to simulate.

So may I suggest not pursuing to debug eeschema/ngspice-26, but concentrate on ngspice-30 and the bug from https://bugs.launchpad.net/kicad/+bug/1835296.

@Christian, does 'your' bug cited above disapper with ngspice-30 library?

Revision history for this message
Jonatan Liljedahl (kymatica) wrote :

See https://bugs.launchpad.net/kicad/+bug/1836502

I believe it's the quotes around named nets that messes things up. (Added by commit 216573bf4827e8ca98635e1b95efa0c02c94b53f)

Changed in kicad:
milestone: none → 5.1.3
tags: added: eeschema
Revision history for this message
Christian Conkle (conklech) wrote :

@Holger - I think bug 1835296 affects *only* ngspice-30; I don't know if this bug (1836104) affects ngspice-30 or not. (If the other bug is MacOS only and this one is platform-independent, it might be testable on another platform.) I agree that getting ngspice-30 working would be preferable, but it might be necessary to stick with ngspice-26 on MacOS until 1835296 is resolved.

Revision history for this message
Adam Wolf (adamwolf) wrote : Re: [Bug 1836104] Re: Spice: dlopen failure on MacOS with sallen_key demo

I think it makes sense for me to go back to ngspice-26 for macOS for
the upcoming point release. I do not have a strong opinion regarding
nightlies. Do we know if these bugs are macOS only or not?

On Wed, Jul 17, 2019 at 2:25 PM Christian Conkle <email address hidden> wrote:
>
> @Holger - I think bug 1835296 affects *only* ngspice-30; I don't know if
> this bug (1836104) affects ngspice-30 or not. (If the other bug is MacOS
> only and this one is platform-independent, it might be testable on
> another platform.) I agree that getting ngspice-30 working would be
> preferable, but it might be necessary to stick with ngspice-26 on MacOS
> until 1835296 is resolved.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1836104
>
> Title:
> Spice: dlopen failure on MacOS with sallen_key demo
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1836104/+subscriptions

Revision history for this message
Nick Østergaard (nickoe) wrote :

@Adam, did you try to do the revert as proposed in https://bugs.launchpad.net/kicad/+bug/1836502/comments/1 ?

Revision history for this message
Adam Wolf (adamwolf) wrote :

I did not. I can try it tomorrow.

On Thu, Jul 18, 2019 at 2:40 PM Nick Østergaard
<email address hidden> wrote:
>
> @Adam, did you try to do the revert as proposed in
> https://bugs.launchpad.net/kicad/+bug/1836502/comments/1 ?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1836104
>
> Title:
> Spice: dlopen failure on MacOS with sallen_key demo
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1836104/+subscriptions

Revision history for this message
Holger Vogt (h+vogt) wrote :

Error message:

Circuit: KiCad schematic
Original line no.: 4, new internal line no.: 112:
Mismatch: 0 formal but 1 actual params.

probably will be healed by reverting mentioned commit https://git.launchpad.net/kicad/commit/?h=5.1&id=216573bf4827e8ca98635e1b95efa0c02c94b53f.

Revision history for this message
Holger Vogt (h+vogt) wrote :

This bug is platform independent, but is about ngspice-26 and -27 only, not ngspice-30.

Changed in kicad:
milestone: 5.1.3 → 5.1.4
Changed in kicad:
milestone: 5.1.4 → 5.1.5
Revision history for this message
Adam Wolf (adamwolf) wrote :

The quote names reversion was done in KiCad, correct?

Should I change the nightlies to ngspice-26? Please advise.

Revision history for this message
Nick Østergaard (nickoe) wrote :

I think that is correct.

I think we should stick with ngspice-30 and make it work.

ngpsice-26 has some other annoying bugs.

I lost track on weather or not you were using ngspice-30 or not on the normal builds and the builds were not running for some time, so I stopped trying to figure out what was wrong.

If we keep it at ngspice-30 and not change it every day it is easier to poke macos users to check things.

Revision history for this message
Adam Wolf (adamwolf) wrote :

Alright. it's at ngspice-30, builds are going. We had a person
asking on the dev list for it to be reverted since "it doesn't work".

I don't know enough about it to respond.

On Wed, Aug 28, 2019 at 11:31 AM Nick Østergaard
<email address hidden> wrote:
>
> I think that is correct.
>
> I think we should stick with ngspice-30 and make it work.
>
> ngpsice-26 has some other annoying bugs.
>
> I lost track on weather or not you were using ngspice-30 or not on the
> normal builds and the builds were not running for some time, so I
> stopped trying to figure out what was wrong.
>
> If we keep it at ngspice-30 and not change it every day it is easier to
> poke macos users to check things.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1836104
>
> Title:
> Spice: dlopen failure on MacOS with sallen_key demo
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1836104/+subscriptions

Revision history for this message
Holger Vogt (h+vogt) wrote :

There may be a simple explanation.

The original error message was:

Error message:

Circuit: KiCad schematic
Original line no.: 4, new internal line no.: 112:
Mismatch: 0 formal but 1 actual params.
Copies=120 Evals=119 Placeholders=0 Symbols=7 Errors=1
Numparam expansion errors: Problem with input file.
Error: ngspice.dll cannot recover and awaits to be detached

meaning that some obscure parameter has been found appended to a subcircuit call (x line). The line stems from the input file.

I recently have stumbled over a problem that may be similar. I am using KiCad and ngspice with OS windows (7 or 10). I tried to simulate some circuit that permanently failed, because it was unable to read some model file. Everything in the files looked o.k., the model file was there, the call to the model was o.k., but ngspice did not get it.

Running ngspice in the debugger it showed up that the .model line had been appended to the title line of the model file during reading the file by ngspice, instead of being the separate second line. A closer look at the model file with notepad++ revealed the reason. The model file was encoded with line ending Macintosh (CR). Linux uses LF, Windows CRLF. CR only is probably not sufficient to be accepted as line ending in ngspice. Changing the line endings to LF, everything worked o.k. in my example.

I have never heard any complaints about this issue, but it may be the reason. Simple to check, change line endings of Sallen Key input files to Windows, it should work immediately, if that's the cause of failure.

Finally we have to decide what to do with this bug.

Revision history for this message
Holger Vogt (h+vogt) wrote :

I have been checking the input files provided by https://bugs.launchpad.net/kicad/+bug/1841752, no problems to run under Windows, but also no input files found there with CR line endings only.

There is a different error message in this new thread, crash in file MIFSetup.c. This has already been reported somewhere else.

I would need help from somebody compiling ngspice dll for macOS with debug info, then starting Eeschema, loading the circuit, starting the simulator by Tools--> Simulator, then attaching the debugger, then running the simulation.

Revision history for this message
Nick Østergaard (nickoe) wrote :

@Christian, please retest on the latest nightlies. I think it works there, please confirm.

Changed in kicad:
status: New → Incomplete
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Would one of our macos users please test the sallen key demo with 5.1.4 to see if this is still an issue? I believe we can close this but I need confirmation.

Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :

Crashed for me on 5.1.4 from the KiCad website.

Application: KiCad
Version: (5.1.4-0-10_14), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Platform: Mac OS X (Darwin 18.7.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    wxWidgets: 3.0.4 (wchar_t,STL containers,compatible with 2.8)
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.54.0
    Compiler: Clang 9.0.0 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=ON
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Holger Vogt (h+vogt) wrote :

This bug report
Simulation fails with error message, ngspice-26, macOS
no crash, but premature stop
has been fixed (probably) by reverting adding '"' around netnames https://git.launchpad.net/kicad/commit/?h=5.1&id=3c8f901a1f2bfd7b490c408126017c9a73a7e2c6

https://bugs.launchpad.net/kicad/+bug/1835296
crash (segfault) using either Sallen-Key or laser driver demo, ngspice-30, macOS

https://bugs.launchpad.net/kicad/+bug/1841752
crash (segfault) with custom circuit, crash log similar to bug report 1835296 above, ngspice-30, macOS

https://bugs.launchpad.net/kicad/+bug/1841752/comments/9 indicates that the crash might have gone with nightlies and testing.

So please test Sallen-Key and laser driver demo also with the the latest build from

https://kicad-downloads.s3.cern.ch/index.html?prefix=osx/testing/5.1/

Revision history for this message
Christian Conkle (conklech) wrote :

For me, both the current 5.1.4 release and latest nightly (kicad-5.1-unified-20190911-052317-ff80747ca-10_14.dmg) crash as reported in bug 1835296.

https://bugs.launchpad.net/kicad/+bug/1835296/comments/44

Changed in kicad:
status: Incomplete → Confirmed
importance: Undecided → High
Revision history for this message
Holger Vogt (h+vogt) wrote :

This bug report at #1
Simulation fails with error message, ngspice-26, macOS
no crash, but premature stop
has been fixed by reverting adding '"' around netnames https://git.launchpad.net/kicad/commit/?h=5.1&id=3c8f901a1f2bfd7b490c408126017c9a73a7e2c6

When the above bug was fixed, ngspice could move on to hit the next bug, namely the one described in
https://bugs.launchpad.net/kicad/+bug/1835296
crash (segfault) using either Sallen-Key or laser driver demo, ngspice-30, macOS

Therefore i.m.o. this thread here may be closed.

The work is going on in https://bugs.launchpad.net/kicad/+bug/1835296

Revision history for this message
Nick Østergaard (nickoe) wrote :

Closing as of comment #27 above.

Changed in kicad:
status: Confirmed → Fix Committed
Revision history for this message
Ian McInerney (imcinerney) wrote :

@Holger, I will mark this report as fix committed then since it was taken care of with the reversion of that commit that JP did earlier.

Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.