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

LLVM issues on windows #159

Open
baggepinnen opened this issue Sep 26, 2024 · 36 comments
Open

LLVM issues on windows #159

baggepinnen opened this issue Sep 26, 2024 · 36 comments

Comments

@baggepinnen
Copy link
Contributor

@SimonDanisch is experiencing lots of issues running on windows

The robot example is failing during rendering with

julia> Multibody.render(robot, sol; y=2, lookat=[0,1,0], filename = "robot.mp4")
ERROR: Internal error: encountered unexpected error in runtime:
ReadOnlyMemoryError()
jl_gc_pool_alloc_inner at C:/workdir/src\gc.c:1315 [inlined]
jl_gc_pool_alloc_noinline at C:/workdir/src\gc.c:1357
jl_gc_alloc_ at C:/workdir/src\julia_internal.h:478 [inlined]
jl_exprn at C:/workdir/src\builtins.c:1420
jl_decode_value_expr at C:/workdir/src\ircode.c:555 [inlined]
jl_decode_value at C:/workdir/src\ircode.c:685
jl_decode_value_array at C:/workdir/src\ircode.c:501
ijl_uncompress_ir at C:/workdir/src\ircode.c:902
retrieve_ir_for_inlining at .\compiler/ssair\inlining.jl:985 [inlined]
#resolve_todo#457 at .\compiler/ssair\inlining.jl:908
resolve_todo at .\compiler/ssair\inlining.jl:871 [inlined]
#analyze_method!#458 at .\compiler/ssair\inlining.jl:981
analyze_method! at .\compiler/ssair\inlining.jl:950 [inlined]
#handle_match!#462 at .\compiler/ssair\inlining.jl:1467
handle_match! at .\compiler/ssair\inlining.jl:1457 [inlined]
#handle_any_const_result!#459 at .\compiler/ssair\inlining.jl:1329
handle_any_const_result! at .\compiler/ssair\inlining.jl:1312 [inlined]
compute_inlining_cases at .\compiler/ssair\inlining.jl:1404
handle_call! at .\compiler/ssair\inlining.jl:1450 [inlined]
assemble_inline_todo! at .\compiler/ssair\inlining.jl:1698
ssa_inlining_pass! at .\compiler/ssair\inlining.jl:78 [inlined]
run_passes at .\compiler\optimize.jl:489
run_passes at .\compiler\optimize.jl:504 [inlined]
optimize at .\compiler\optimize.jl:453 [inlined]
_typeinf at .\compiler\typeinfer.jl:272
typeinf at .\compiler\typeinfer.jl:216
typeinf_edge at .\compiler\typeinfer.jl:930
abstract_call_method at .\compiler\abstractinterpretation.jl:629
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:95
abstract_call_known at .\compiler\abstractinterpretation.jl:2087
abstract_call at .\compiler\abstractinterpretation.jl:2169
abstract_call at .\compiler\abstractinterpretation.jl:2162
abstract_call at .\compiler\abstractinterpretation.jl:2354
abstract_eval_call at .\compiler\abstractinterpretation.jl:2370
abstract_eval_statement_expr at .\compiler\abstractinterpretation.jl:2380
abstract_eval_statement at .\compiler\abstractinterpretation.jl:2624
abstract_eval_basic_statement at .\compiler\abstractinterpretation.jl:2913
typeinf_local at .\compiler\abstractinterpretation.jl:3098
typeinf_nocycle at .\compiler\abstractinterpretation.jl:3186
_typeinf at .\compiler\typeinfer.jl:247
typeinf at .\compiler\typeinfer.jl:216
typeinf_edge at .\compiler\typeinfer.jl:930
abstract_call_method at .\compiler\abstractinterpretation.jl:629
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:95
abstract_call_known at .\compiler\abstractinterpretation.jl:2087
abstract_call at .\compiler\abstractinterpretation.jl:2169
abstract_call at .\compiler\abstractinterpretation.jl:2162
abstract_call at .\compiler\abstractinterpretation.jl:2354
abstract_eval_call at .\compiler\abstractinterpretation.jl:2370
abstract_eval_statement_expr at .\compiler\abstractinterpretation.jl:2380
abstract_eval_statement at .\compiler\abstractinterpretation.jl:2624
abstract_eval_basic_statement at .\compiler\abstractinterpretation.jl:2913
typeinf_local at .\compiler\abstractinterpretation.jl:3098
typeinf_nocycle at .\compiler\abstractinterpretation.jl:3186
_typeinf at .\compiler\typeinfer.jl:247
typeinf at .\compiler\typeinfer.jl:216
typeinf_edge at .\compiler\typeinfer.jl:930
abstract_call_method at .\compiler\abstractinterpretation.jl:629
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:95
abstract_call_known at .\compiler\abstractinterpretation.jl:2087
abstract_call at .\compiler\abstractinterpretation.jl:2169
abstract_call at .\compiler\abstractinterpretation.jl:2162
abstract_call at .\compiler\abstractinterpretation.jl:2354
abstract_eval_call at .\compiler\abstractinterpretation.jl:2370
abstract_eval_statement_expr at .\compiler\abstractinterpretation.jl:2380
abstract_eval_statement at .\compiler\abstractinterpretation.jl:2624
abstract_eval_basic_statement at .\compiler\abstractinterpretation.jl:2913
typeinf_local at .\compiler\abstractinterpretation.jl:3098
typeinf_nocycle at .\compiler\abstractinterpretation.jl:3186
_typeinf at .\compiler\typeinfer.jl:247
typeinf at .\compiler\typeinfer.jl:216
typeinf_edge at .\compiler\typeinfer.jl:930
abstract_call_method at .\compiler\abstractinterpretation.jl:629
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:95
abstract_call_known at .\compiler\abstractinterpretation.jl:2087
abstract_call at .\compiler\abstractinterpretation.jl:2169
abstract_call at .\compiler\abstractinterpretation.jl:2162
abstract_call at .\compiler\abstractinterpretation.jl:2354
abstract_eval_call at .\compiler\abstractinterpretation.jl:2370
abstract_eval_statement_expr at .\compiler\abstractinterpretation.jl:2380
abstract_eval_statement at .\compiler\abstractinterpretation.jl:2624
abstract_eval_basic_statement at .\compiler\abstractinterpretation.jl:2913
typeinf_local at .\compiler\abstractinterpretation.jl:3098
typeinf_nocycle at .\compiler\abstractinterpretation.jl:3186
_typeinf at .\compiler\typeinfer.jl:247
typeinf at .\compiler\typeinfer.jl:216
typeinf_edge at .\compiler\typeinfer.jl:930
abstract_call_method at .\compiler\abstractinterpretation.jl:629
abstract_call_gf_by_type at .\compiler\abstractinterpretation.jl:95
abstract_call_known at .\compiler\abstractinterpretation.jl:2087
abstract_call at .\compiler\abstractinterpretation.jl:2169
abstract_call at .\compiler\abstractinterpretation.jl:2162
abstract_call at .\compiler\abstractinterpretation.jl:2354
abstract_eval_call at .\compiler\abstractinterpretation.jl:2370
abstract_eval_statement_expr at .\compiler\abstractinterpretation.jl:2380
abstract_eval_statement at .\compiler\abstractinterpretation.jl:2624
abstract_eval_basic_statement at .\compiler\abstractinterpretation.jl:2913
typeinf_local at .\compiler\abstractinterpretation.jl:3098
typeinf_nocycle at .\compiler\abstractinterpretation.jl:3186
_typeinf at .\compiler\typeinfer.jl:247
typeinf at .\compiler\typeinfer.jl:216
typeinf_ext at .\compiler\typeinfer.jl:1051
typeinf_ext_toplevel at .\compiler\typeinfer.jl:1082
typeinf_ext_toplevel at .\compiler\typeinfer.jl:1078
jfptr_typeinf_ext_toplevel_39006.1 at C:\Users\sdani\.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
_jl_invoke at C:/workdir/src\gf.c:2895 [inlined]
ijl_apply_generic at C:/workdir/src\gf.c:3077 [inlined]
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
jl_type_infer at C:/workdir/src\gf.c:394
jl_generate_fptr_impl at C:/workdir/src\jitlayers.cpp:504
jl_compile_method_internal at C:/workdir/src\gf.c:2481
jl_compile_method_internal at C:/workdir/src\gf.c:2372 [inlined]
_jl_invoke at C:/workdir/src\gf.c:2887 [inlined]
ijl_apply_generic at C:/workdir/src\gf.c:3077
show_exception_stack at .\errorshow.jl:975
display_error at .\client.jl:111
jfptr_display_error_86461.1 at C:\Users\sdani\.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:812
#invokelatest#2 at .\essentials.jl:892 [inlined]
invokelatest at .\essentials.jl:889 [inlined]
repl_display_error at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:293
print_response at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:310
#57 at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:284
jfptr_YY.57_95850.1 at C:\Users\sdani\.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
with_repl_linfo at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:569
jfptr_with_repl_linfo_95925.1 at C:\Users\sdani\.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
print_response at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:282
do_respond at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:911
jfptr_do_respond_95999.1 at C:\Users\sdani\.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:812
#invokelatest#2 at .\essentials.jl:892 [inlined]
invokelatest at .\essentials.jl:889 [inlined]
run_interface at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\LineEdit.jl:2656
jfptr_run_interface_94754.1 at C:\Users\sdani\.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
run_frontend at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:1312
#62 at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:386
jfptr_YY.62_95901.1 at C:\Users\sdani\.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
start_task at C:/workdir/src\task.c:1238
DimensionMismatch: arrays could not be broadcast to a common size; got a dimension with lengths 3702 and 401
Stacktrace:
  [1] _bcs1
    @ .\broadcast.jl:555 [inlined]
  [2] _bcs
    @ .\broadcast.jl:549 [inlined]
  [3] broadcast_shape
    @ .\broadcast.jl:543 [inlined]
  [4] combine_axes
    @ .\broadcast.jl:524 [inlined]
  [5] instantiate
    @ .\broadcast.jl:306 [inlined]
  [6] materialize(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, Type{Pair}, Tuple{Vector{…}, Vector{…}}})
    @ Base.Broadcast .\broadcast.jl:903
  [7] Render.CacheSol(model::ODESystem, sol::ODESolution{…})
    @ Render C:\Users\sdani\.julia\packages\Multibody\xhSwA\ext\Render.jl:87
  [8] render(model::ODESystem, sol::ODESolution{…}, timevec::Nothing; filename::String, framerate::Int64, x::Int64, y::Int64, z::Int64, lookat::Vector{…}, up::Vec{…}, show_axis::Bool, timescale::Float64, traces::Nothing, display::Bool, loop::Int64, cache::Bool, kwargs::@Kwargs{})
    @ Render C:\Users\sdani\.julia\packages\Multibody\xhSwA\ext\Render.jl:285
  [9] render
    @ C:\Users\sdani\.julia\packages\Multibody\xhSwA\ext\Render.jl:263 [inlined]
 [10] top-level scope
    @ REPL[14]:1
