You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been observing the this crash for a while on macOS with Julia v1.3+, including nightly, in CI of LombScargle.jl. Today I've been able to create a smallish self-contained code to reproduce it:
using LinearAlgebra, Base.Threads
function_generalised_lombscargle!(P, freqs, times, y, w, Y, YY, T)
Threads.@threadsfor n ineachindex(freqs)
ω = freqs[n] *2*pi# Find τ for current angular frequency
C =zero(T)
S =zero(T)
CS =zero(T)
CC =zero(T)
for i ineachindex(times)
W = w[i]
s, c =sincos(ω * times[i])
CS += W*c*s
CC += W*c*c
C += W*c
S += W*s
end
CS -= C*S
SS =1- CC - S*S
CC -= C*C
ωτ =atan(2CS, CC - SS) /2# Now we can compute the power
YC_τ =zero(T)
YS_τ =zero(T)
CC_τ =zero(T)
for i ineachindex(times)
W = w[i]
s, c =sincos(ω*times[i] - ωτ)
YC_τ += W*y[i]*c
YS_τ += W*y[i]*s
CC_τ += W*c*c
end# "C_τ" and "S_τ" are computed following equation (7) of Press &# Rybicki, this formula simply comes from angle difference trigonometric# identities.
sin_ωτ, cos_ωτ =sincos(ωτ)
C_τ = C*cos_ωτ + S*sin_ωτ
S_τ = S*cos_ωτ - C*sin_ωτ
YC_τ -= Y*C_τ
YS_τ -= Y*S_τ
SS_τ =1- CC_τ - S_τ*S_τ
CC_τ -= C_τ*C_τ
P[n] = (abs2(YC_τ)/CC_τ +abs2(YS_τ)/SS_τ)/YY
endreturn P
end
times =1:11
signal =big.(sin.(times))
w =fill!(similar(signal), one(eltype(signal))) /length(signal)
frequencies =0.01:0.02:2.75
T =eltype(signal)
P =Vector{T}(undef, length(frequencies))
y = signal .- w ⋅ signal
Y = w ⋅ y
YY = w ⋅ (y .^2) - Y * Y
_generalised_lombscargle!(P, frequencies, times, y, w, Y, YY, T)
When I run it on macOS with 2+ threads I get
julia(1539,0x700001a0e000) malloc: *** error for object 0x7f8eebd00520: pointer being realloc'd was not allocated
julia(1539,0x700001a0e000) malloc: *** set a breakpoint in malloc_error_break to debug
signal (6): Abort trap: 6
in expression starting at /Users/mose/foo.jl:59
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 1718565 (Pool: 1718182; Big: 383); GC: 2
Abort trap: 6
My understanding is that the nested for loops are the problem, when I comment them the code doesn't crash. I may be doing something silly, I wrote this code more than 2 years ago, but it has been working since then. It doesn't crash with Julia v1.2- nor any other operating system nor when using a single thread.
The text was updated successfully, but these errors were encountered:
Can confirm this happens on my macs. Sometimes with a longer error message:
julia> _generalised_lombscargle!(P, frequencies, times, y, w, Y, YY, T)
julia(7335,0x7000103a5000) malloc: *** error for object 0x7f9fe130b8a0: pointer being realloc'd was not allocated
*** set a breakpoint in malloc_error_break to debug
julia(7335,0x7fff9bc69380) malloc: *** error for object 0x7f9fdbd01e60: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
signal (6): Abort trap: 6
signal (6): Abort trap: 6
n expression starting at REPL[20]:1
in expression starting at REPL[20]:1
julia(7335,0x700011bae000) malloc: *** error for object 0x7f9fe132bee0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
julia(7335,0x7000103a5000) malloc: *** error for object 0x7f9fe132bad8: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Allocations: 16516003 (Poolllocations: 16516003 (Pool: 16511892; Big: 4111); GC: 20
in expression starting at REPL[20]:1
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 16516003 (Pool: 16511892; Big: 4111); GC: 20
Abort trap: 6
I've been observing the this crash for a while on macOS with Julia v1.3+, including nightly, in CI of
LombScargle.jl
. Today I've been able to create a smallish self-contained code to reproduce it:When I run it on macOS with 2+ threads I get
My understanding is that the nested
for
loops are the problem, when I comment them the code doesn't crash. I may be doing something silly, I wrote this code more than 2 years ago, but it has been working since then. It doesn't crash with Julia v1.2- nor any other operating system nor when using a single thread.The text was updated successfully, but these errors were encountered: