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

Mysterious silent crashed on windows when solving within threads #301

Closed
Omar-Elrefaei opened this issue May 9, 2023 · 1 comment
Closed

Comments

@Omar-Elrefaei
Copy link

I accidentally came across these weird crashes that are kind of consistent. Surprisingly, This doesn't seem to be replicable on Linux.

MWE:

using LinearSolve, Random, LinearAlgebra

function buggy_solve(seed)
    Random.seed!(seed)
	n = 4
	m = 4
	a = randn(m,m)  
    c = randn(n,n)

	b = randn(m*n)
	A = kron(c, a)

	linprob=LinearProblem(A, b)
	println("checkpoint 1")
	target = solve(linprob).u
	println("checkpoint 2")
end

Threads.@threads for i in 10:13
	buggy_solve(i)
end

when saved in weird-threads-bug.lj and ran with julia --threads auto weird-threads-bug.jl julia itself just crashes with a non-zero exit code.
or when run from a repl, I just find myself dropped back at the shell.
When run from julia as run(``) (or python) it reports 3221225477 exit code, which I guess is a translated version of the -1073741819 that CMD returns. Numerous search results point to that being 0xC0000005 in hex which stands for STATUS_ACCESS_VIOLATION

screenshot demonstration ![image](https://github.com/SciML/LinearSolve.jl/assets/17922991/314922e8-0866-4c73-9f93-d78edad999c2) (first is a run with `--threads` demonstrating the crash and second is without and the script succeeds)

I've tested on linux on Julia v1.7.1 and I don't seem to be able to trigger it.
Unfortunately I can't test on Julia v1.9 on windows because of corporate policies (I don't have a windows machine but I can borrow one from a family member if needed)

I've no idea how to look into this further. This is not blocking or essential for me, just came across it by chance, so no need to feel urgency.


julia> versioninfo()
Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 12th Gen Intel(R) Core(TM) i7-1270P
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, goldmont)

(t2) pkg> status
      Status `C:\Users\elom\test\t2\Project.toml`
  [7ed4a6bd] LinearSolve v1.32.2
results of `st --manifest`
(t2) pkg> st --manifest
      Status `C:\Users\elom\test\t2\Manifest.toml`
  [79e6a3ab] Adapt v3.6.1
  [4fba245c] ArrayInterface v7.4.3
  [30b0a656] ArrayInterfaceCore v0.1.29
  [62783981] BitTwiddlingConvenienceFunctions v0.1.5
  [2a0fbf3d] CPUSummary v0.2.2
  [d360d2e6] ChainRulesCore v1.16.0
  [9e997f8a] ChangesOfVariables v0.1.7
  [fb6a15b2] CloseOpenIntervals v0.1.12
  [38540f10] CommonSolve v0.2.3
  [bbf7d656] CommonSubexpressions v0.3.0
  [34da2185] Compat v4.6.1
  [187b0558] ConstructionBase v1.5.2
  [adafc99b] CpuId v0.3.1
  [9a962f9c] DataAPI v1.14.0
  [e2d170a0] DataValueInterfaces v1.0.0
  [163ba53b] DiffResults v1.1.0
  [b552c78f] DiffRules v1.13.0
  [ffbed154] DocStringExtensions v0.9.3
  [4e289a0a] EnumX v1.0.4
  [e2ba6199] ExprTools v0.1.9
  [29a986be] FastLapackInterface v1.2.9
  [f6369f11] ForwardDiff v0.10.35
  [069b7b12] FunctionWrappers v1.1.3
  [77dc65aa] FunctionWrappersWrappers v0.1.3
  [46192b85] GPUArraysCore v0.1.4
  [3e5b6fbb] HostCPUFeatures v0.1.14
  [615f187c] IfElse v0.1.1
  [3587e190] InverseFunctions v0.1.9
  [92d709cd] IrrationalConstants v0.2.2
  [42fd0dbc] IterativeSolvers v0.9.2
  [82899510] IteratorInterfaceExtensions v1.0.0
  [692b3bcd] JLLWrappers v1.4.1
  [ef3ab10e] KLU v0.4.0
  [ba0b0d4f] Krylov v0.9.0
  [0b1a1467] KrylovKit v0.6.0
  [10f19ff3] LayoutPointers v0.1.14
  [50d2b5c4] Lazy v0.15.1
  [7ed4a6bd] LinearSolve v1.32.2
  [2ab3a3ac] LogExpFunctions v0.3.23
  [bdcacae8] LoopVectorization v0.12.158
  [1914dd2f] MacroTools v0.5.10
  [d125e4d3] ManualMemory v0.1.8
  [77ba4419] NaNMath v1.0.2
  [6fe1bfb0] OffsetArrays v1.12.9
  [bac558e1] OrderedCollections v1.6.0
  [f517fe37] Polyester v0.7.3
  [1d0040c9] PolyesterWeave v0.2.1
  [aea7be01] PrecompileTools v1.1.1
  [21216c6a] Preferences v1.4.0
  [3cdcf5f2] RecipesBase v1.3.4
  [731186ca] RecursiveArrayTools v2.38.4
  [f2c3362d] RecursiveFactorization v0.2.18
  [189a3867] Reexport v1.2.2
  [ae029012] Requires v1.3.0
  [7e49a35a] RuntimeGeneratedFunctions v0.5.7
  [94e857df] SIMDTypes v0.1.0
  [476501e8] SLEEFPirates v0.6.38
  [0bca4576] SciMLBase v1.91.7
  [c0aeaf25] SciMLOperators v0.2.4
  [efcf1570] Setfield v1.1.1
  [66db9d55] SnoopPrecompile v1.0.3
  [e56a9233] Sparspak v0.3.9
  [276daf66] SpecialFunctions v2.2.0
  [aedffcd0] Static v0.8.6
  [0d7ed370] StaticArrayInterface v1.4.0
  [90137ffa] StaticArrays v1.5.24
  [1e83bf80] StaticArraysCore v1.4.0
  [7792a7ef] StrideArraysCore v0.4.13
  [2efcf032] SymbolicIndexingInterface v0.2.2
  [3783bdb8] TableTraits v1.0.1
  [bd369af6] Tables v1.10.1
  [8290d209] ThreadingUtilities v0.5.1
  [d5829a12] TriangularSolve v0.1.19
  [410a4b4d] Tricks v0.1.7
  [781d530d] TruncatedStacktraces v1.3.0
  [3a884ed6] UnPack v1.0.2
  [3d5dd08c] VectorizationBase v0.21.64
  [efe28fd5] OpenSpecFun_jll v0.5.5+0
  [0dad84c5] ArgTools
  [56f22d72] Artifacts
  [2a0f44e3] Base64
  [ade2ca70] Dates
  [8ba89e20] Distributed
  [f43a241f] Downloads
  [9fa8497b] Future
  [b77e0a4c] InteractiveUtils
  [b27032c2] LibCURL
  [76f85450] LibGit2
  [8f399da3] Libdl
  [37e2e46d] LinearAlgebra
  [56ddb016] Logging
  [d6f4376e] Markdown
  [ca575930] NetworkOptions
  [44cfe95a] Pkg
  [de0858da] Printf
  [3fa0cd96] REPL
  [9a3f8284] Random
  [ea8e919c] SHA
  [9e88b42a] Serialization
  [6462fe0b] Sockets
  [2f01184e] SparseArrays
  [10745b16] Statistics
  [4607b0f0] SuiteSparse
  [fa267f1f] TOML
  [a4e569a6] Tar
  [8dfed614] Test
  [cf7118a7] UUIDs
  [4ec0a83e] Unicode
  [e66e0078] CompilerSupportLibraries_jll
  [deac9b47] LibCURL_jll
  [29816b5a] LibSSH2_jll
  [c8ffd9c3] MbedTLS_jll
  [14a3606d] MozillaCACerts_jll
  [4536629a] OpenBLAS_jll
  [05823500] OpenLibm_jll
  [bea87d4a] SuiteSparse_jll
  [83775a58] Zlib_jll
  [8e850b90] libblastrampoline_jll
  [8e850ede] nghttp2_jll
  [3f19e933] p7zip_jll
@ChrisRackauckas
Copy link
Member

This looks like it's fixed on LinearSolve v2 with Julia v1.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants