Skip to content
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

Mono AOT compiler crashes with: condition `p - buf < buf_size' not met #112850

Open
rolfbjarne opened this issue Feb 24, 2025 · 0 comments
Open
Labels
area-Codegen-AOT-mono untriaged New issue has not been triaged by the area owner

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Feb 24, 2025

Description

Crash when AOT-compiling my code.

Reproduction Steps

Clone https://github.com/rolfbjarne/bug-repros and run ./2025-02-24-mono-aot-crash/repro.sh:

$ ./2025-02-24-mono-aot-crash/repro.sh
++ dirname ./2025-02-24-mono-aot-crash/repro.sh
+ cd ./2025-02-24-mono-aot-crash
+ /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.maccatalyst-arm64/9.0.0/Sdk/../tools/mono-aot-cross --path=./linked --aot=mtriple=arm64-apple-ios15.0-macabi,data-outfile=./monotouchtest.aotdata,static,asmonly,dedup-skip,direct-icalls,full,soft-debug,dwarfdebug,no-direct-calls,outfile=./monotouchtest.dll.s --debug -O=gsharedvt ./linked/monotouchtest.dll
Mono Ahead of Time compiler - compiling assembly [...]/bug-repros/2025-02-24-mono-aot-crash/linked/monotouchtest.dll
AOTID 1085CE5E-EB01-C3CC-909A-0C25AB930848
* Assertion at /Users/runner/work/1/s/src/mono/mono/mini/aot-compiler.c:8037, condition `p - buf < buf_size' not met

./2025-02-24-mono-aot-crash/repro.sh: line 9: 96539 Abort trap: 6           /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.maccatalyst-arm64/9.0.0/Sdk/../tools/mono-aot-cross --path=./linked --aot=mtriple=arm64-apple-ios15.0-macabi,data-outfile=./monotouchtest.aotdata,static,asmonly,dedup-skip,direct-icalls,full,soft-debug,dwarfdebug,no-direct-calls,outfile=./monotouchtest.dll.s --debug -O=gsharedvt ./linked/monotouchtest.dll

Note: you'll probably have to adjust the path to the mono-aot-cross binary in the script.

Expected behavior

No crash.

Actual behavior

Crash.

Crash report: https://github.com/rolfbjarne/bug-repros/blob/main/2025-02-24-mono-aot-crash/mono-aot-cross-2025-02-24-101943.txt

Regression?

No, this happened as I was adding code to a test project. Removing the new code fixes the crash.

Known Workarounds

No

Configuration

$ dotnet --info
.NET SDK:
 Version:           9.0.103
 Commit:            049799c39d
 Workload version:  9.0.101.2
 MSBuild version:   17.12.21+f7f4b086d

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  14.7
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/9.0.103/

.NET workloads installed:
 [macos]
   Installation Source: SDK 9.0.100
   Manifest Version:    15.2.9170/9.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.macos/15.2.9170/WorkloadManifest.json
   Install Type:        FileBased

 [maui-ios]
   Installation Source: SDK 9.0.100
   Manifest Version:    9.0.0/9.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.maui/9.0.0/WorkloadManifest.json
   Install Type:        FileBased

 [ios]
   Installation Source: SDK 9.0.100
   Manifest Version:    18.2.9170/9.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.ios/18.2.9170/WorkloadManifest.json
   Install Type:        FileBased

 [maccatalyst]
   Installation Source: SDK 9.0.100
   Manifest Version:    18.2.9170/9.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.maccatalyst/18.2.9170/WorkloadManifest.json
   Install Type:        FileBased

 [maui]
   Installation Source: SDK 9.0.100
   Manifest Version:    9.0.0/9.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.maui/9.0.0/WorkloadManifest.json
   Install Type:        FileBased

 [tvos]
   Installation Source: SDK 9.0.100
   Manifest Version:    18.2.9170/9.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.tvos/18.2.9170/WorkloadManifest.json
   Install Type:        FileBased

 [android]
   Installation Source: SDK 9.0.100
   Manifest Version:    35.0.24/9.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.android/35.0.24/WorkloadManifest.json
   Install Type:        FileBased

Configured to use workload sets when installing new manifests.

Host:
  Version:      9.0.1
  Architecture: arm64
  Commit:       c8acea2262

.NET SDKs installed:
  7.0.410 [/usr/local/share/dotnet/sdk]
  8.0.304 [/usr/local/share/dotnet/sdk]
  8.0.402 [/usr/local/share/dotnet/sdk]
  9.0.100 [/usr/local/share/dotnet/sdk]
  9.0.102 [/usr/local/share/dotnet/sdk]
  9.0.103 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.20 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0-rc.2.24474.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.36 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.20 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  /Users/rolf/work/dotnet/macios/main/macios/global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Other information

No response

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Feb 24, 2025
rolfbjarne added a commit to dotnet/macios that referenced this issue Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Codegen-AOT-mono untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

1 participant