Some type information was truncated. Use `show(err)` to see complete types.

and with cache=false he instead gets

julia> Multibody.render(robot, sol; y=2, lookat=[0,1,0], filename = "robot.mp4", cache=false)

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 0x189ff553996 -- <= at .\int.jl:514 [inlined]
Point at C:\Users\sdani\.julia\packages\GeometryBasics\ebXl0\src\fixed_arrays.jl:42 [inlined]
#35 at C:\Users\sdani\.julia\packages\Multibody\xhSwA\ext\Render.jl:462 [inlined]
#map#13 at C:\Users\sdani\.julia\packages\Observables\YdEbO\src\Observables.jl:570
in expression starting at REPL[13]:1
<= at .\int.jl:514 [inlined]
Point at C:\Users\sdani\.julia\packages\GeometryBasics\ebXl0\src\fixed_arrays.jl:42 [inlined]
#35 at C:\Users\sdani\.julia\packages\Multibody\xhSwA\ext\Render.jl:462 [inlined]
#map#13 at C:\Users\sdani\.julia\packages\Observables\YdEbO\src\Observables.jl:570
unknown function (ip: 00000189ff554010)
map at C:\Users\sdani\.julia\packages\Observables\YdEbO\src\Observables.jl:568 [inlined]
render! at C:\Users\sdani\.julia\packages\Multibody\xhSwA\ext\Render.jl:461
unknown function (ip: 00000189c820c217)
recursive_render! at C:\Users\sdani\.julia\packages\Multibody\xhSwA\ext\Render.jl:409
unknown function (ip: 00000189c820a4a7)
recursive_render! at C:\Users\sdani\.julia\packages\Multibody\xhSwA\ext\Render.jl:411
unknown function (ip: 00000189c820a4a7)
#render#20 at C:\Users\sdani\.julia\packages\Multibody\xhSwA\ext\Render.jl:294
render at C:\Users\sdani\.julia\packages\Multibody\xhSwA\ext\Render.jl:263 [inlined]
render at C:\Users\sdani\.julia\packages\Multibody\xhSwA\ext\Render.jl:263
unknown function (ip: 00000189c81d07f3)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
do_call at C:/workdir/src\interpreter.c:126
eval_value at C:/workdir/src\interpreter.c:223
eval_stmt_value at C:/workdir/src\interpreter.c:174 [inlined]
eval_body at C:/workdir/src\interpreter.c:635
jl_interpret_toplevel_thunk at C:/workdir/src\interpreter.c:775
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:934
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:877
ijl_toplevel_eval at C:/workdir/src\toplevel.c:943 [inlined]
ijl_toplevel_eval_in at C:/workdir/src\toplevel.c:985
eval at .\boot.jl:385 [inlined]
eval_user_input at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:150
repl_backend_loop at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:246
#start_repl_backend#46 at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:231
start_repl_backend at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:228
#run_repl#59 at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:389
run_repl at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:375
jfptr_run_repl_95862.1 at C:\Users\sdani\.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
#1013 at .\client.jl:432
jfptr_YY.1013_86638.1 at C:\Users\sdani\.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:812
#invokelatest#2 at .\essentials.jl:892 [inlined]
invokelatest at .\essentials.jl:889 [inlined]
run_main_repl at .\client.jl:416
exec_options at .\client.jl:333
_start at .\client.jl:552
jfptr__start_86663.1 at C:\Users\sdani\.julia\juliaup\julia-1.10.5+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
true_main at C:/workdir/src\jlapi.c:582
jl_repl_entrypoint at C:/workdir/src\jlapi.c:731
mainCRTStartup at C:/workdir/cli\loader_exe.c:58
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 167030101 (Pool: 166884019; Big: 146082); GC: 117

