-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Avoid some stackoverflow during typeintersect. #48029
Conversation
On this branch tests of Healpix.jl crash instead of hanging (which is a slight improvement):
Is this a bug in the package or something else to fix on the julia side? CC: @ziotom78 |
FWIW, this seems to work around it: diff --git a/src/map_io.jl b/src/map_io.jl
index 3bea696..d3c2699 100644
--- a/src/map_io.jl
+++ b/src/map_io.jl
@@ -104,7 +104,10 @@ function readPolarizedMapFromFITS(
end
f = CFITSIO.fits_open_table(fileName)
- i, q, u = (readMapFromFITS(f, colidx, t) for colidx in (column_i, column_q, column_u))
+ i = readMapFromFITS(f, column_i, t)
+ q = readMapFromFITS(f, column_q, t)
+ u = readMapFromFITS(f, column_u, t)
+
CFITSIO.fits_close_file(f)
PolarizedHealpixMap(i, q, u) |
Not that suppressing as julia> code_typed(Healpix.readMapFromFITS, Tuple{Healpix.CFITSIO.FITSFile,Int,DataType})
ERROR: StackOverflowError: |
Might be a smaller MWE struct HealpixMap{T,AA<:AbstractArray{T,1}}
pixels::AA
function HealpixMap{Union{T,Nothing},AA}(a::Number) where {T,AA<:AbstractArray{Union{T,Nothing},1}}
new(Union{T, Nothing}[nothing for i in 1:a])
end
function HealpixMap{T,AA}(arr::AA) where {T,AA<:AbstractArray{T,1}}
new(arr)
end
end
HealpixMap{T}(arr) where {T} = HealpixMap{T,Vector{T}}(collect(arr))
f(::Type{T}) where {T} = HealpixMap{T}(T[])
code_typed(f, Tuple{DataType}) but this gives the correct result struct HealpixMap{T,AA<:AbstractArray{T,1}}
pixels::AA
function HealpixMap{Union{T,Nothing},AA}(a::Number) where {T,AA<:AbstractArray{Union{T,Nothing},1}}
new{Union{T,Nothing},AA}(Union{T, Nothing}[nothing for i in 1:a])
end
function HealpixMap{T,AA}(arr::AA) where {T,AA<:AbstractArray{T,1}}
new{T,AA}(arr)
end
end |
6e08876
to
e467ded
Compare
Seems good to me. I think there was a small typo in the commit message and it needs to re-run CI since it had some networking issues. Could you push an update? |
When we perform re-`intersection_unionall`, the `Union` bounds might be generated from `simple_join and thus not identical to the src `Union`. This commit adds a fast-path to skip the following `intersect_all.
This fixes the MWE reported in JuliaLang#47874 (comment) And this fixes the remaining internal error in `Healpix.jl`'s test. gc fix
@nanosoldier |
Your package evaluation job has completed - possible new issues were detected. A full report can be found here. |
I don't think it needs to be blocking to merge this, but AngularMomentumAlgebra may be good to look into https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/36cd9c6_vs_79e29e3/AngularMomentumAlgebra.primary.log (and maybe some of the other reported hangs) |
I'll take a look at |
Avoid some stackoverflow during typeintersect. (cherry picked from commit a5ab48f)
When I dig in #46736, I found that
subtype_in_env_existential
is somehow dangous as we flip all typevar to the right side.I tried to follow #48006 style but it caused many test failure. So this PR just makes the following change to avoid some known stackoverflow:
env
is restored between 2 adjacentsubtype_in_env_existential
. Thus the second subtype check wont be influenced by the first one. (close SIGSEGV and StackOverflow from dispatching on ::Type{T}, ::Array{Union{T,Missing},N}) #36185)intersect_aside
(close Healpix.jl tests hang on Julia v1.9 #46736.)