KiCAD Crach on simulating after a change of project

Bug #1753092 reported by Julien Faucher
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Critical
Maciej Suminski

Bug Description

Hi all.

I ran across a full KiCAD crash bug.

With a project A, open the simulator try a simulation.
Close the simulator and your design.
Open another project B through "Open Recent", launch a simulation. The design must include some SPICE models located in another directory.
You will have some (false) errors because the simulator doesn't seems to find the libs (but that's another bug).

Dismiss all pop-ups.
Click on "Launch Simulation"
Dismiss all pop-ups again.
The last pop-up will crash KiCAD.

When i write "try a simulation" or "launch it", I mean set it up and launch the simulation (in my case, transient simulations) as it's mean to be used.

I'll join my working directory (with the two projects)
Project A is "slowactivator" and project B is "phase"

You will find the .libs files in "spice".

You should replace the paths in my design by the path which should work for you.

Enjoy !
Julien FAUCHER

I produced a back-trace :

(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff55bff5d in __GI_abort () at abort.c:90
#2 0x00007ffff560828d in __libc_message (action=action@entry=do_abort,
    fmt=fmt@entry=0x7ffff572f528 "*** Error in `%s': %s: 0x%s ***\n")
    at ../sysdeps/posix/libc_fatal.c:181
#3 0x00007ffff560f64a in malloc_printerr (action=<optimized out>,
    str=0x7ffff572f8b0 "double free or corruption (out)", ptr=<optimized out>,
    ar_ptr=<optimized out>) at malloc.c:5426
#4 0x00007ffff561173e in _int_free (av=0x7ffff5961c20 <main_arena>,
    p=<optimized out>, have_lock=0) at malloc.c:4175
#5 0x00007ffff561644e in __GI___libc_free (mem=<optimized out>)
    at malloc.c:3145
#6 0x00007fffe16ffaca in ?? () from /usr/bin/_eeschema.kiface
#7 0x00007fffe15d5698 in ?? () from /usr/bin/_eeschema.kiface
#8 0x00007fffe04d66aa in ?? () from /usr/lib/x86_64-linux-gnu/libngspice.so.0
#9 0x00007fffe04d6a42 in ?? () from /usr/lib/x86_64-linux-gnu/libngspice.so.0
#10 0x00007fffe04d77a6 in ?? () from /usr/lib/x86_64-linux-gnu/libngspice.so.0
#11 0x00007fffe096454f in ?? () from /usr/lib/x86_64-linux-gnu/libngspice.so.0
#12 0x00007fffe051b864 in ?? () from /usr/lib/x86_64-linux-gnu/libngspice.so.0
#13 0x00007fffe04f5387 in ?? () from /usr/lib/x86_64-linux-gnu/libngspice.so.0
#14 0x00007fffe04f6e97 in ?? () from /usr/lib/x86_64-linux-gnu/libngspice.so.0
#15 0x00007fffe04d6402 in ngSpice_Circ ()
   from /usr/lib/x86_64-linux-gnu/libngspice.so.0
#16 0x00007fffe15d6a10 in ?? () from /usr/bin/_eeschema.kiface
#17 0x00007fffe15dc2da in ?? () from /usr/bin/_eeschema.kiface
#18 0x00007ffff69bb7ee in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0

And I'm under :

Application: kicad
Version: 5.0.0-rc2-dev-unknown-d5ac7c0~62~ubuntu17.10.1, release build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.55.1 OpenSSL/1.0.2g zlib/1.2.11 libidn2/2.0.2 libpsl/0.18.0 (+libidn2/2.0.2) librtmp/2.3
Platform: Linux 4.13.0-36-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.62.0
    Curl: 7.55.1
    Compiler: GCC 7.2.0 with C++ ABI 1011

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

Revision history for this message
Julien Faucher (suzizecat) wrote :
Changed in kicad:
importance: Undecided → Critical
milestone: none → 5.0.0-rc2
Revision history for this message
Tomasz Wlostowski (twlostow) wrote :

Managed to crash the app in a slightly different way than Julien.

Changed in kicad:
status: New → Confirmed
Revision history for this message
Jon Evans (craftyjon) wrote :

@Tom are you working on this one?

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Tom is away for two weeks, I will take care of this.

Changed in kicad:
assignee: nobody → Maciej Suminski (orsonmmz)
Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Julien, if you are able to reliably reproduce the crash, could you check the next nightly (newer than 201803211517+7b4a8d7~62) and tell me if it works for you?

Revision history for this message
Julien Faucher (suzizecat) wrote :

On today nightly, the crash doesn't append anymore.
It may have been related to #1753094

But in another hand, i can't repeat the protocol, since ngspice doesn't know the meaning of "TEMP" anymore...

It says : Undefined number [TEMP]

Should I open another bug for that ?

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Thank you for testing. Regarding the "TEMP" problem: is it only a ngspice-in-KiCad problem, i.e. does the regular ngspice support it correctly? If so, did it work earlier? If the answer is 'yes' for any of the questions, please file a bug report.
Also, can we get an example file to investigate the issue? The files you have attached previously helped a lot during the debug process.

Changed in kicad:
status: Confirmed → Fix Committed
Revision history for this message
Julien Faucher (suzizecat) wrote :

Thanks for the feedback.

That's kinda weird since its look like an ngspice bug (it doesn't support it when i try with gSpiceUi and ngspice 26) but I've been able to simulate that before without any problem...

You just have to simulate the "slowactivator" design from above. The problem comes from the zener diode model.

I feel like i'm good to fill a bug ticket to ngspice team T^T

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

From the description I conclude it is an ngspice bug. If you find out that it works in ngspice, but not in KiCad - please report it.

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.