-
-
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
Bus error 10 on 1.8.2 aarch64 #47193
Comments
It does seem to come from inside libnetcdf, so it might not be julia. |
I agree the backtrace looks suspect, but this code, and the same library, works correctly on previous Julia versions. |
The same code works on 1.8.1 on aarch-64 mac but not on 1.8.2. |
Bisected to #45173. @JeffBezanson |
On master I don't get a bus error but I do get segfault. |
I went a lot deeper into this and the issue seems to be that we used to this ccall with the following arguments Hit breakpoint:
In gdalcreatecopy(arg1, arg2, arg3, arg4, arg5, arg6, arg7) at /Users/gabrielbaraldi/.julia/packages/GDAL/TCvFp/src/libgdal.jl:6232
6232 function gdalcreatecopy(arg1, arg2, arg3, arg4, arg5, arg6, arg7)
>6233 aftercare(
6234 ccall(
6235 (:GDALCreateCopy, libgdal),
6236 GDALDatasetH,
6237 (
About to run: (Base.cconvert)(Ptr{Nothing}, Ptr{Nothing} @0x0000600001eeca90)
1|debug> fr
[1] gdalcreatecopy(arg1, arg2, arg3, arg4, arg5, arg6, arg7) at /Users/gabrielbaraldi/.julia/packages/GDAL/TCvFp/src/libgdal.jl:6232
| arg1::Ptr{Nothing} = Ptr{Nothing} @0x0000600001eeca90
| arg2::String = "test_cog.tif"
| arg3::Ptr{Nothing} = Ptr{Nothing} @0x0000000135e32140
| arg4::Bool = false
| arg5::Vector{String} = String[]
| arg6::Ptr{Nothing} = Ptr{Nothing} @0x0000000000000000
| arg7::Ptr{Nothing} = Ptr{Nothing} @0x0000000000000000 Note that arg6 is a NULL. 1|debug> n
In gdalcreatecopy(arg1, arg2, arg3, arg4, arg5, arg6, arg7) at /Users/gabrielbaraldi/.julia/packages/GDAL/TCvFp/src/libgdal.jl:6232
6232 function gdalcreatecopy(arg1, arg2, arg3, arg4, arg5, arg6, arg7)
>6233 aftercare(
6234 ccall(
6235 (:GDALCreateCopy, libgdal),
6236 GDALDatasetH,
6237 (
About to run: <(JuliaInterpreter.CompiledCalls.var"##compiled_ccall#347")(Ptr{Nothing} @0x0000600001b2c270, Cstring(...>
1|debug> fr
[1] gdalcreatecopy(arg1, arg2, arg3, arg4, arg5, arg6, arg7) at /Users/gabrielbaraldi/.julia/packages/GDAL/TCvFp/src/libgdal.jl:6232
| arg1::Ptr{Nothing} = Ptr{Nothing} @0x0000600001b2c270
| arg2::String = "test_cog.tif"
| arg3::Ptr{Nothing} = Ptr{Nothing} @0x000000013d625180
| arg4::Bool = false
| arg5::Vector{String} = String[]
| arg6::Ptr{Nothing} = Ptr{Nothing} @0x0000000151cf4b08
| arg7::Ptr{Nothing} = Ptr{Nothing} @0x0000000000000000 Now note that arg6 is not null. From the Macos crash reporter I get
Which is the exact pointer that we passed to arg6. |
And the sixth argument is the user provided callback progress function I believe, which doesn't work on m1. So we did the following: |
I'm confused as to why on 1.8.1 I get a NULL, and the other I get a an actual pointer. Is passing a NULL to gdal expected @evetion ? |
Passing a NULL is valid if you don't want a progress callback. That is probably what the workaround in ArchGDAL should enforce rather that the dummy cfunction it gets now. |
Oh, so it was a bug that it was getting a NULL pointer then, and that change made it so it actually got the correct results in 1.8.2, which broke it :) |
Hmm, odd, because on 1.8.1 I do get a pointer back: julia> using ArchGDAL
julia> @cfunction(
ArchGDAL.GDAL.gdaldummyprogress,
Cint,
(Cdouble, Cstring, Ptr{Cvoid})
)
Ptr{Nothing} @0x000000013fae007c
julia> Sys.ARCH == :aarch64
true |
You have to get it from deep in there, by modifying the code. Which is why I think there was a bug. |
Thanks for digging in! Nasty bug, I've made a PR over at ArchGDAL to fix it. My summary:
|
Since 1.8.2 on Mac M1 (aarch64) the following snippet will crash Julia:
with
In 1.8.1 (and 1.8.2 on other (CI) platforms) this works. I will try to debug this further, under the hood (via ArchGDAL, GDAL, GDAL_jll) this
ccall
an external C++ library.Might relate to #47171.
The text was updated successfully, but these errors were encountered: