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

fix memory corruption in deleteat! #41646

Merged
merged 1 commit into from
Jul 21, 2021
Merged

fix memory corruption in deleteat! #41646

merged 1 commit into from
Jul 21, 2021

Conversation

vtjnash
Copy link
Sponsor Member

@vtjnash vtjnash commented Jul 20, 2021

n.b. n == a->nrows + dec, so we overwrote dec bytes of unrelated memory here

Fixes JuliaData/DataFrames.jl#2819

Hard to test for memory corruption mechanically, but we can trigger the failure via:

julia> a = Vector{Union{Bool,Missing}}(missing, 10^4);                                                                                                                                                   
julia> deleteat!(a, 2:(length(a) - 5));                                                                                                                                                                  
julia> a                                                                                                                                                                                                 
corrupted double-linked list                                                                                                                                                                             

@vchuravy vchuravy added backport 1.6 Change should be backported to release-1.6 backport 1.7 bugfix This change fixes an existing bug labels Jul 20, 2021
@vtjnash vtjnash merged commit 2e06a01 into master Jul 21, 2021
@vtjnash vtjnash deleted the jn/deleteat-corruption branch July 21, 2021 16:15
@bkamins
Copy link
Member

bkamins commented Jul 21, 2021

I confirm that with this patch all works correctly. I understand that this will get backported to 1.6 (if there is any new release) and 1.7, as in DataFrames.jl I assumed that the work-around for this bug is only needed for Julia 1.6.2 or earlier.

Thank you!

KristofferC pushed a commit that referenced this pull request Jul 26, 2021
n.b. `n == a->nrows + dec`

Fixes JuliaData/DataFrames.jl#2819

(cherry picked from commit 2e06a01)
KristofferC pushed a commit that referenced this pull request Jul 26, 2021
n.b. `n == a->nrows + dec`

Fixes JuliaData/DataFrames.jl#2819

(cherry picked from commit 2e06a01)
@KristofferC KristofferC mentioned this pull request Jul 26, 2021
75 tasks
KristofferC pushed a commit that referenced this pull request Aug 31, 2021
n.b. `n == a->nrows + dec`

Fixes JuliaData/DataFrames.jl#2819

(cherry picked from commit 2e06a01)
KristofferC pushed a commit that referenced this pull request Sep 3, 2021
n.b. `n == a->nrows + dec`

Fixes JuliaData/DataFrames.jl#2819

(cherry picked from commit 2e06a01)
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Sep 7, 2021
staticfloat pushed a commit that referenced this pull request Dec 23, 2022
n.b. `n == a->nrows + dec`

Fixes JuliaData/DataFrames.jl#2819

(cherry picked from commit 2e06a01)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dropmissing! creates weird memory bugs/errors on 1.7 and 1.6
4 participants