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

LinearAlgebra with BigFloat edgecases crash Julia #1080

Closed
SouthEndMusic opened this issue Jul 19, 2024 · 3 comments
Closed

LinearAlgebra with BigFloat edgecases crash Julia #1080

SouthEndMusic opened this issue Jul 19, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@SouthEndMusic
Copy link

SouthEndMusic commented Jul 19, 2024

This code crashes my Julia REPL (so it doesn't just throw an error):

A = zeros(BigFloat, 0, 5)
b = zeros(BigFloat, 0)

A \ b

error:

Exception: EXCEPTION_ACCESS_VIOLATION at 0x224e2c1defa -- == at .\promotion.jl:521 [inlined]
== at .\pointer.jl:278 [inlined]
unsafe_convert at .\mpfr.jl:145 [inlined]
isnan at .\mpfr.jl:983 [inlined]
== at .\mpfr.jl:873 [inlined]
iszero at .\mpfr.jl:988 [inlined]
generic_trimatdiv! at C:\workdir\usr\share\julia\stdlib\v1.10\LinearAlgebra\src\triangular.jl:1140
in expression starting at c:\Users\konin_bt\SciML\runner.jl:39
== at .\promotion.jl:521 [inlined]
== at .\pointer.jl:278 [inlined]
unsafe_convert at .\mpfr.jl:145 [inlined]
isnan at .\mpfr.jl:983 [inlined]
== at .\mpfr.jl:873 [inlined]
iszero at .\mpfr.jl:988 [inlined]
generic_trimatdiv! at C:\workdir\usr\share\julia\stdlib\v1.10\LinearAlgebra\src\triangular.jl:1140
_ldiv! at C:\workdir\usr\share\julia\stdlib\v1.10\LinearAlgebra\src\triangular.jl:752 [inlined]
ldiv! at C:\workdir\usr\share\julia\stdlib\v1.10\LinearAlgebra\src\triangular.jl:757 [inlined]
_wide_qr_ldiv! at C:\workdir\usr\share\julia\stdlib\v1.10\LinearAlgebra\src\qr.jl:641
ldiv! at C:\workdir\usr\share\julia\stdlib\v1.10\LinearAlgebra\src\qr.jl:665
ldiv! at C:\workdir\usr\share\julia\stdlib\v1.10\LinearAlgebra\src\qr.jl:673 [inlined]
ldiv! at C:\workdir\usr\share\julia\stdlib\v1.10\LinearAlgebra\src\qr.jl:678
ldiv at C:\workdir\usr\share\julia\stdlib\v1.10\LinearAlgebra\src\LinearAlgebra.jl:572
\ at C:\workdir\usr\share\julia\stdlib\v1.10\LinearAlgebra\src\LinearAlgebra.jl:547 [inlined]
\ at C:\workdir\usr\share\julia\stdlib\v1.10\LinearAlgebra\src\generic.jl:1126
unknown function (ip: 00000224e2c285cf)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
do_call at C:/workdir/src\interpreter.c:126
eval_value at C:/workdir/src\interpreter.c:223
eval_stmt_value at C:/workdir/src\interpreter.c:174 [inlined]
eval_body at C:/workdir/src\interpreter.c:635
jl_interpret_toplevel_thunk at C:/workdir/src\interpreter.c:775
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:934
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:877
ijl_toplevel_eval at C:/workdir/src\toplevel.c:943 [inlined]
ijl_toplevel_eval_in at C:/workdir/src\toplevel.c:985
eval at .\boot.jl:385 [inlined]
include_string at .\loading.jl:2076
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:812
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
do_apply at C:/workdir/src\builtins.c:768
#invokelatest#2 at .\essentials.jl:892
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
do_apply at C:/workdir/src\builtins.c:768
invokelatest at .\essentials.jl:889
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
do_apply at C:/workdir/src\builtins.c:768
...

but with Float64 it runs fine and results in

5-element Vector{Float64}:
 0.0
 0.0
 0.0
 0.0
 0.0

Output from versioninfo():

Julia Version 1.10.4
Commit 48d4fd4843 (2024-06-04 10:41 UTC)
Build Info:
  Official https://julialang.org/ release        
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 24 × 12th Gen Intel(R) Core(TM) i7-12800HX
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, alderlake)
Threads: 16 default, 0 interactive, 8 GC (on 24 virtual cores)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 16
  JULIA_PKG_PRESERVE_TIERED_INSTALLED = true
  JULIA_PKG_USE_CLI_GIT = true
@mbauman
Copy link
Member

mbauman commented Jul 19, 2024

I can reproduce on my macOS with both v1.10.4 and v1.11-rc1, but it's fixed on v1.12 (was on b2657a5dd3e from 22 days ago).

@nsajko nsajko added bignums BigInt and BigFloat bug Something isn't working and removed bignums BigInt and BigFloat labels Jul 19, 2024
@nsajko
Copy link
Contributor

nsajko commented Jul 20, 2024

Fixed with 8945914d4f86cd38f1b079cfc916f881eddbb3c2, PR JuliaLang/julia#54201

@nsajko
Copy link
Contributor

nsajko commented Jul 20, 2024

MWE: ./julia -g2 --check-bounds=yes -e 'zeros(BigFloat,0,5) \ zeros(BigFloat,0)'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants