Skip to content

Commit

Permalink
Add reproducer
Browse files Browse the repository at this point in the history
1. Run `ExecutableProject`
2. Go to `Faulty` and change the string logged by `Console.WriteLine`

Expectation: Console outputs new string

Actual: Application dies with Unhandled exception. System.BadImageFormatException: An attempt was made to load a program with an incorrect format.
 (0x8007000B)
   at osu.Game.Overlays.Profile.Faulty.<>c.<Method>b__0_0(Model s)
   at osu.Game.Overlays.Profile.Faulty.Method()
   at Program.<Main>$(String[] args) in /Users/salman/Projects/osu/ExecutableProject/Program.cs:line 9
  • Loading branch information
frenzibyte committed Jul 27, 2024
1 parent 5651072 commit 5d56098
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ExecutableProject/ExecutableProject.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
</ItemGroup>

</Project>
11 changes: 11 additions & 0 deletions ExecutableProject/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// See https://aka.ms/new-console-template for more information

using osu.Game.Overlays.Profile;

Faulty faulty = new Faulty();

while (true)
{
faulty.Method();
Thread.Sleep(1000);
}
1 change: 1 addition & 0 deletions osu.Desktop.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"solution": {
"path": "osu.sln",
"projects": [
"ExecutableProject\\ExecutableProject.csproj",
"osu.Desktop\\osu.Desktop.csproj",
"osu.Game.Benchmarks\\osu.Game.Benchmarks.csproj",
"osu.Game.Rulesets.Catch.Tests\\osu.Game.Rulesets.Catch.Tests.csproj",
Expand Down
28 changes: 28 additions & 0 deletions osu.Game/Overlays/Profile/Header/Components/Faulty.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;

namespace osu.Game.Overlays.Profile
{
public class Faulty
{
public void Method()
{
Action<Model> action = s =>
{
s.Death();
Console.WriteLine("value: " + 3);
};

action(new Model());
}
}

public class Model
{
public void Death(bool? parameter = null)
{
}
}
}
14 changes: 14 additions & 0 deletions osu.sln
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Pippidon"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Pippidon.Tests", "Templates\Rulesets\ruleset-scrolling-example\osu.Game.Rulesets.Pippidon.Tests\osu.Game.Rulesets.Pippidon.Tests.csproj", "{1743BF7C-E6AE-4A06-BAD9-166D62894303}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExecutableProject", "ExecutableProject\ExecutableProject.csproj", "{D84DEE02-6A13-4F12-9DF7-DDD8F4616BE8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -537,6 +539,18 @@ Global
{1743BF7C-E6AE-4A06-BAD9-166D62894303}.Release|iPhone.Build.0 = Release|Any CPU
{1743BF7C-E6AE-4A06-BAD9-166D62894303}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{1743BF7C-E6AE-4A06-BAD9-166D62894303}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{D84DEE02-6A13-4F12-9DF7-DDD8F4616BE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D84DEE02-6A13-4F12-9DF7-DDD8F4616BE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D84DEE02-6A13-4F12-9DF7-DDD8F4616BE8}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{D84DEE02-6A13-4F12-9DF7-DDD8F4616BE8}.Debug|iPhone.Build.0 = Debug|Any CPU
{D84DEE02-6A13-4F12-9DF7-DDD8F4616BE8}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{D84DEE02-6A13-4F12-9DF7-DDD8F4616BE8}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{D84DEE02-6A13-4F12-9DF7-DDD8F4616BE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D84DEE02-6A13-4F12-9DF7-DDD8F4616BE8}.Release|Any CPU.Build.0 = Release|Any CPU
{D84DEE02-6A13-4F12-9DF7-DDD8F4616BE8}.Release|iPhone.ActiveCfg = Release|Any CPU
{D84DEE02-6A13-4F12-9DF7-DDD8F4616BE8}.Release|iPhone.Build.0 = Release|Any CPU
{D84DEE02-6A13-4F12-9DF7-DDD8F4616BE8}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{D84DEE02-6A13-4F12-9DF7-DDD8F4616BE8}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 5d56098

Please sign in to comment.