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

Please submit a bug report on crash when solving SDEProblem with extra noise equations #422

Closed
anandijain opened this issue Jun 26, 2021 · 2 comments

Comments

@anandijain
Copy link
Contributor

I was trying to understand how noise is being applied when length(noiseeqs) != length(eqs) and came across this crash. It doesn't say where to report the issue though.

(SDEMWE) pkg> st
     Project SDEMWE v0.1.0
      Status `C:\Users\Anand\.julia\dev\SDEMWE\Project.toml`
  [0c46a032] DifferentialEquations v6.17.1
  [961ee093] ModelingToolkit v5.21.0

julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)        
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  WORD_SIZE: 64    
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 4

using ModelingToolkit, DifferentialEquations
@parameters t σ ρ β
@variables x(t) y(t) z(t)
D = Differential(t)
eqs = [D(x) ~ σ*(y-x),
       D(y) ~ x*-z)-y,
       D(z) ~ x*y - β*z]
noiseeqs = [0.1*x,
            0.1*y,
            0.1*z,
            0.1*z]
de = SDESystem(eqs,noiseeqs,t,[x,y,z],[σ,ρ,β]; defaults=[x=>1.,y=>1.,z=>1., σ=>1., ρ=>1., β=>1.])
prob = SDEProblem(de, Pair[], (0, 10.))
sol = solve(prob)
noiseeqs2 = [
    0.1*x,
    0.1*y,
    0.1*z,
    0.1*x,
    0.1*y,
    0.1*z,
    0.1*x,
    0.1*y,
    0.1*z,
    0.1*x,
    0.1*y,
    0.1*z
]
de2 = SDESystem(eqs,noiseeqs2,t,[x,y,z],[σ,ρ,β]; defaults=[x=>1.,y=>1.,z=>1., σ=>1., ρ=>1., β=>1.])
prob2 = SDEProblem(de2, Pair[], (0, 10.))
sol2 = solve(prob2)
isequal(sol, sol2)

