JuliaDebug / Debugger.jl

Julia debugger
MIT License
470 stars 43 forks source link

hard crash/boundserror #333

Open gdkrmr opened 1 year ago

gdkrmr commented 1 year ago

The following code crashes my Julia session hard (tested with Julia 1.8 and 1.9)

using YAXArrays
using Zarr

c_path = "http://data.rsc4earth.de:9000/earthsystemdatacube/v3.0.2/esdc-8d-0.25deg-1x720x1440-3.0.2.zarr"
c_zarr = Zarr.zopen(c_path)
c_dataset = YAXArrays.open_dataset(c_zarr)
c_full = YAXArrays.Cube(c_dataset)
c = c_full[variable=["sensible_heat", "air_temperature_2m", "radiation_era5"]]

m2 = rand(3)
s2 = rand(3)

v_ax = getAxis("variable", c)
stat_ax = CategoricalAxis("statistic", ["mean", "std"])
c_stat = YAXArray([v_ax, stat_ax], [m2 s2])
c

typeof(c)

getAxis("variable", c) == getAxis("variable", c_stat)

using Debugger
@run mapCube(
    (c, c_stat),
    indims=(InDims(), InDims("statistic")),
    outdims=OutDims()
) do xout, xin1, xin2
    xout .= (xin1 .- xin2[1]) ./ xin2[2]
end

Traceback is very long but starts with

julia> @run mapCube(
           (c, c_stat),
           indims=(InDims(), InDims("statistic")),
           outdims=OutDims()
       ) do xout, xin1, xin2
           xout .= (xin1 .- xin2[1]) ./ xin2[2]
       end
Internal error: encountered unexpected error in runtime:
BoundsError(a=svec(), i=1)