It looks like the issue stems from calling a function generated by JSCompiler with the LLVM backend.

@pitx-perf
Copy link

I experience the same issue on Windows, both when calling Multibody.render or Plots.plot

@baggepinnen
Copy link
Contributor Author

baggepinnen commented Sep 27, 2024

We have a fix in progress in JuliaSimCompiler, I'll report back here once a new release is out. If you're really keen on getting it to work, you can try applying this patch. You might get some warnings while defining those since you're effectively redefining a bunch of methods in JuliaSimCompiler, but that's fine. The patch changes the target from LLVM to JuliaTarget(), the theory is that it's the LLVM compiler that is causing the issues.

import JuliaSimCompiler as JSC

function JSC.SymbolicIndexingInterface.observed(sys::JSC.ScheduledSystem, sym)
    return JSC.build_explicit_observed_function(sys, sym; remap_params = true, target=JSC.JuliaTarget())
end

function JSC.SymbolicIndexingInterface.parameter_observed(sys::JSC.ScheduledSystem, sym)
    return JSC.build_explicit_observed_function(
        sys, sym; param_only = true, remap_params = true, target=JSC.JuliaTarget())
end

function (m::JSC.Memoized{HasIV})(vars) where {HasIV}
    let H = Val(HasIV)
        get!(m.obsdict, vars) do
            JSC.build_explicit_observed_function(m.ss, vars, H; remap_params = true, target=JSC.JuliaTarget())
        end
    end
