Skip to content

AccessViolationException in DriveInfo.GetDrives on macOS Tahoe 26.5.1 on .NET 10 #129290

@ppekrol

Description

@ppekrol

Description

On latest macOS Tahoe 26.5.1 we are seeing each time:

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.Runtime.InteropServices.Marshal.PtrToStringUTF8(IntPtr)
   at Interop+Sys.AddMountPoint(Void*, Byte*)
   at Interop+Sys.GetAllMountPoints()
   at System.IO.DriveInfo.GetDrives()
   at Raven.Server.Web.Studio.FolderPath.GetAvailableDrives()

It looks like issue got fixed already in .NET 11 long time ago, but never got to .NET 10 #122637 (I checked here: https://github.com/dotnet/runtime/blob/release/10.0/src/native/libs/System.Native/pal_mount.c)

Could this be ported to .NET 10?

Reproduction Steps

execute DriveInfo.GetDrives() on macOS Tahoe in parallel

Expected behavior

Should not throw and return proper results

Actual behavior

throws AVE

Regression?

No response

Known Workarounds

Adding static lock around the method ravendb/ravendb#22897 helps

Configuration

.NET 10.0.8
macOS Tahoe 26.5.1 on M5 chip

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions