System.Runtime.MemoryFailPoint on .Net 8 throw an unexpected incorrect parameter exception instead of InsufficientMemoryException
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- operating-systems
Research direction
Start with System.Runtime.MemoryFailPoint and the stack-traced MemFreeAfterAddress and CheckForFreeAddressSpace methods. Reproduce the supplied .NET 8 call with 250 MB and verify that the insufficient-memory path produces InsufficientMemoryException rather than an incorrect-parameter IOException; done means the reported behavior is corrected and the relevant behavior is covered by a regression test.
Written by the indexing model from the issue text.
Description
This issue has been moved from a ticket on Developer Community.
[severity:I'm unable to use this version]
We were using MemoryFailPoint in our .net framework application. Never have an issue with it.
We are now porting our app to .Net 8.
I feel that there is change within that class on how it work, because i don't get anymore the InsufficientMemoryException as expected.
It will throw the Incorrect parameter exception whether I put 200 or 2000 as memory to test.
This is how we call the function:
Try
Dim x1 As New System.Runtime.MemoryFailPoint(250)
Catch ex As InsufficientMemoryException
'Do stuff
End Try
This is the error I get:
System.IO.IOException: Paramètre incorrect.
at System.Runtime.MemoryFailPoint.MemFreeAfterAddress(Void* address, UInt64 size)
at System.Runtime.MemoryFailPoint.CheckForFreeAddressSpace(UInt64 size, Boolean shouldThrow)
at System.Runtime.MemoryFailPoint.. ctor(Int32 sizeInMegabytes)
So my questions:
First is there a patch for this in .Net 8 ?
Second, if not, am I suppose to catch the incorrect parameter Exception instead of the official one?
Thank for any help, and please forgive my english. :)
Original Comments
Feedback Bot on 30/07/2025, 08:09 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/runtime
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
area-System.Reflection blocking-clean-ci-optional Known Build Error os-mac-os-x untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area-CodeGen-coreclr untriaged
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
agentic-workflows untriaged
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
area-VM-meta-mono untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
Create parent directories only after the containment check in InstallHelper.TryExtractToDirectory Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PowerShell/PSResourceGet#2056 ·