end

@baggepinnen
Copy link
Contributor Author

A new version of JSCompiler has been released, v0.1.22. I hope this resolves your issues!

@pitx-perf
Copy link

I only see v0.1.21 on JuliaHub registry

@baggepinnen
Copy link
Contributor Author

Maybe it takes a while before the registry server has pulled the updates from the registry repository. I just tried and the new version is available now
image

@pitx-perf
Copy link

If I understand correctly, your JuliaSimCompiler is installed from the git-repo while I only have access to registry JuliaHubRegistry ?

image

@baggepinnen
Copy link
Contributor Author

Could you try to do pkg> up in that environment (not pkg> registry up) and see if that updates to the latest version?

@pitx-perf
Copy link

Same, I don't seem to see v0.1.22.

In juliahub packages neither:
image

@baggepinnen
Copy link
Contributor Author

What's your output of Pkg.pkg_server()? if it's not juliahub.com, you need to go though the steps here https://help.juliahub.com/juliasim/stable/gettingstarted/juliahubregistry/#Adding-the-JuliaHub-registry

@pitx-perf
Copy link

Thanks, the above fixed the update issue. I already went through those steps to install the package the first time, but I think
This will also change the package server to https://juliahub.com/ for all Julia sessions that run startup.jl.
doesn't hold true for me. It's still https://pkg.julialang.org. But no problem I can deal with that.

However, being on JuliaSimCompiler 0.1.22 I now experience crashes when calling
sol = solve(prob, Rodas4()) in springmass example and sol = solve(prob, FBDF(autodiff=false), reltol=1e-8, abstol=1e-8) in quad example.
Not sure how to get the error message as you posted in the first post.

@baggepinnen
Copy link
Contributor Author

What messages do you get? Does Julia terminate?

@pitx-perf
Copy link

Yes Julia terminates

@baggepinnen
Copy link
Contributor Author

