-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Memory leak in Julia-0.7.0-rc2 on Windows and Linux #28474
Comments
Could you elaborate on this? |
The line I referred to keeps hanging forever, increasing the memory the Julia app is taking until it takes up all the RAM and my OS crashes. When I print something before the function call and another inside the function, it prints what's before but not what's inside. So my guess is that it gets lost somewhere before finding the method and starts taking increasing amounts of memory doing what it's doing, until it takes up all the RAM. |
Perhaps memory leak is not the correct term, but I don't know what else to call it. |
I cannot repro on mac so perhaps windows only?
|
I can repro on a Ubuntu: Julia Version 0.7.0-rc2.0
Commit 78540cba4c (2018-08-02 19:14 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, skylake) |
I can't reproduce this either (on Linux). |
I could reproduce it on a fresh build on Ubuntu 18.04 LTS. |
Can you upload an exact |
This comment has been minimized.
This comment has been minimized.
|
I am sorry if I misunderstood Keno's request but this is what's in the file |
The point is that if you have any local changes, that might be why we cannot reproduce this. So do |
But the problem is not on IterativeSolvers master, it's on the memory_leak branch on my repo which I linked above https://github.com/mohamed82008/IterativeSolvers.jl/tree/memory_leak. |
Sorry, I missed that. If you wanted a reproducible Manifest you could have done Edit: Still cannot repro. |
|
I tried both my local source build and the generic binaries with this manifest and both work fine. |
I tried it on Travis and I cannot reproduce it there. |
I can reproduce that julia sucks up all memory and crashes + cannot interrupt it. Here is llvm IR if it helps. I can run with generic target (a.k.a julia> versioninfo()
Julia Version 0.7.0-rc2.0
Commit 78540cba4c (2018-08-02 19:14 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
julia> @code_llvm jacobi(A, b, maxiter=2n)
; Function #jacobi
; Location: none
define nonnull %jl_value_t addrspace(10)* @"julia_#jacobi_35214"({ i64 } addrspace(11)* nocapture nonnull readonly dereferenceable(8), %jl_value_t addrspace(10)* nonnull align 16 dereferenceable(40), %jl_value_t addrspace(10)* nonnull align 16 dereferenceable(40)) {
top:
%3 = alloca %jl_value_t addrspace(10)*, i32 5
%gcframe = alloca %jl_value_t addrspace(10)*, i32 3
%4 = bitcast %jl_value_t addrspace(10)** %gcframe to i8*
call void @llvm.memset.p0i8.i32(i8* %4, i8 0, i32 24, i32 0, i1 false)
%thread_ptr = call i8* asm "movq %fs:0, $0", "=r"()
%ptls_i8 = getelementptr i8, i8* %thread_ptr, i64 -10920
%ptls = bitcast i8* %ptls_i8 to %jl_value_t***
; Function pairs; {
; Location: iterators.jl:226
; Function Type; {
; Location: iterators.jl:169
%5 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %gcframe, i32 0
%6 = bitcast %jl_value_t addrspace(10)** %5 to i64*
store i64 2, i64* %6
%7 = getelementptr %jl_value_t**, %jl_value_t*** %ptls, i32 0
%8 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %gcframe, i32 1
%9 = bitcast %jl_value_t addrspace(10)** %8 to %jl_value_t***
%10 = load %jl_value_t**, %jl_value_t*** %7
store %jl_value_t** %10, %jl_value_t*** %9
%11 = bitcast %jl_value_t*** %7 to %jl_value_t addrspace(10)***
store %jl_value_t addrspace(10)** %gcframe, %jl_value_t addrspace(10)*** %11
%12 = bitcast %jl_value_t*** %ptls to i8*
%13 = call noalias nonnull %jl_value_t addrspace(10)* @jl_gc_pool_alloc(i8* %12, i32 1448, i32 32) #1
%14 = bitcast %jl_value_t addrspace(10)* %13 to %jl_value_t addrspace(10)* addrspace(10)*
%15 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)* addrspace(10)* %14, i64 -1
store %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140574987654192 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)* addrspace(10)* %15
%16 = addrspacecast %jl_value_t addrspace(10)* %13 to %jl_value_t addrspace(11)*
%17 = getelementptr inbounds { i64 }, { i64 } addrspace(11)* %0, i64 0, i32 0
%18 = bitcast %jl_value_t addrspace(10)* %13 to i64 addrspace(10)*
%19 = load i64, i64 addrspace(11)* %17, align 8
store i64 %19, i64 addrspace(10)* %18, align 8
%20 = bitcast %jl_value_t addrspace(11)* %16 to i8 addrspace(11)*
%21 = getelementptr inbounds i8, i8 addrspace(11)* %20, i64 8
%22 = bitcast i8 addrspace(11)* %21 to %jl_value_t addrspace(10)* addrspace(11)*
store %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140575001743104 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)* addrspace(11)* %22, align 8
%23 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %gcframe, i32 2
store %jl_value_t addrspace(10)* %13, %jl_value_t addrspace(10)** %23
;}}
%24 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %3, i32 0
store %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140574972332056 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)** %24
%25 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %3, i32 1
store %jl_value_t addrspace(10)* %13, %jl_value_t addrspace(10)** %25
%26 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %3, i32 2
store %jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140574972330856 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)** %26
%27 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %3, i32 3
store %jl_value_t addrspace(10)* %1, %jl_value_t addrspace(10)** %27
%28 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %3, i32 4
store %jl_value_t addrspace(10)* %2, %jl_value_t addrspace(10)** %28
%29 = call nonnull %jl_value_t addrspace(10)* @jl_invoke(%jl_value_t addrspace(10)* addrspacecast (%jl_value_t* inttoptr (i64 140574977403408 to %jl_value_t*) to %jl_value_t addrspace(10)*), %jl_value_t addrspace(10)** %3, i32 5)
%30 = getelementptr %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %gcframe, i32 1
%31 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %30
%32 = getelementptr %jl_value_t**, %jl_value_t*** %ptls, i32 0
%33 = bitcast %jl_value_t*** %32 to %jl_value_t addrspace(10)**
store %jl_value_t addrspace(10)* %31, %jl_value_t addrspace(10)** %33
ret %jl_value_t addrspace(10)* %29
} |
Actually, I can reproduce the problem on IterativeSolvers master branch so no need to use my repo or the memory_leak branch. |
Aha, I can reproduce the behavior with |
With LLVM assertions, I get:
|
That's a simple fix. From looking at the IR, this may have been another instance of #28445. I'm gonna push a fix for that LLVM assertion momentarily. After that, please try with master and see if the issue is resolved. |
GEPs can make vectors out of regular pointers if the offset is a vector. Fixes an assertion noticed in #28474.
Not resolved yet. |
Julia Version 1.0.0-DEV.56
Commit 3c2c8112ef (2018-08-06 19:08 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, skylake) |
Oh I didn't checkout ur branch. I will try again. |
Ok, seems to be solved with your fix on my Linux machine. |
GEPs can make vectors out of regular pointers if the offset is a vector. Fixes an assertion noticed in #28474.
GEPs can make vectors out of regular pointers if the offset is a vector. Fixes an assertion noticed in #28474.
I managed to narrow down the trigger of a memory leak happening using this branch of IterativeSolvers.jl https://github.com/mohamed82008/IterativeSolvers.jl/tree/memory_leak and the following code:
More specifically, the problem happens in this function call https://github.com/mohamed82008/IterativeSolvers.jl/blob/315d75e89703336038f8291f2223da1c24637c86/src/stationary.jl#L45; it's not going through the method it should.
Here is my versioninfo:
The problem is not there in v0.7.0-beta2.
The text was updated successfully, but these errors were encountered: