-
Notifications
You must be signed in to change notification settings - Fork 39
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
Strange error while saving large BSON #67
Comments
Here are some examples that reproduce the error resulting from the calls of Line 14 in f66a639
Line 15 in f66a639
Line 32 in f66a639
julia> using BSON
julia> a = zeros(UInt8, 2147483634);
julia> BSON.@save "testa.bson" a # works
julia> b = zeros(UInt8, 2147483635);
julia> BSON.@save "testb.bson" b # fails due to call of `Int32` in line 32
ERROR: InexactError: trunc(Int32, 2147483648)
Stacktrace:
[1] throw_inexacterror(::Symbol, ::Type{Int32}, ::Int64) at ./boot.jl:557
[2] checked_trunc_sint at ./boot.jl:579 [inlined]
[3] toInt32 at ./boot.jl:616 [inlined]
[4] Int32 at ./boot.jl:706 [inlined]
[5] bson_doc(::IOStream, ::Dict{Symbol,Any}) at /home/david/.julia/dev/BSON/src/write.jl:32
...
julia> c = zeros(UInt8, 2147483648);
julia> BSON.@save "testc.bson" c # fails due to call of `Int32` in line 14
ERROR: InexactError: trunc(Int32, 2147483648)
Stacktrace:
[1] throw_inexacterror(::Symbol, ::Type{Int32}, ::Int64) at ./boot.jl:557
[2] checked_trunc_sint at ./boot.jl:579 [inlined]
[3] toInt32 at ./boot.jl:616 [inlined]
[4] Int32 at ./boot.jl:706 [inlined]
[5] bson_primitive at /home/david/.julia/dev/BSON/src/write.jl:14 [inlined]
...
julia> d = "0" ^ 2147483647;
julia> BSON.@save "testd.bson" d # fails due to call of `Int32` in line 15
ERROR: InexactError: trunc(Int32, 2147483648)
Stacktrace:
[1] throw_inexacterror(::Symbol, ::Type{Int32}, ::Int64) at ./boot.jl:557
[2] checked_trunc_sint at ./boot.jl:579 [inlined]
[3] toInt32 at ./boot.jl:616 [inlined]
[4] Int32 at ./boot.jl:706 [inlined]
[5] bson_primitive at /home/david/.julia/dev/BSON/src/write.jl:15 [inlined]
... The BSON specification requires the total number of bytes in a document, the number of bytes in binary data, and the number of bytes in a string (plus the trailing |
I am getting a
InexactError: trunc(Int32, 8431957686)
error while saving a large BSON. I was wondering if you know what could be causing it and how to get around it. Unfortunately, I am not sure how to replicate the error.The text was updated successfully, but these errors were encountered: