dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.48k stars 4.77k forks source link

[Win11] [Bug] [ConcurrentBag regression in .Net 9] System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' #110355

Open drweb86 opened 6 days ago

drweb86 commented 6 days ago

ConcurrentBag is broken since .Net 9.

On heavy usage it fails with this error. It happens not every time but often. System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

Just before update it did not happen.

Unfortunately, i cannot find repro steps, because AccessViolationException even cannot be catched by application means.

Please introduce ConcurrentBag - from .Net 8 because uinstable work in .Net 9 breaks my app

drweb86 commented 6 days ago

The only workaround i found so far is to reduce performance or attach with debugger. Then crashes are not happening.

drweb86 commented 6 days ago

Image If to go through stack trace - System.Linq is third one, Ion double click on it VIsual Studio 2022 crashes (!).

ViktorHofer commented 1 day ago

@dotnet/area-system-collections

stephentoub commented 17 hours ago

It's very unlikely this is actually related to ConcurrentBag. It's more likely some code in your app is resulting in corruption that then appears as an AV in other code, in this case in CB. Without a repro or crash dump, though, we can't investigate.

drweb86 commented 13 hours ago

Ill try to create repro then

ср, 4 дек. 2024 г., 13:49 Stephen Toub @.***>:

It's very unlikely this is actually related to ConcurrentBag. It's more likely some code in your app is resulting in corruption that then appears as an AV in other code, in this case in CB. Without a repro or crash dump, though, we can't investigate.

— Reply to this email directly, view it on GitHub https://github.com/dotnet/runtime/issues/110355#issuecomment-2516941390, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABD6N3JMYBH22IJUFRXLKJ32D3M4PAVCNFSM6AAAAABS5ZL6IKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJWHE2DCMZZGA . You are receiving this because you authored the thread.Message ID: @.***>

dotnet-policy-service[bot] commented 4 hours ago

This issue has been marked needs-author-action and may be missing some important information.