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

Bug with a test app #69

Open
DmitryJustDmitry opened this issue Jan 6, 2022 · 0 comments
Open

Bug with a test app #69

DmitryJustDmitry opened this issue Jan 6, 2022 · 0 comments

Comments

@DmitryJustDmitry
Copy link

Hi, stumled in something looks like a bug.

  1. Create simple app:
using System;
using Pose;
namespace HelloWorld
{
    class Hello {         
        static void Main(string[] args)
        {
             Shim dtShim = Shim.
                Replace(() => DateTime.Now).
                With(() => new DateTime(2004, 4, 4));
            PoseContext.Isolate(() => {Console.WriteLine(DateTime.Now);}, dtShim);
            System.Console.WriteLine("Fine!");
        }
    }
}
  1. And a simple project:
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
    <LangVersion>8.0</LangVersion> 
    <Nullable>enable</Nullable>
    <IsPackable>false</IsPackable>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Pose" Version="1.2.1" />
  </ItemGroup>
</Project>
  1. Trying to debug (Ubuntu 20.04, VS Code (latest), .net 6, built with dotnet build -a x64) - getting infinite stack message, ending like:

at DynamicClass.stub_System.SR_get_Arg_PlatformNotSupported(System.RuntimeMethodHandle, System.RuntimeTypeHandle)
at DynamicClass.dynamic_System.PlatformNotSupportedException_.ctor(System.PlatformNotSupportedException)
at DynamicClass.stub_ctor_System.PlatformNotSupportedException_.ctor(System.RuntimeMethodHandle, System.RuntimeTypeHandle)
at DynamicClass.dynamic_Internal.Runtime.CompilerServices.Unsafe_As(Char ByRef)
at DynamicClass.stub_Internal.Runtime.CompilerServices.Unsafe_As(Char ByRef, System.RuntimeMethodHandle, System.RuntimeTypeHandle)
at DynamicClass.dynamic_System.String_EqualsHelper(System.String, System.String)
at DynamicClass.stub_System.String_EqualsHelper(System.String, System.String, System.RuntimeMethodHandle, System.RuntimeTypeHandle)

at DynamicClass.stub_System.String_Equals(System.String, System.String, System.RuntimeMethodHandle, System.RuntimeTypeHandle)
at DynamicClass.stub_System.String_op_Equality(System.String, System.String, System.RuntimeMethodHandle, System.RuntimeTypeHandle)
at DynamicClass.dynamic_System.Resources.ResourceManager_GetFirstResourceSet(System.Resources.ResourceManager, System.Globalization.CultureInfo)
at DynamicClass.stub_System.Resources.ResourceManager_GetFirstResourceSet(System.Resources.ResourceManager, System.Globalization.CultureInfo, System.RuntimeMethodHandle, System.RuntimeTypeHandle)
at DynamicClass.dynamic_System.Resources.ResourceManager_GetString(System.Resources.ResourceManager, System.String, System.Globalization.CultureInfo)
at DynamicClass.stub_virt_System.Resources.ResourceManager_GetString(System.Resources.ResourceManager, System.String, System.Globalization.CultureInfo, System.RuntimeMethodHandle, System.RuntimeTypeHandle)
at DynamicClass.dynamic_System.SR_InternalGetResourceString(System.String)
at DynamicClass.stub_System.SR_InternalGetResourceString(System.String, System.RuntimeMethodHandle, System.RuntimeTypeHandle)
at DynamicClass.dynamic_System.SR_GetResourceString(System.String)
at DynamicClass.stub_System.SR_GetResourceString(System.String, System.RuntimeMethodHandle, System.RuntimeTypeHandle)

at DynamicClass.stub_System.SR_get_Arg_PlatformNotSupported(System.RuntimeMethodHandle, System.RuntimeTypeHandle)
at DynamicClass.dynamic_System.PlatformNotSupportedException_.ctor(System.PlatformNotSupportedException)
at DynamicClass.stub_ctor_System.PlatformNotSupportedException_.ctor(System.RuntimeMethodHandle, System.RuntimeTypeHandle)
at DynamicClass.dynamic_Internal.Runtime.CompilerServices.Unsafe_As(System.IO.TextWriter ByRef)
at DynamicClass.stub_Internal.Runtime.CompilerServices.Unsafe_As(System.IO.TextWriter ByRef, System.RuntimeMethodHandle, System.RuntimeTypeHandle)
at DynamicClass.dynamic_System.Threading.Volatile_Read(System.IO.TextWriter ByRef)
at DynamicClass.stub_System.Threading.Volatile_Read(System.IO.TextWriter ByRef, System.RuntimeMethodHandle, System.RuntimeTypeHandle)
at DynamicClass.dynamic_System.Console_get_Out()
at DynamicClass.stub_System.Console_get_Out(System.RuntimeMethodHandle, System.RuntimeTypeHandle)
at DynamicClass.dynamic_System.Console_WriteLine(System.Object)
at DynamicClass.stub_System.Console_WriteLine(System.Object, System.RuntimeMethodHandle, System.RuntimeTypeHandle)
at DynamicClass.dynamic_HelloWorld.Hello+<>c_

b__0_2(<>c)
at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Span`1<System.Object> ByRef, System.Signature, Boolean, Boolean)
at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
at System.Delegate.DynamicInvokeImpl(System.Object[])
at System.Delegate.DynamicInvoke(System.Object[])
at Pose.PoseContext.Isolate(System.Action, Pose.Shim[])
at HelloWorld.Hello.Main(System.String[])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant