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

Incremental compilation may be fatally broken for this module #51

Closed
devmotion opened this issue Aug 26, 2019 · 1 comment
Closed

Incremental compilation may be fatally broken for this module #51

devmotion opened this issue Aug 26, 2019 · 1 comment

Comments

@devmotion
Copy link
Member

I don't know how the current version of DiffEqProblemLibrary should be used in my package. If I run

using TestImports

for the following MWE

module TestImports

using DiffEqProblemLibrary.DDEProblemLibrary

DDEProblemLibrary.importddeproblems()

@show DDEProblemLibrary.prob_dde_constant_1delay_ip

end # module

with DiffEqProblemLibrary as only dependency, I get a lot of

  ** incremental compilation may be fatally broken for this module ** 

warnings, finally resulting in a segfault:

signal (11): Segmentation fault
in expression starting at REPL[3]:1
unknown function (ip: 0x7f6bafeb964f)
jl_deserialize_datatype at /buildworker/worker/package_linux64/build/src/dump.c:1343 [inlined]
jl_deserialize_value at /buildworker/worker/package_linux64/build/src/dump.c:2160
jl_deserialize_value_svec at /buildworker/worker/package_linux64/build/src/dump.c:1479 [inlined]
jl_deserialize_value at /buildworker/worker/package_linux64/build/src/dump.c:2008
jl_deserialize_value at /buildworker/worker/package_linux64/build/src/dump.c:1456
jl_deserialize_value_svec at /buildworker/worker/package_linux64/build/src/dump.c:1479 [inlined]
jl_deserialize_value at /buildworker/worker/package_linux64/build/src/dump.c:2008
jl_deserialize_value at /buildworker/worker/package_linux64/build/src/dump.c:1456
jl_deserialize_value_any at /buildworker/worker/package_linux64/build/src/dump.c:1932 [inlined]
jl_deserialize_value at /buildworker/worker/package_linux64/build/src/dump.c:2163
jl_deserialize_value at /buildworker/worker/package_linux64/build/src/dump.c:1784
jl_deserialize_value_array at /buildworker/worker/package_linux64/build/src/dump.c:1544
jl_deserialize_value at /buildworker/worker/package_linux64/build/src/dump.c:2029
_jl_restore_incremental at /buildworker/worker/package_linux64/build/src/dump.c:3159
jl_restore_incremental at /buildworker/worker/package_linux64/build/src/dump.c:3218
_include_from_serialized at ./loading.jl:669
_require_from_serialized at ./loading.jl:736
_require at ./loading.jl:1023
require at ./loading.jl:911
require at ./loading.jl:906
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2197
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1614 [inlined]
call_require at /buildworker/worker/package_linux64/build/src/toplevel.c:399 [inlined]
eval_import_path at /buildworker/worker/package_linux64/build/src/toplevel.c:436
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:656
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:764
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:844
eval at ./boot.jl:330
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2191
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/REPL/src/REPL.jl:86
run_backend at /home/david/.julia/packages/Revise/JCJHO/src/Revise.jl:953
#77 at ./task.jl:268
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2197
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1614 [inlined]
start_task at /buildworker/worker/package_linux64/build/src/task.c:596
unknown function (ip: 0xffffffffffffffff)
Allocations: 12720233 (Pool: 12717515; Big: 2718); GC: 26
zsh: segmentation fault (core dumped)  $HOME/opt/julia-1.2.0/bin/julia

After replacing module DDEProblemLibrary... end with

export importddeproblems
function importddeproblems()
  include(joinpath(@__DIR__, "dde/dde_premade_problems.jl"))
  nothing
end

and wrapping everything in dde_premade_problems.jl inside of a module DDEProblemLibrary + removing the deprecations in that file, and using

module TestImports

using DiffEqProblemLibrary

importddeproblems()

using DiffEqProblemLibrary.DDEProblemLibrary

@show DDEProblemLibrary.prob_dde_constant_1delay_ip

end # module

I can successfully run

julia> using TestImports                                                       
DDEProblemLibrary.prob_dde_constant_1delay_ip = DDEProblem with uType Array{Float64,1} and tType Float64. In-place: true
timespan: (0.0, 10.0)           
u0: [1.0]                                                                                                                           

However, unfortunately that's not a general solution since the same changes do not work for ODEProblemLibrary due to some evaluations of ModelingToolkit.

So I started to believe that the cleanest solution might actually be to break this package up into different packages such as (DiffEq)ODEProblemLibrary, (DiffEq)DDEProblemLibrary, and so on. Then there's no need for any optional evaluations anymore and (hopefully) everything should work as intended. Also, it would probably reduce the amount and interactions of dependencies which might sometimes be an issue, as we saw in the case of HomotopyContinuation in DiffEqBase.

@ChrisRackauckas
Copy link
Member

Fixed

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