If you run this in a regular terminal (one that does not terminate upon segfault), do you get some message then?

@pitx-perf
Copy link

No, even from a terminal julia closes without error message.
In debug I get:

Internal error: encountered unexpected error in runtime:
BoundsError(a=svec(), i=1)
ijl_bounds_error_int at C:/workdir/src\rtutils.c:187
jl_f__svec_ref at C:/workdir/src\builtins.c:1668
getindex at .\essentials.jl:769 [inlined]
_new_array_nothrow at .\compiler\tfuncs.jl:2955
new_array_nothrow at .\compiler\tfuncs.jl:2950
new_array_effects at .\compiler\tfuncs.jl:2936 [inlined]
foreigncall_effects at .\compiler\tfuncs.jl:2881 [inlined]
abstract_eval_foreigncall at .\compiler\abstractinterpretation.jl:2582
abstract_eval_statement_expr at .\compiler\abstractinterpretation.jl:2495
abstract_eval_statement at .\compiler\abstractinterpretation.jl:2624
abstract_eval_basic_statement at .\compiler\abstractinterpretation.jl:2913
typeinf_local at .\compiler\abstractinterpretation.jl:3098
typeinf_nocycle at .\compiler\abstractinterpretation.jl:3186
_typeinf at .\compiler\typeinfer.jl:247
typeinf at .\compiler\typeinfer.jl:216
typeinf_ext at .\compiler\typeinfer.jl:1051
typeinf_ext_toplevel at .\compiler\typeinfer.jl:1082
typeinf_ext_toplevel at .\compiler\typeinfer.jl:1078
jfptr_typeinf_ext_toplevel_38981.1 at C:\Users\guill.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
_jl_invoke at C:/workdir/src\gf.c:2895 [inlined]
ijl_apply_generic at C:/workdir/src\gf.c:3077 [inlined]
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
jl_type_infer at C:/workdir/src\gf.c:394
jl_generate_fptr_impl at C:/workdir/src\jitlayers.cpp:504
jl_compile_method_internal at C:/workdir/src\gf.c:2481
jl_compile_method_internal at C:/workdir/src\gf.c:2372 [inlined]
_jl_invoke at C:/workdir/src\gf.c:2887 [inlined]
ijl_apply_generic at C:/workdir/src\gf.c:3077
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
jl_f__call_in_world at C:/workdir/src\builtins.c:831
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
do_apply at C:/workdir/src\builtins.c:768
#invoke_in_world#3 at .\essentials.jl:926
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
do_apply at C:/workdir/src\builtins.c:768
invoke_in_world at .\essentials.jl:923
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
do_apply at C:/workdir/src\builtins.c:768
bypass_builtins at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:213
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:253
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:559
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:559
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:559
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:559
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:559
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:559
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:559
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:477
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:559
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:477
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:477
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:559
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:477
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:477
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:559
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
#evaluate_call_recurse!#65 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:290
evaluate_call_recurse! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:251 [inlined]
eval_rhs at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:391
unknown function (ip: 000001ad6188f64d)
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:554
step_expr! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\interpret.jl:614
finish! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:14
finish_and_return! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:30
unknown function (ip: 000001ad618913b6)
finish_stack! at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:60
unknown function (ip: 000001ad61898ad6)
#debug_command#85 at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:521
debug_command at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\JuliaInterpreter\src\commands.jl:453
unknown function (ip: 000001ad6189612a)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:812
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
do_apply at C:/workdir/src\builtins.c:768
#invokelatest#2 at .\essentials.jl:892
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
do_apply at C:/workdir/src\builtins.c:768
invokelatest at .\essentials.jl:889
our_debug_command at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\DebugAdapter\src\DebugEngines.jl:244
run at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\DebugAdapter\src\DebugEngines.jl:331
run at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\DebugAdapter\src\packagedef.jl:160
startdebugger at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\packages\VSCodeDebugger\src\VSCodeDebugger.jl:45
unknown function (ip: 000001ad61837fc4)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
do_call at C:/workdir/src\interpreter.c:126
eval_value at C:/workdir/src\interpreter.c:223
eval_stmt_value at C:/workdir/src\interpreter.c:174 [inlined]
eval_body at C:/workdir/src\interpreter.c:635
jl_interpret_toplevel_thunk at C:/workdir/src\interpreter.c:775
top-level scope at c:\Users\guill.vscode\extensions\julialang.language-julia-1.124.2\scripts\debugger\run_debugger.jl:12
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:934
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:877
ijl_toplevel_eval at C:/workdir/src\toplevel.c:943 [inlined]
ijl_toplevel_eval_in at C:/workdir/src\toplevel.c:985
eval at .\boot.jl:385 [inlined]
include_string at .\loading.jl:2076
_include at .\loading.jl:2136
include at .\Base.jl:495
jfptr_include_49732.1 at C:\Users\guill.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
exec_options at .\client.jl:318
_start at .\client.jl:552
jfptr__start_86591.1 at C:\Users\guill.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
true_main at C:/workdir/src\jlapi.c:582
jl_repl_entrypoint at C:/workdir/src\jlapi.c:731
mainCRTStartup at C:/workdir/cli\loader_exe.c:58
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)

