JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.7k stars 5.48k forks source link

`Exception: EXCEPTION_ACCESS_VIOLATION` with `@profile` on Windows 10 #52651

Open sumiya11 opened 10 months ago

sumiya11 commented 10 months ago

Hi,

On Windows 10, running the following code

using Pkg; pkg"activate --temp"; pkg"add Nemo";
using Nemo, Profile

@profile for i in 1:1000000
    Nemo.reconstruct(Nemo.ZZRingElem(rand(1:1000)), Nemo.ZZRingElem(2^30+3))
end

gives me

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ff8bb943916 -- 

on

Julia Version 1.10.0
Commit 3120989f39 (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
  Threads: 1 on 8 virtual cores

UPD: Same error for 1.9.4

jishnub commented 10 months ago

any error messages that follow (in their entirety)

Is there more to the error message?

sumiya11 commented 10 months ago

any error messages that follow (in their entirety)

Is there more to the error message?

No, not really, if I am not mistaken. Here is the full output of julia --check-bounds=yes bug.jl

┌ Warning: The Pkg REPL mode is intended for interactive use only, and should not be used from scripts. It is recommended to use the functional API instead.
└ @ Pkg.REPLMode C:\Users\User\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\REPLMode\REPLMode.jl:382
  Activating new project at `C:\Users\User\AppData\Local\Temp\jl_h8KS7h`
   Resolving package versions...
    Updating `C:\Users\User\AppData\Local\Temp\jl_h8KS7h\Project.toml` 
  [2edaba10] + Nemo v0.38.2
    Updating `C:\Users\User\AppData\Local\Temp\jl_h8KS7h\Manifest.toml`
  [c3fe647b] + AbstractAlgebra v0.34.7
⌅ [d5909c97] + GroupsCore v0.4.2
  [692b3bcd] + JLLWrappers v1.5.0
  [1914dd2f] + MacroTools v0.5.12
  [2edaba10] + Nemo v0.38.2
  [21216c6a] + Preferences v1.4.1
  [fb686558] + RandomExtensions v0.4.4
  [e21ec000] + Antic_jll v0.201.500+0
  [d9960996] + Arb_jll v200.2300.0+0
  [fcfa6d1b] + Calcium_jll v0.401.100+0
⌅ [e134572f] + FLINT_jll v200.900.7+0
⌅ [656ef2d0] + OpenBLAS32_jll v0.3.24+0
  [0dad84c5] + ArgTools v1.1.1
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching
  [b77e0a4c] + InteractiveUtils
  [b27032c2] + LibCURL v0.6.4
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.10.0
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays v1.10.0
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll v1.0.5+1
  [781609d7] + GMP_jll v6.2.1+6
  [deac9b47] + LibCURL_jll v8.4.0+0
  [e37daf67] + LibGit2_jll v1.6.4+0
  [29816b5a] + LibSSH2_jll v1.11.0+1
  [3a97d323] + MPFR_jll v4.2.0+1
  [c8ffd9c3] + MbedTLS_jll v2.28.2+1
  [14a3606d] + MozillaCACerts_jll v2023.1.10
  [4536629a] + OpenBLAS_jll v0.3.23+2
  [bea87d4a] + SuiteSparse_jll v7.2.1+1
  [83775a58] + Zlib_jll v1.2.13+1
  [8e850b90] + libblastrampoline_jll v5.8.0+1
  [8e850ede] + nghttp2_jll v1.52.0+1
  [3f19e933] + p7zip_jll v17.4.0+2
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
Precompiling project...
  13 dependencies successfully precompiled in 41 seconds. 6 already precompiled.

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ff8bb943916 -- 
BioTurboNick commented 9 months ago

I couldn't initially reproduce on my computer with the provided loop count, but I could by adding a zero:

Julia Version 1.10.0
Commit 3120989f39 (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 12 × Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
  Threads: 1 on 12 virtual cores

Indeed, no stack trace is provided. The process appears to be hung.

The faulting function passes the majority of its work into a ccall into the FLINT library.

It appears to possibly be stochastic, with the probability of hitting it increasing as the loop count increases.

vtjnash commented 9 months ago

Windows is the only platform where we don't try to guarantee unwinding is safe. Perhaps we should remove the conditional guards that make it so that Windows is unsafe here? https://github.com/JuliaLang/julia/blob/08e3c2ebcabf2de5007f2d715f5e55e60d98eae9/src/stackwalk.c#L85-L90