Skip to content

Updated type of heap_segment_survived from int to size_t to facilitate survival >= 2GB. #80302

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

Merged
merged 4 commits into from
Jan 9, 2023

Conversation

MokoSan
Copy link
Contributor

@MokoSan MokoSan commented Jan 6, 2023

Fixes #79486

For large survival, heap_segment_size returns a negative number and as a result for SVR, for cases such as the linked one, the arithmetic results in an overflow and causes an Access Violation in equalize_promoted_bytes().

Additionally, if the GCRegionSize exceeds 2 GB, a CLR_E_GC_BAD_REGION_SIZE error is returned from the GC.

@ghost ghost added area-GC-coreclr community-contribution Indicates that the PR has been added by a community member labels Jan 6, 2023
@ghost
Copy link

ghost commented Jan 6, 2023

Tagging subscribers to this area: @dotnet/gc
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #79486

Author: MokoSan
Assignees: -
Labels:

area-GC-coreclr

Milestone: -

@dnfadmin
Copy link

dnfadmin commented Jan 6, 2023

CLA assistant check
All CLA requirements met.

@mangod9
Copy link
Member

mangod9 commented Jan 6, 2023

perhaps not as part of this PR, but we should add a regression test for this scenario?

@mrsharm mrsharm removed the community-contribution Indicates that the PR has been added by a community member label Jan 8, 2023
@mrsharm mrsharm changed the title Updated type of heap_segment_survived from int to size_t to facilitate survival > 2GB. Updated type of heap_segment_survived from int to size_t to facilitate survival >= 2GB. Jan 9, 2023
@mrsharm mrsharm merged commit 7ea7f2e into dotnet:main Jan 9, 2023
@mrsharm
Copy link
Member

mrsharm commented Jan 9, 2023

/backport to release/7.0

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2023

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3876468106

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2023

@mrsharm an error occurred while backporting to release/7.0, please check the run log for details!

Error: @mrsharm is not a repo collaborator, backporting is not allowed. If you're a collaborator please make sure your dotnet team membership visibility is set to Public on https://github.com/orgs/dotnet/people?query=mrsharm

@mrsharm
Copy link
Member

mrsharm commented Jan 9, 2023

/backport to release/7.0

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2023

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3876532028

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2023

@mrsharm backporting to release/7.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Updated type of survived from int to size_t
Using index info to reconstruct a base tree...
M	src/coreclr/gc/gc.cpp
M	src/coreclr/gc/gcpriv.h
Falling back to patching base and 3-way merge...
Auto-merging src/coreclr/gc/gcpriv.h
Auto-merging src/coreclr/gc/gc.cpp
CONFLICT (content): Merge conflict in src/coreclr/gc/gc.cpp
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Updated type of survived from int to size_t
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2023

@mrsharm an error occurred while backporting to release/7.0, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

@mrsharm
Copy link
Member

mrsharm commented Jan 9, 2023

/backport to release/7.0

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2023

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3877694792

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2023

@mrsharm backporting to release/7.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Updated type of survived from int to size_t
Using index info to reconstruct a base tree...
M	src/coreclr/gc/gc.cpp
M	src/coreclr/gc/gcpriv.h
Falling back to patching base and 3-way merge...
Auto-merging src/coreclr/gc/gcpriv.h
Auto-merging src/coreclr/gc/gc.cpp
CONFLICT (content): Merge conflict in src/coreclr/gc/gc.cpp
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Updated type of survived from int to size_t
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2023

@mrsharm an error occurred while backporting to release/7.0, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NET 7: Calling GC.Collect() causes Access Violation exception (cx0000005)
5 participants