@baggepinnen
Copy link
Contributor Author

even though julia terminates. the terminal might stay alive with the segfault error message on display? The terminal in vscode dies completely, so vscode is usually not good for reading such messages

@SimonDanisch
Copy link
Contributor

For me it silently quits as well in the terminal:
image

SimonDanisch added a commit to SimonDanisch/Multibody.jl that referenced this issue Oct 1, 2024
Since Multibody and dependency seem to be platform dependent, it seems to make sense to test on multiple platforms to avoid e.g. JuliaComputing#159
@baggepinnen
Copy link
Contributor Author

Interesting, it doesn't say anything :P

I'm not quite sure how to go about debugging this, the windows CI job also terminated without saying anything.

It looks like it's the call to solve that errors. Does it work to call the following function?

julia> du = similar(prob.u0); prob.f(du, prob.u0, prob.p, 0); du

If it does not, we know the problem is isolated to the runtime-generated function prob.f

@pitx-perf
Copy link

julia> du = similar(prob.u0); prob.f(du, prob.u0, prob.p, 0); du
this works for me

@SimonDanisch
Copy link
Contributor

julia +1.10 --check-bounds=yes -O0 --project=. Sadly doesn't help to get an error either

@baggepinnen
Copy link
Contributor Author

We have narrowed it down to a call to JuliaSimCompiler.linsolve! in the dynamics function, a fix is in progress.

@baggepinnen
Copy link
Contributor Author

Version v0.1.23 of JuliaSimCompiler has now been released, I hope this resolves the issue (famous last words, but nevertheless 😅 ).

@pitx-perf
Copy link

Sadly it still crashes in the call to solve for me

@baggepinnen
Copy link
Contributor Author

Are you sure that running pkg> update gave you version v0.1.23 of JSCompiler?

@pitx-perf
Copy link

yes, I can confirm that in my Manifest.toml I have:

[[deps.JuliaSimCompiler]]
deps = ...
git-tree-sha1 = "8af800edc6be2a5dff84c6be8d54f3b2cf798363"
uuid = "8391cb6b-4921-5777-4e45-fd9aab8cb88d"
version = "0.1.23"

@SimonDanisch
Copy link
Contributor

It seems like one needs to run:

using PkgAuthentication
PkgAuthentication.install("juliahub.com")
using Pkg; Pkg.Registry.add()
]registry update

Before one can get any updates - would be nice to at least get an error on ]update registry or so, that one isn't authenticated anymore and therefore doesn't get the newest version.

