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

correctly track freed bytes in jl_genericmemory_to_string #54331

Merged
merged 4 commits into from May 6, 2024

Conversation

d-netto
Copy link
Member

@d-netto d-netto commented May 2, 2024

Master version of #54309.

Should fix #54275.

@d-netto d-netto added domain:arrays [a, r, r, a, y, s] GC Garbage collector labels May 2, 2024
src/genericmemory.c Outdated Show resolved Hide resolved
@vtjnash vtjnash added the backport 1.11 Change should be backported to release-1.11 label May 4, 2024
@vtjnash
Copy link
Sponsor Member

vtjnash commented May 4, 2024

Ended up making some more major changes here in reviewing this, as it turns out we appear to have also been undercounting the scanned_bytes value and not including the amount of memory that could get returned by dropping an unsafe_wrap Array which was created with own=true. But most cases looked like they were actually computing the value correctly already, only specifically the case where it was a jl_gc_track_malloced_genericmemory object would we lose track of the nbytes.

@d-netto
Copy link
Member Author

d-netto commented May 6, 2024

Merge?

@oscardssmith
Copy link
Member

Some tests would be good, but otherwise lgtm.

@d-netto d-netto merged commit 92ccc74 into master May 6, 2024
7 checks passed
@d-netto d-netto deleted the dcn-fix-54275-on-master branch May 6, 2024 00:36
@d-netto
Copy link
Member Author

d-netto commented May 6, 2024

Followed up in #54371. (Sorry, the test should have been added in this PR).

d-netto added a commit that referenced this pull request May 6, 2024
KristofferC pushed a commit that referenced this pull request May 6, 2024
Master version of #54309.

Should fix #54275.

---------

Co-authored-by: Jameson Nash <vtjnash@gmail.com>
(cherry picked from commit 92ccc74)
@KristofferC KristofferC mentioned this pull request May 6, 2024
57 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.11 Change should be backported to release-1.11 domain:arrays [a, r, r, a, y, s] GC Garbage collector
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible bug when constructing a string from an array of characters
3 participants