julia> sol2 = solve(prob2)

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 0x294abf9 -- jl_gc_pool_alloc at /cygdrive/c/buildbot/worker/package_win64/build/src\gc.c:1210 [inlined]
jl_gc_alloc_ at /cygdrive/c/buildbot/worker/package_win64/build/src\julia_internal.h:285 [inlined]
jl_gc_alloc at /cygdrive/c/buildbot/worker/package_win64/build/src\gc.c:3283
in expression starting at REPL[13]:1
jl_gc_pool_alloc at /cygdrive/c/buildbot/worker/package_win64/build/src\gc.c:1210 [inlined]
jl_gc_alloc_ at /cygdrive/c/buildbot/worker/package_win64/build/src\julia_internal.h:285 [inlined]
jl_gc_alloc at /cygdrive/c/buildbot/worker/package_win64/build/src\gc.c:3283
_new_array_ at /cygdrive/c/buildbot/worker/package_win64/build/src\array.c:122
_new_array at /cygdrive/c/buildbot/worker/package_win64/build/src\array.c:188 [inlined]
jl_alloc_array_1d at /cygdrive/c/buildbot/worker/package_win64/build/src\array.c:459
Array at .\boot.jl:448 [inlined]
Array at .\boot.jl:457 [inlined]
Array at .\boot.jl:465 [inlined]
similar at .\abstractarray.jl:785 [inlined]
similar at .\abstractarray.jl:784 [inlined]
similar at .\broadcast.jl:197 [inlined]
similar at .\broadcast.jl:196 [inlined]
copy at .\broadcast.jl:908 [inlined]
materialize at .\broadcast.jl:883 [inlined]
sde_determine_initdt at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\initdt.jl:49
auto_dt_reset! at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\integrators\integrator_interface.jl:352 [inlined]
handle_dt! at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:632
#__init#103 at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:585
__init##kw at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:69
unknown function (ip: 00000000022c39ce)
__init##kw at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:69 [inlined]
#__solve#102 at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:6 [inlined]
__solve##kw at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:6 [inlined]
__solve##kw at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:6 [inlined]
__solve##kw at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:6 [inlined]
__solve##kw at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:6 [inlined]
__solve##kw at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:6
unknown function (ip: 00000000022bb585)
#__solve#31 at C:\Users\Anand\.julia\packages\DifferentialEquations\U5PCN\src\default_solve.jl:7
__solve##kw at C:\Users\Anand\.julia\packages\DifferentialEquations\U5PCN\src\default_solve.jl:3 [inlined]
#__solve#73 at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:282 [inlined]
__solve at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:269 [inlined]
#solve_call#58 at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:61 [inlined]
solve_call at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:48 [inlined]
#solve_up#60 at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:85 [inlined]
solve_up at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:75 [inlined]
#solve#59 at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:70 [inlined]
solve at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:68
unknown function (ip: 00000000022a7d40)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
do_call at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:115
eval_value at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:204
eval_stmt_value at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:155 [inlined]
eval_body at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:575
jl_interpret_toplevel_thunk at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:669
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:877
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:825
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:825
jl_toplevel_eval at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:886 [inlined]
jl_toplevel_eval_in at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:929
eval at .\boot.jl:360 [inlined]
eval_user_input at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:139
repl_backend_loop at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:200
start_repl_backend at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:185
#run_repl#42 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:317
run_repl at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:305
#874 at .\client.jl:387
jfptr_YY.874_23672.clone_1 at C:\Users\Anand\AppData\Local\Programs\Julia-1.6.0\lib\julia\sys.dll (unknown line)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
jl_f__call_latest at /cygdrive/c/buildbot/worker/package_win64/build/src\builtins.c:714
#invokelatest#2 at .\essentials.jl:708 [inlined]
invokelatest at .\essentials.jl:706 [inlined]
run_main_repl at .\client.jl:372
exec_options at .\client.jl:302
_start at .\client.jl:485
jfptr__start_43335.clone_1 at C:\Users\Anand\AppData\Local\Programs\Julia-1.6.0\lib\julia\sys.dll (unknown line)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
true_main at /cygdrive/c/buildbot/worker/package_win64/build/src\jlapi.c:560
repl_entrypoint at /cygdrive/c/buildbot/worker/package_win64/build/src\jlapi.c:702
mainCRTStartup at /cygdrive/c/buildbot/worker/package_win64/build/cli\loader_exe.c:51
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 316979293 (Pool: 316945757; Big: 33536); GC: 927

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 0x294abf9 -- jl_gc_pool_alloc at /cygdrive/c/buildbot/worker/package_win64/build/src\gc.c:1210 [inlined]
jl_gc_alloc_ at /cygdrive/c/buildbot/worker/package_win64/build/src\julia_internal.h:285 [inlined]
jl_gc_alloc at /cygdrive/c/buildbot/worker/package_win64/build/src\gc.c:3283
in expression starting at REPL[13]:1
jl_gc_pool_alloc at /cygdrive/c/buildbot/worker/package_win64/build/src\gc.c:1210 [inlined]
jl_gc_alloc_ at /cygdrive/c/buildbot/worker/package_win64/build/src\julia_internal.h:285 [inlined]
jl_gc_alloc at /cygdrive/c/buildbot/worker/package_win64/build/src\gc.c:3283
_new_array_ at /cygdrive/c/buildbot/worker/package_win64/build/src\array.c:122
jl_new_array_for_deserialization at /cygdrive/c/buildbot/worker/package_win64/build/src\array.c:194
jl_decode_value_array at /cygdrive/c/buildbot/worker/package_win64/build/src\ircode.c:427
jl_decode_value at /cygdrive/c/buildbot/worker/package_win64/build/src\ircode.c:599
jl_uncompress_ir at /cygdrive/c/buildbot/worker/package_win64/build/src\ircode.c:804
retrieve_code_info at .\compiler\utilities.jl:127 [inlined]
InferenceState at .\compiler\inferencestate.jl:131
typeinf_ext at .\compiler\typeinfer.jl:890
typeinf_ext_toplevel at .\compiler\typeinfer.jl:925
typeinf_ext_toplevel at .\compiler\typeinfer.jl:921
jfptr_typeinf_ext_toplevel_10069.clone_1 at C:\Users\Anand\AppData\Local\Programs\Julia-1.6.0\lib\julia\sys.dll (unknown line)
_jl_invoke at /cygdrive/c/buildbot/worker/package_win64/build/src\gf.c:2237 [inlined]
jl_apply_generic at /cygdrive/c/buildbot/worker/package_win64/build/src\gf.c:2419 [inlined]
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
jl_type_infer at /cygdrive/c/buildbot/worker/package_win64/build/src\gf.c:298
jl_generate_fptr at /cygdrive/c/buildbot/worker/package_win64/build/src\jitlayers.cpp:340
jl_compile_method_internal at /cygdrive/c/buildbot/worker/package_win64/build/src\gf.c:1970
jl_compile_method_internal at /cygdrive/c/buildbot/worker/package_win64/build/src\gf.c:1924 [inlined]
_jl_invoke at /cygdrive/c/buildbot/worker/package_win64/build/src\gf.c:2229 [inlined]
jl_apply_generic at /cygdrive/c/buildbot/worker/package_win64/build/src\gf.c:2419
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
run_finalizer at /cygdrive/c/buildbot/worker/package_win64/build/src\gc.c:278
jl_gc_run_finalizers_in_list at /cygdrive/c/buildbot/worker/package_win64/build/src\gc.c:365
run_finalizers at /cygdrive/c/buildbot/worker/package_win64/build/src\gc.c:394 [inlined]
run_finalizers at /cygdrive/c/buildbot/worker/package_win64/build/src\gc.c:372
jl_atexit_hook at /cygdrive/c/buildbot/worker/package_win64/build/src\init.c:240
jl_exit at /cygdrive/c/buildbot/worker/package_win64/build/src\jl_uv.c:632
jl_exception_handler at /cygdrive/c/buildbot/worker/package_win64/build/src\signals-win.c:318
__julia_personality at /cygdrive/c/buildbot/worker/package_win64/build/src/support\win32_ucontext.c:28
_chkstk at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
RtlRaiseException at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
KiUserExceptionDispatcher at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
jl_gc_pool_alloc at /cygdrive/c/buildbot/worker/package_win64/build/src\gc.c:1209 [inlined]
jl_gc_alloc_ at /cygdrive/c/buildbot/worker/package_win64/build/src\julia_internal.h:285 [inlined]
jl_gc_alloc at /cygdrive/c/buildbot/worker/package_win64/build/src\gc.c:3283
_new_array_ at /cygdrive/c/buildbot/worker/package_win64/build/src\array.c:122
_new_array at /cygdrive/c/buildbot/worker/package_win64/build/src\array.c:188 [inlined]
jl_alloc_array_1d at /cygdrive/c/buildbot/worker/package_win64/build/src\array.c:459
Array at .\boot.jl:448 [inlined]
Array at .\boot.jl:457 [inlined]
Array at .\boot.jl:465 [inlined]
similar at .\abstractarray.jl:785 [inlined]
similar at .\abstractarray.jl:784 [inlined]
similar at .\broadcast.jl:197 [inlined]
similar at .\broadcast.jl:196 [inlined]
copy at .\broadcast.jl:908 [inlined]
materialize at .\broadcast.jl:883 [inlined]
sde_determine_initdt at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\initdt.jl:49
auto_dt_reset! at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\integrators\integrator_interface.jl:352 [inlined]
handle_dt! at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:632
#__init#103 at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:585
__init##kw at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:69
unknown function (ip: 00000000022c39ce)
__init##kw at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:69 [inlined]
#__solve#102 at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:6 [inlined]
__solve##kw at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:6 [inlined]
__solve##kw at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:6 [inlined]
__solve##kw at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:6 [inlined]
__solve##kw at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:6 [inlined]
__solve##kw at C:\Users\Anand\.julia\packages\StochasticDiffEq\PtS8q\src\solve.jl:6
unknown function (ip: 00000000022bb585)
#__solve#31 at C:\Users\Anand\.julia\packages\DifferentialEquations\U5PCN\src\default_solve.jl:7
__solve##kw at C:\Users\Anand\.julia\packages\DifferentialEquations\U5PCN\src\default_solve.jl:3 [inlined]
#__solve#73 at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:282 [inlined]
__solve at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:269 [inlined]
#solve_call#58 at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:61 [inlined]
solve_call at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:48 [inlined]
#solve_up#60 at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:85 [inlined]
solve_up at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:75 [inlined]
#solve#59 at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:70 [inlined]
solve at C:\Users\Anand\.julia\packages\DiffEqBase\QiFNl\src\solve.jl:68
unknown function (ip: 00000000022a7d40)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
do_call at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:115
eval_value at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:204
eval_stmt_value at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:155 [inlined]
eval_body at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:575
jl_interpret_toplevel_thunk at /cygdrive/c/buildbot/worker/package_win64/build/src\interpreter.c:669
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:877
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:825
jl_toplevel_eval_flex at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:825
jl_toplevel_eval at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:886 [inlined]
jl_toplevel_eval_in at /cygdrive/c/buildbot/worker/package_win64/build/src\toplevel.c:929
eval at .\boot.jl:360 [inlined]
eval_user_input at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:139
repl_backend_loop at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:200
start_repl_backend at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:185
#run_repl#42 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:317
run_repl at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:305
#874 at .\client.jl:387
jfptr_YY.874_23672.clone_1 at C:\Users\Anand\AppData\Local\Programs\Julia-1.6.0\lib\julia\sys.dll (unknown line)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
jl_f__call_latest at /cygdrive/c/buildbot/worker/package_win64/build/src\builtins.c:714
#invokelatest#2 at .\essentials.jl:708 [inlined]
invokelatest at .\essentials.jl:706 [inlined]
run_main_repl at .\client.jl:372
exec_options at .\client.jl:302
_start at .\client.jl:485
jfptr__start_43335.clone_1 at C:\Users\Anand\AppData\Local\Programs\Julia-1.6.0\lib\julia\sys.dll (unknown line)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
true_main at /cygdrive/c/buildbot/worker/package_win64/build/src\jlapi.c:560
repl_entrypoint at /cygdrive/c/buildbot/worker/package_win64/build/src\jlapi.c:702
mainCRTStartup at /cygdrive/c/buildbot/worker/package_win64/build/cli\loader_exe.c:51
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 316979293 (Pool: 316945757; Big: 33536); GC: 927
@prbzrg
Copy link
Member

prbzrg commented May 23, 2024

This should be reported to
https://github.com/JuliaLang/julia

@ChrisRackauckas
Copy link
Member

When length(noiseeqs) != length(eqs), it needs to be a matrix such that size(noiseeqs,1) == length(eqs), which is violated here. The definition then follows the non-diagonal form:
https://docs.sciml.ai/DiffEqDocs/stable/tutorials/sde_example/#Example-4:-Systems-of-SDEs-with-Non-Diagonal-Noise

SciML/ModelingToolkit.jl#2833 adds a new error message to keep this safe.

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

3 participants