After that, I had to slightly update the example for the new Multibody version - and then it indeed crashes for me as well :(

@pitx-perf
Copy link

Also note that on JuliaSimCompiler 0.1.21 I can solve the problem but render crashes.

@baggepinnen
Copy link
Contributor Author

Also note that on JuliaSimCompiler 0.1.21 I can solve the problem but render crashes.

Interesting, does render also segfault, or does it give another message?

@SimonDanisch
Copy link
Contributor

For me it's still:
Image

@YingboMa
Copy link
Contributor

YingboMa commented Oct 7, 2024

Could you apply the following patch before running the script? Please let me know if it fixes your segfault issue.

using LinearAlgebra
using JuliaSimCompiler: Buffer, solve2x2!, solve3x3!, _lufact!, _jscluldiv!, _free
import JuliaSimCompiler: linsolve!
@inline function linsolve!(A::Buffer{NN, T}, b::Buffer{N, T},
        bound = 10eps(T)) where {N, NN, T}
    if N == 2
        info = @inline solve2x2!(A, b)
    elseif N == 3
        info = @inline solve3x3!(A, b)
    else
        ipiv = Buffer{N, Int}()
        info::Int = 0
        GC.@preserve ipiv A b begin
            pA = pointer(A)
            pb = pointer(b)
            pi = pointer(ipiv)
            info′ = _lufact!(pA, pi, N)
            _jscluldiv!(pA, pi, N, pb, info′)
            info = info′
            if iszero(info′) && bound > 0
                for (j, i) in enumerate(diagind(N, N))
                    Ai = @inbounds A[i]
                    if abs(Ai) < bound
                        info = j
                    end
                end
            end
        end
        _free(ipiv)
    end
    return info
end

@pitx-perf
Copy link

Running with JuliaSimCompiler v0.1.21, on the terminal I have the error message below when calling
Plots.plot(sol, idxs = [spring1.s, spring2.s]) on the springmass example.

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 0x20bf5739585 -- getindex at .\essentials.jl:13 [inlined] _broadcast_getindex at .\broadcast.jl:675 [inlined] _getindex at .\broadcast.jl:706 [inlined] _getindex at .\broadcast.jl:705 [inlined] _getindex at .\broadcast.jl:705 [inlined] _broadcast_getindex at .\broadcast.jl:681 [inlined] getindex at .\broadcast.jl:636 [inlined] macro expansion at .\broadcast.jl:1004 [inlined] macro expansion at .\simdloop.jl:77 [inlined] copyto! at .\broadcast.jl:1003 [inlined] copyto! at .\broadcast.jl:956 [inlined] copy at .\broadcast.jl:928 [inlined] materialize at .\broadcast.jl:903 [inlined] TimeDependentObservedFunction at C:\Users\guill\.julia\packages\SymbolicIndexingInterface\cwAFH\src\state_indexing.jl:84 in expression starting at REPL[4]:1 getindex at .\essentials.jl:13 [inlined] _broadcast_getindex at .\broadcast.jl:675 [inlined] _getindex at .\broadcast.jl:706 [inlined] _getindex at .\broadcast.jl:705 [inlined] _getindex at .\broadcast.jl:705 [inlined] _broadcast_getindex at .\broadcast.jl:681 [inlined] getindex at .\broadcast.jl:636 [inlined] macro expansion at .\broadcast.jl:1004 [inlined] macro expansion at .\simdloop.jl:77 [inlined] copyto! at .\broadcast.jl:1003 [inlined] copyto! at .\broadcast.jl:956 [inlined] copy at .\broadcast.jl:928 [inlined] materialize at .\broadcast.jl:903 [inlined] TimeDependentObservedFunction at C:\Users\guill\.julia\packages\SymbolicIndexingInterface\cwAFH\src\state_indexing.jl:84 TimeDependentObservedFunction at C:\Users\guill\.julia\packages\SymbolicIndexingInterface\cwAFH\src\state_indexing.jl:80 [inlined] AbstractStateGetIndexer at C:\Users\guill\.julia\packages\SymbolicIndexingInterface\cwAFH\src\value_provider_interface.jl:166 unknown function (ip: 0000020bf5739842) AbstractODESolution at C:\Users\guill\.julia\packages\SciMLBase\PTTHz\src\solutions\ode_solutions.jl:343 #_#479 at C:\Users\guill\.julia\packages\SciMLBase\PTTHz\src\solutions\ode_solutions.jl:220 [inlined] AbstractODESolution at C:\Users\guill\.julia\packages\SciMLBase\PTTHz\src\solutions\ode_solutions.jl:215 [inlined] AbstractODESolution at C:\Users\guill\.julia\packages\SciMLBase\PTTHz\src\solutions\ode_solutions.jl:215 unknown function (ip: 0000020bf56eaee3) solplot_vecs_and_labels at C:\Users\guill\.julia\packages\SciMLBase\PTTHz\src\solutions\solution_interface.jl:506 diffeq_to_arrays at C:\Users\guill\.julia\packages\SciMLBase\PTTHz\src\solutions\solution_interface.jl:400 unknown function (ip: 0000020bf56d7fb2) macro expansion at C:\Users\guill\.julia\packages\SciMLBase\PTTHz\src\solutions\solution_interface.jl:210 [inlined] macro expansion at C:\Users\guill\.julia\packages\RecipesBase\BRe07\src\RecipesBase.jl:340 [inlined] macro expansion at C:\Users\guill\.julia\packages\SciMLBase\PTTHz\src\solutions\solution_interface.jl:204 [inlined] apply_recipe at C:\Users\guill\.julia\packages\RecipesBase\BRe07\src\RecipesBase.jl:300 unknown function (ip: 0000020bf56c3b1f) jl_apply at C:/workdir/src\julia.h:1982 [inlined] do_apply at C:/workdir/src\builtins.c:768 _process_userrecipes! at C:\Users\guill\.julia\packages\RecipesPipeline\BGM3l\src\user_recipe.jl:38 recipe_pipeline! at C:\Users\guill\.julia\packages\RecipesPipeline\BGM3l\src\RecipesPipeline.jl:72 _plot! at C:\Users\guill\.julia\packages\Plots\kLeqV\src\plot.jl:223 #plot#188 at C:\Users\guill\.julia\packages\Plots\kLeqV\src\plot.jl:102 plot at C:\Users\guill\.julia\packages\Plots\kLeqV\src\plot.jl:93 jl_apply at C:/workdir/src\julia.h:1982 [inlined] do_call at C:/workdir/src\interpreter.c:126 eval_value at C:/workdir/src\interpreter.c:223 eval_stmt_value at C:/workdir/src\interpreter.c:174 [inlined] eval_body at C:/workdir/src\interpreter.c:635 jl_interpret_toplevel_thunk at C:/workdir/src\interpreter.c:775 jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:934 jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:877 jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:877 jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:877 ijl_toplevel_eval at C:/workdir/src\toplevel.c:943 [inlined] ijl_toplevel_eval_in at C:/workdir/src\toplevel.c:985 eval at .\boot.jl:385 [inlined] eval_user_input at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:150 repl_backend_loop at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:246 #start_repl_backend#46 at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:231 start_repl_backend at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:228 #run_repl#59 at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:389 run_repl at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:375 jfptr_run_repl_95791.1 at C:\Users\guill\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line) #1013 at .\client.jl:432 jfptr_YY.1013_86566.1 at C:\Users\guill\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line) jl_apply at C:/workdir/src\julia.h:1982 [inlined] jl_f__call_latest at C:/workdir/src\builtins.c:812 #invokelatest#2 at .\essentials.jl:892 [inlined] invokelatest at .\essentials.jl:889 [inlined] run_main_repl at .\client.jl:416 exec_options at .\client.jl:333 _start at .\client.jl:552 jfptr__start_86591.1 at C:\Users\guill\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line) jl_apply at C:/workdir/src\julia.h:1982 [inlined] true_main at C:/workdir/src\jlapi.c:582 jl_repl_entrypoint at C:/workdir/src\jlapi.c:731 mainCRTStartup at C:/workdir/cli\loader_exe.c:58 BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line) RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line) Allocations: 114151663 (Pool: 114016604; Big: 135059); GC: 97

@baggepinnen
Copy link
Contributor Author

The patch yingbo posted is related to solve, the problem with plotting and rendering may or may not be related. Would you mind trying it on the latest JSCompiler?

Debugging this appears very hard, it no longer fails on windows on our CI machine 🙃

@baggepinnen
Copy link
Contributor Author

One more release of JSCompiler has been made, v0.1.24, where a lot of performance optimization in linsolve! have been turned off. Once again, I really hope this fixes the issue 🤞 Thank you for sticking with us

@pitx-perf
Copy link

I have the same crash if I run @YingboMa's script before the springmass example. Note that I only enter N==2 and N==3 cases (not the else).

One more release of JSCompiler has been made, v0.1.24, where a lot of performance optimization in linsolve! have been turned off. Once again, I really hope this fixes the issue 🤞 Thank you for sticking with us

Same crash as well (with and without running the script).

Should I contact you on Slack when I have availability if it helps ?

@baggepinnen
Copy link
Contributor Author

We have now released v0.1.26 of JSCompiler and this version passes all the CI tests on windows. I hope this has finally resolved the issue!

@pitx-perf
Copy link

I tested with JSCompiler v0.1.26 and all the examples solve and render correctly... except the quadrotor example.

The quadrotor solves fine, but calling render completely freezes my laptop after 20 seconds and I have to reboot.
If I run with addLoad = false then it renders correctly. (1)
I tried connecting the Load to the Body without the Rope: freeze. (2)
I tried to replace the Rope by a FixedTranslation: freeze. (3)
If I first render with addLoad = false and then call (3) in the same session then I managed to render (3), but it seems to be random (freezes the laptop 1/3 of the time...).
If I first render with addLoad = false and then call (2) : freeze.

The FullCar and RobotArm examples - which to me seem more complex to render than the QuadRotor- systematically render fine.

@baggepinnen
Copy link
Contributor Author

Thanks for testing! The quadrotor with load cable is significantly more complex than the robot example, each joint in the robot has a single degree of freedom, while each joint in the cable has 3 and the body of the aircraft has 6. I know that the quadrotor example is rather slow, it's slow to structural_simplify, slow to plot, to render and to linearize, but it should ideally not freeze your computer :/

Could you potentially be running out of RAM when the computer freezes?

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

4 participants