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

Bounds error during SROA #52703

Closed
maleadt opened this issue Jan 2, 2024 · 1 comment · Fixed by #52717
Closed

Bounds error during SROA #52703

maleadt opened this issue Jan 2, 2024 · 1 comment · Fixed by #52717
Assignees
Labels
compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) regression Regression in behavior compared to a previous version
Milestone

Comments

@maleadt
Copy link
Member

maleadt commented Jan 2, 2024

As seen on PkgEval during testing of many packages. The simplest package seems to be Suppressor.jl:

Internal error: encountered unexpected error in runtime:
BoundsError(a=Array{Core.SSAValue, 1}(dims=(115,), mem=Memory{Core.SSAValue}(115, 0x7f65fe3b7b30)[SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(220), SSAValue(220), SSAValue(220), SSAValue(220), SSAValue(220), SSAValue(220), SSAValue(220), SSAValue(220), SSAValue(220), SSAValue(220), SSAValue(220), SSAValue(220), SSAValue(220), SSAValue(220), SSAValue(220), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0), SSAValue(0)]), i=(0,))
throw_boundserror at ./essentials.jl:14
getindex at ./essentials.jl:816 [inlined]
sroa_pass! at ./compiler/ssair/passes.jl:1213
run_passes_ipo_safe at ./compiler/optimize.jl:908
run_passes_ipo_safe at ./compiler/optimize.jl:923 [inlined]
optimize at ./compiler/optimize.jl:897
jfptr_optimize_38412.1 at /tmp/jl_Gx3Cts/lib/julia/sys.so (unknown line)
_jl_invoke at /source/src/gf.c:2920 [inlined]
ijl_apply_generic at /source/src/gf.c:3097
_typeinf at ./compiler/typeinfer.jl:264
typeinf at ./compiler/typeinfer.jl:216
typeinf_edge at ./compiler/typeinfer.jl:870

Bisected to #52608, cc @Keno

@maleadt maleadt added the regression Regression in behavior compared to a previous version label Jan 2, 2024
@maleadt maleadt added this to the 1.11 milestone Jan 2, 2024
@maleadt
Copy link
Member Author

maleadt commented Jan 2, 2024

MWE:

macro b(c, d)
    quote
        @with $
    end
end
macro e(block)
    quote
         try
            @b f 0
        finally
        end
    end
end
mktemp() do g, h
    @e error
end

@maleadt maleadt added the compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) label Jan 2, 2024
@Keno Keno self-assigned this Jan 3, 2024
Keno added a commit that referenced this issue Jan 3, 2024
This fixes #52703, which happened when a function had a foldable,
try-catch-with-scope inside an ordinary try/catch. The fix is to
simply ignore the ordinary try/catch and treat it as a regular
fallthrough terminator.
Keno added a commit that referenced this issue Jan 3, 2024
This fixes #52703, which happened when a function had a foldable,
try-catch-with-scope inside an ordinary try/catch. The fix is to simply
ignore the ordinary try/catch and treat it as a regular fallthrough
terminator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants