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

FrontEnd Segmentation Fault in Julia v0.7 #29

Closed
ccoffrin opened this issue Nov 5, 2018 · 8 comments
Closed

FrontEnd Segmentation Fault in Julia v0.7 #29

ccoffrin opened this issue Nov 5, 2018 · 8 comments

Comments

@ccoffrin
Copy link
Member

ccoffrin commented Nov 5, 2018

@eperim, I am working on migrating this code to work on v0.6/v0.7/v1.0. Currently I am stuck with a segmentation fault that occurs during compilation on Julia v0.7 while in frontend/units.jl. The issue seems to be in this call, Unitful.register(current_module()).

Can you have a look and see if you can suggest a fix?

Full trace,

using PowerModelsAnnex
...
┌ Warning: `current_module()` is deprecated, use `@__MODULE__` instead.
│   caller = top-level scope at none:0
└ @ Core none:0
WARNING: eval from module Unitful to PowerModelsAnnex:    
Expr(:call, :/, Unitful.FreeUnits{(Unitful.Unit{:WattHour, Unitful.Dimensions{(Unitful.Dimension{:Length}(power=Base.Rational{Int64}(num=2, den=1)), Unitful.Dimension{:Mass}(power=Base.Rational{Int64}(num=1, den=1)), Unitful.Dimension{:Time}(power=Base.Rational{Int64}(num=-2, den=1)))}}(tens=6, power=Base.Rational{Int64}(num=1, den=1)),), Unitful.Dimensions{(Unitful.Dimension{:Length}(power=Base.Rational{Int64}(num=2, den=1)), Unitful.Dimension{:Mass}(power=Base.Rational{Int64}(num=1, den=1)), Unitful.Dimension{:Time}(power=Base.Rational{Int64}(num=-2, den=1)))}}(), Unitful.FreeUnits{(Unitful.Unit{:Minute, Unitful.Dimensions{(Unitful.Dimension{:Time}(power=Base.Rational{Int64}(num=1, den=1)),)}}(tens=0, power=Base.Rational{Int64}(num=1, den=1)),), Unitful.Dimensions{(Unitful.Dimension{:Time}(power=Base.Rational{Int64}(num=1, den=1)),)}}())
  ** incremental compilation may be broken for this module **

WARNING: eval from module Unitful to PowerModelsAnnex:    
Expr(:call, :*, Unitful.FreeUnits{(Unitful.Unit{:Watt, Unitful.Dimensions{(Unitful.Dimension{:Length}(power=Base.Rational{Int64}(num=2, den=1)), Unitful.Dimension{:Mass}(power=Base.Rational{Int64}(num=1, den=1)), Unitful.Dimension{:Time}(power=Base.Rational{Int64}(num=-3, den=1)))}}(tens=6, power=Base.Rational{Int64}(num=1, den=1)),), Unitful.Dimensions{(Unitful.Dimension{:Length}(power=Base.Rational{Int64}(num=2, den=1)), Unitful.Dimension{:Mass}(power=Base.Rational{Int64}(num=1, den=1)), Unitful.Dimension{:Time}(power=Base.Rational{Int64}(num=-3, den=1)))}}(), Unitful.FreeUnits{(Unitful.Unit{:Hour, Unitful.Dimensions{(Unitful.Dimension{:Time}(power=Base.Rational{Int64}(num=1, den=1)),)}}(tens=0, power=Base.Rational{Int64}(num=1, den=1)),), Unitful.Dimensions{(Unitful.Dimension{:Time}(power=Base.Rational{Int64}(num=1, den=1)),)}}())
  ** incremental compilation may be broken for this module **


signal (11): Segmentation fault: 11
in expression starting at no file:0
jl_gc_pool_alloc at /Users/osx/buildbot/slave/package_osx64/build/src/gc.c:963
jl_gc_alloc at /Users/osx/buildbot/slave/package_osx64/build/src/./julia_internal.h:274
_new_array_ at /Users/osx/buildbot/slave/package_osx64/build/src/array.c:99
...
@eperim
Copy link
Contributor

eperim commented Nov 5, 2018

@ccoffrin This seems like a strange error. I had first tested Unitful, then PowerModelsAnnex precompiled alright (with all those warnings). However, if (and only if) I try to do using PowerModelsAnnex without doing using Unitful first, I get a segmentation fault. Could you test if you can reproduce this?

@ccoffrin
Copy link
Member Author

ccoffrin commented Nov 5, 2018

Agreed that it is strange.

On master I tried clearing my compiled cache and then ran using Unitful; using PowerModelsAnnex which yielded similar segfault results. I have noticed that compilation will work randomly about 10% of the times I do using or test.

@eperim
Copy link
Contributor

eperim commented Nov 5, 2018

Here using Unitful; using PowerModelsAnnex seems to work 100% of the time. However, the tests always throw the segfault. I will try to see if someone who knows more julia than I do can help over here.

@ccoffrin
Copy link
Member Author

Any updates on this? Would you mind if I drop the tests for the frontend for now so that the package can be working in Julia v0.7/v1.0?

@eperim
Copy link
Contributor

eperim commented Nov 10, 2018

Tried a couple of things, but nothing conclusive yet. I don't mind at all if you turn off the tests (or the module altogether, if necessary). As soon as we have a solution I'll push it.

@ccoffrin
Copy link
Member Author

It seems that we can produce your experience on travis, https://travis-ci.org/lanl-ansi/PowerModelsAnnex.jl/builds/454089255. Going to merge and tag with the frontend tests commented out.

@ccoffrin
Copy link
Member Author

In the end, it seems that in some rare cases the segfault was reproducible on travis, https://travis-ci.org/lanl-ansi/PowerModelsAnnex.jl/jobs/454117634.

@nicoleepp
Copy link
Contributor

This is fixed locally for me with #32

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