Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXCEPTION_ACCESS_VIOLATION when running #32

Open
Tyde opened this issue Feb 10, 2022 · 4 comments
Open

EXCEPTION_ACCESS_VIOLATION when running #32

Tyde opened this issue Feb 10, 2022 · 4 comments

Comments

@Tyde
Copy link

Tyde commented Feb 10, 2022

Hi,

I do have the following circuit that includes resistivities that are dependent on voltages in the network:

.title CauerTest
.model MYSW sw vt=.5 vh=-.4 ron=1e-11 roff=1e12
RIL t_heater /t_si_top 1.984
CIL t_heater Net-_CIL-Pad2_ 3.825e-6
RW t_top_water t_heater 40
CW t_top_water Net-_CIL-Pad2_ 7.595e-5
CSL /t_si_top Net-_CIL-Pad2_ 0.000733
RSL /t_si_top /t_cu_top r='5.00e-04/((5.6596e+01+1.2654e+07/(V(/t_si_top)+273.15)^1.9870e+00)*9.00e-07)'
CCL /t_cu_top Net-_CIL-Pad2_ 0.0464
RCL /t_cu_top Net-_CIL-Pad2_ 41.562
RIC t_heater /t_si_top 8.926
CIC t_heater Net-_CIL-Pad2_ 1.279e-10
S1 Net-_VH-Pad1_ t_heater /wire_sw1 0 MYSW
V3 /wire_sw1 0 dc 0 pulse(1 0 10m 1u 1u 40m 50m)
VH Net-_VH-Pad1_ 0 20
CSC /t_si_top Net-_CIL-Pad2_ 2.921e-5
RSC /t_si_top /t_cu_top r='6.0513e+00/(1.8850e-02*(5.6596e+01+1.2654e+07/(V(/t_si_top)+273.15)^1.9870e+00))'
VLN2 Net-_CIL-Pad2_ 0 -196
RCC /t_cu_top Net-_CIL-Pad2_ 0.897
CCC /t_cu_top Net-_CIL-Pad2_ 0.0436
.save @ril[i]
.save @cil[i]
.save @rw[i]
.save @cw[i]
.save @csl[i]
.save @rsl[i]
.save @ccl[i]
.save @rcl[i]
.save @ric[i]
.save @cic[i]
.save @v3[i]
.save @vh[i]
.save @csc[i]
.save @rsc[i]
.save @vln2[i]
.save @rcc[i]
.save @ccc[i]
.save V(/t_cu_top)
.save V(/t_si_top)
.save V(/wire_sw1)
.save V(Net-_CIL-Pad2_)
.save V(Net-_VH-Pad1_)
.save V(t_heater)
.save V(t_top_water)
.tran 1u 0.04

.end

If I source this circuit with the normal ngspice application, everything works, but when I run it through julia, I get the following issue:

julia> NgSpice.init()
julia> NgSpice.source("temp_cir.cir")
julia> NgSpice.run()
Running the simulator
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000
Device Setup
op
Initial Transient Solution
--------------------------
Node                                   Voltage
----                                   -------
t_heater                                    20
/t_si_top                             -101.024
net-_cil-pad2_                            -196
t_top_water                                 20
/t_cu_top                             -130.534
net-_vh-pad1_                               20
/wire_sw1                                    1
vln2#branch                            74.5583
vh#branch                             -74.5586
v3#branch                                    0
 Reference value :  0.00000e+000

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x3e343ccf -- sh_ExecutePerLoop at /workspace/srcdir/ngspice/src\sharedspice.c:2113
in expression starting at REPL[4]:1
sh_ExecutePerLoop at /workspace/srcdir/ngspice/src\sharedspice.c:2113
OUTpData at /workspace/srcdir/ngspice/src/frontend\outitf.c:744
CKTdump at /workspace/srcdir/ngspice/src/spicelib/analysis\cktdump.c:44
DCtran at /workspace/srcdir/ngspice/src/spicelib/analysis\dctran.c:459
CKTdoJob at /workspace/srcdir/ngspice/src/spicelib/analysis\cktdojob.c:231
if_run at /workspace/srcdir/ngspice/src/frontend\spiceif.c:344
dosim at /workspace/srcdir/ngspice/src/frontend\runcoms.c:325
com_run at /workspace/srcdir/ngspice/src/frontend\runcoms.c:387
docommand at /workspace/srcdir/ngspice/src/frontend\control.c:238
doblock at /workspace/srcdir/ngspice/src/frontend\control.c:532
cp_evloop at /workspace/srcdir/ngspice/src/frontend\control.c:862
runc at /workspace/srcdir/ngspice/src\sharedspice.c:710
ngSpice_Command at /workspace/srcdir/ngspice/src\sharedspice.c:1074
cmd at D:\julia\packages\NgSpice\uPgrF\src\API\running.jl:1 [inlined]
run at D:\julia\packages\NgSpice\uPgrF\src\API\running.jl:18
unknown function (ip: 000000003d742df3)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1788 [inlined]
do_call at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:126
eval_value at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:215
eval_stmt_value at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:166 [inlined]
eval_body at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:583
jl_interpret_toplevel_thunk at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:731
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:885
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:830
jl_toplevel_eval at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:894 [inlined]
jl_toplevel_eval_in at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:944
eval at .\boot.jl:373 [inlined]
eval_user_input at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\REPL\src\REPL.jl:150
repl_backend_loop at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\REPL\src\REPL.jl:244
start_repl_backend at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\REPL\src\REPL.jl:229
#run_repl#47 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\REPL\src\REPL.jl:362
run_repl at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.7\REPL\src\REPL.jl:349
#930 at .\client.jl:394
jfptr_YY.930_37269.clone_1 at C:\Users\thiem\AppData\Local\Programs\Julia-1.7.0\lib\julia\sys.dll (unknown line)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1788 [inlined]
jl_f__call_latest at /cygdrive/c/buildbot/worker/package_win64/build/src\builtins.c:757
#invokelatest#2 at .\essentials.jl:716 [inlined]
invokelatest at .\essentials.jl:714 [inlined]
run_main_repl at .\client.jl:379
exec_options at .\client.jl:309
_start at .\client.jl:495
jfptr__start_41894.clone_1 at C:\Users\thiem\AppData\Local\Programs\Julia-1.7.0\lib\julia\sys.dll (unknown line)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1788 [inlined]
true_main at /cygdrive/c/buildbot/worker/package_win64/build/src\jlapi.c:559
jl_repl_entrypoint at /cygdrive/c/buildbot/worker/package_win64/build/src\jlapi.c:701
mainCRTStartup at /cygdrive/c/buildbot/worker/package_win64/build/cli\loader_exe.c:42
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 2720 (Pool: 2711; Big: 9); GC: 0

I am not sure if this is an issue in ngspice or with the api, but as it does not happen with the application itself, I posted this issue here first.

@sjkelly
Copy link

sjkelly commented Feb 11, 2022

Which version of NGSpice are you running locally? We may need to update our ngspice distribution to the latest.

@Tyde
Copy link
Author

Tyde commented Feb 11, 2022

In the instance that works, I am running ngspice 36.

@Tyde
Copy link
Author

Tyde commented Feb 14, 2022

I just downloaded the ngspice 34 executable and ran the circuit provided above. Here, the error did not happen. This leads me to the assumption that the version is not the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants