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
{{ message }}
Repository navigation
NET 7: Calling GC.Collect() causes Access Violation exception (cx0000005) #79486
Calling GC.Collect() when having sufficiently large objects in LOH and using the Server Garbage Collection causes Access Violation exception (cx0000005) being thrown from coreclr.dll
CoreCLR Version: 7.0.22.51805
.NET Version: 7.0.0
Description: The process was terminated due to an unhandled exception.
Exception Info: exception code c0000005
We have seen this on Windows 10 Enterprise and on Windows Server 2016
Reproduction Steps
Code
open System
[<Struct>]
type T = {
A: DateTime
B: int
C: float
D: byte }
let data: T array = Array.zeroCreate 2_000_000_000
GC.Collect()
printfn "All OK"
I am failing to repro this issue on my machine. I am getting Out of Memory Errors vs. an Access Violation when I set the heap hard limit to control the amount of memory allowed in an effort to replicate the conditions. Could you please provide me the amount of memory the machine you are using has? Also, could you provide a memory dump for this issue, as well?
Thanks, @samme78! We are able to consistently repro this issue and are working on diagnosing the cause to work on a fix. We appreciate you reporting this issue!
Activity
deeprobin commentedon Dec 11, 2022
Cannot reproduce with Workstation-GC.
mrsharm commentedon Dec 12, 2022
Hi @nilekirk,
I am failing to repro this issue on my machine. I am getting Out of Memory Errors vs. an Access Violation when I set the heap hard limit to control the amount of memory allowed in an effort to replicate the conditions. Could you please provide me the amount of memory the machine you are using has? Also, could you provide a memory dump for this issue, as well?
Thanks in advance!
samme78 commentedon Dec 13, 2022
I can reproduce this, I get the same application error.
OS
Edition Windows 10 Pro
Version 21H2
Installed on 2021-09-22
OS build 19044.2251
Experience Windows Feature Experience Pack 120.2212.4180.0
Computer
Processor 11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz 2.61 GHz
Installed RAM 64,0 GB (63,2 GB usable)
System type 64-bit operating system, x64-based processor
Resolution
If I change the size to
1_000_000_000or change the order of B and C in the struct the program works as expected and prints the "All OK".mrsharm commentedon Dec 14, 2022
Thanks, @samme78! We are able to consistently repro this issue and are working on diagnosing the cause to work on a fix. We appreciate you reporting this issue!