JuliaSIMD / JuliaSIMD/LoopVectorization.jl

Memory corruption

Open
#510 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
789
Forks
73
PR merge metrics
No merged PRs in 30d

Description

I am seeing some memory corruption in a function that I believe should be working. The code is:

```
using LoopVectorization

function At_mul_A!(C, A)
@turbo for n in indices((C, A), 2), m in indices((C, A), (1, 2))
Cmn = zero(eltype(C))
for k in indices(A, 1)
Cmn += A[k,m] * A[k,n]
end
C[m,n] = Cmn
end
end

function test()
A = randn(16, 64)
C = randn(64, 64)
for a = 1:1000
At_mul_A!(C, A)
end
end
test()
```

If I run this once, or sometimes a few times, I get the error:
```
julia(57934,0x1f15fe080) malloc: Incorrect checksum for freed object 0x12b391000: probably modified after being freed.
Corrupt value: 0x4037203caf449798
julia(57934,0x1f15fe080) malloc: *** set a breakpoint in malloc_error_break to debug
```
and julia crashes. I'm running Julia 1.10.0-beta2 and LoopVectorization v0.12.165.

I cannot see any reason that this shouldn't work - apologies if there is, but I really have looked it over several times, and run it without `@turbo` to check it's valid.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.