Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

StackOverflowException #5435

Closed
Scellow opened this issue Feb 23, 2018 · 6 comments
Closed

StackOverflowException #5435

Scellow opened this issue Feb 23, 2018 · 6 comments

Comments

@Scellow
Copy link

Scellow commented Feb 23, 2018

Hello

This is what i'm getting when i try to compile using this library: https://github.com/tlgkccampbell/ultraviolet

  <ItemGroup>
    <Reference Include="Ultraviolet, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.dll</HintPath>
    </Reference>
    <Reference Include="Ultraviolet.BASS, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.BASS.dll</HintPath>
    </Reference>
    <Reference Include="Ultraviolet.Core, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.Core.dll</HintPath>
    </Reference>
    <Reference Include="Ultraviolet.Design, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.Design.dll</HintPath>
    </Reference>
    <Reference Include="Ultraviolet.OpenGL, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.OpenGL.dll</HintPath>
    </Reference>
    <Reference Include="Ultraviolet.OpenGL.Bindings, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.OpenGL.Bindings.dll</HintPath>
    </Reference>
    <Reference Include="Ultraviolet.SDL2, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.SDL2.dll</HintPath>
    </Reference>
    <Reference Include="Ultraviolet.Shims.NETCore, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.Shims.NETCore.dll</HintPath>
    </Reference>
  </ItemGroup>
C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Server>dotnet publish -r win-x64 -c debug
Microsoft (R) Build Engine version 15.5.180.51428 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restoring packages for C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj...
  Restoring packages for C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Server\Realm.Server.csproj...
  Restore completed in 256.39 ms for C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj.
  Restore completed in 954.76 ms for C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Server\Realm.Server.csproj.
C:\Program Files\dotnet\sdk\2.1.4\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.IO.FileSystem" that could not be resolved.  These reference conflicts are listed in the build log when log
verbosity is set to detailed. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
C:\Program Files\dotnet\sdk\2.1.4\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Xml.XDocument" that could not be resolved.  These reference conflicts are listed in the build log when log
verbosity is set to detailed. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
C:\Program Files\dotnet\sdk\2.1.4\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Drawing.Primitives" that could not be resolved.  These reference conflicts are listed in the build log when
 log verbosity is set to detailed. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
C:\Program Files\dotnet\sdk\2.1.4\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Threading" that could not be resolved.  These reference conflicts are listed in the build log when log verb
osity is set to detailed. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
C:\Program Files\dotnet\sdk\2.1.4\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Diagnostics.Debug" that could not be resolved.  These reference conflicts are listed in the build log when
log verbosity is set to detailed. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
C:\Program Files\dotnet\sdk\2.1.4\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Console" that could not be resolved.  These reference conflicts are listed in the build log when log verbos
ity is set to detailed. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
C:\Program Files\dotnet\sdk\2.1.4\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Threading.Thread" that could not be resolved.  These reference conflicts are listed in the build log when l
og verbosity is set to detailed. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
C:\Program Files\dotnet\sdk\2.1.4\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Runtime" that could not be resolved.  These reference conflicts are listed in the build log when log verbos
ity is set to detailed. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
C:\Program Files\dotnet\sdk\2.1.4\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Runtime.Extensions" that could not be resolved.  These reference conflicts are listed in the build log when
 log verbosity is set to detailed. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
C:\Program Files\dotnet\sdk\2.1.4\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Runtime.InteropServices" that could not be resolved.  These reference conflicts are listed in the build log
 when log verbosity is set to detailed. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
C:\Program Files\dotnet\sdk\2.1.4\Microsoft.Common.CurrentVersion.targets(2041,5): warning MSB3277: Found conflicts between different versions of "System.Linq" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity
 is set to detailed. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
2D\TextureRegion.cs(8,19): warning CS0660: 'TexCoordinate' defines operator == or operator != but does not override Object.Equals(object o) [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
2D\TextureRegion.cs(8,19): warning CS0661: 'TexCoordinate' defines operator == or operator != but does not override Object.GetHashCode() [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
2D\TextureRegion.cs(61,18): warning CS0660: 'TextureRegion' defines operator == or operator != but does not override Object.Equals(object o) [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
2D\TextureRegion.cs(61,18): warning CS0661: 'TextureRegion' defines operator == or operator != but does not override Object.GetHashCode() [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Widgets\Button.cs(239,21): warning CS0108: 'Button.toggle()' hides inherited member 'Element.toggle()'. Use the new keyword if hiding was intended. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Widgets\CheckBox.cs(70,28): warning CS0109: The member 'CheckBox.getStyle()' does not hide an accessible member. The new keyword is not required. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Widgets\Dialog.cs(127,15): warning CS0108: 'Dialog.hide()' hides inherited member 'Element.hide()'. Use the new keyword if hiding was intended. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Widgets\SelectBoxList.cs(101,15): warning CS0108: 'SelectBoxList<T>.hide()' hides inherited member 'Element.hide()'. Use the new keyword if hiding was intended. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
3D\Model3D.cs(236,30): warning CS0168: The variable 'e' is declared but never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Widgets\TextField.cs(266,17): warning CS0164: This label has not been referenced [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Widgets\TextField.cs(269,21): warning CS0164: This label has not been referenced [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Skin.cs(156,30): warning CS0168: The variable 'ex' is declared but never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Skin.cs(181,30): warning CS0168: The variable 'ignored' is declared but never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Widgets\ListViews\ListView.cs(38,32): warning CS0067: The event 'ListView<T>.onChanged' is never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Widgets\PopupMenu.cs(75,19): warning CS0169: The field 'MenuItem.containerMenu' is never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Widgets\CheckBox.cs(21,16): warning CS0649: Field 'CheckBox._isDisabled' is never assigned to, and will always have its default value false [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Widgets\PopupMenu.cs(57,40): warning CS0067: The event 'PopupMenu.OnActiveItemChanged' is never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
Sys\Camera2D.cs(11,23): warning CS0169: The field 'Camera2D._minimum_zoom' is never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Stage.cs(33,19): warning CS0169: The field 'Stage._mouseOverActor' is never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Widgets\PopupMenu.cs(72,27): warning CS0169: The field 'MenuItem.subMenu' is never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Stage.cs(27,19): warning CS0169: The field 'Stage._lastMousePosition' is never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Containers\Table.cs(108,16): warning CS0169: The field 'Table._skin' is never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Widgets\ListViews\AbstractListAdapter.cs(34,38): warning CS0169: The field 'AbstractListAdapter<ItemT, ViewT>.onClick' is never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
Sys\Camera2D.cs(10,23): warning CS0414: The field 'Camera2D._maximum_zoom' is assigned but its value is never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
Input.cs(39,24): warning CS0414: The field 'Input._justTouched' is assigned but its value is never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
UI\Widgets\PopupMenu.cs(65,22): warning CS0414: The field 'MenuItem.generateDisabledImage' is assigned but its value is never used [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\Realm.Engine.csproj]
  Realm.Engine -> C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Engine\bin\debug\netstandard2.0\Realm.Engine.dll
  Realm.Server -> C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Server\bin\debug\netcoreapp2.0\win-x64\Realm.Server.dll
  Generating native code
EXEC : warning : Method `[Ultraviolet.SDL2]Ultraviolet.SDL2.SDL2UltravioletContext..ctor(IUltravioletHost,UltravioletConfiguration)` will always throw because: [TEMPORARY EXCEPTION MESSAGE] MissingMethod: IntPtr System.Runtime.InteropServices.Marshal.GetFunctio
nPointerForDelegate(!!0) [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Server\Realm.Server.csproj]

  Process is terminating due to StackOverflowException.
C:\Users\Scellow\.nuget\packages\microsoft.dotnet.ilcompiler\1.0.0-alpha-26223-01\build\Microsoft.NETCore.Native.targets(171,5): error MSB3073: The command ""C:\Users\Scellow\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\1.0.0-alpha-26223-01\tools
\ilc" @"obj\debug\netcoreapp2.0\win-x64\native\Realm.Server.ilc.rsp"" exited with code -1073741571. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Server\Realm.Server.csproj]

Here is the log (-v diag) 20mb!

log.txt

                   Task "Exec" (TaskId:172)
                     Task Parameter:Command="C:\Users\Scellow\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\1.0.0-alpha-26223-01\tools\ilc" @"obj\debug\netcoreapp2.0\win-x64\native\Realm.Server.ilc.rsp" (TaskId:172)
                     "C:\Users\Scellow\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\1.0.0-alpha-26223-01\tools\ilc" @"obj\debug\netcoreapp2.0\win-x64\native\Realm.Server.ilc.rsp" (TaskId:172)
08:59:33.733  1:10>EXEC : warning : Method `[Ultraviolet.SDL2]Ultraviolet.SDL2.SDL2UltravioletContext..ctor(IUltravioletHost,UltravioletConfiguration)` will always throw because: [TEMPORARY EXCEPTION MESSAGE] MissingMethod: IntPtr System.Runtime.InteropServices
.Marshal.GetFunctionPointerForDelegate(!!0) [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Server\Realm.Server.csproj]
                      (TaskId:172)
                     Process is terminating due to StackOverflowException. (TaskId:172)
08:59:45.459  1:10>C:\Users\Scellow\.nuget\packages\microsoft.dotnet.ilcompiler\1.0.0-alpha-26223-01\build\Microsoft.NETCore.Native.targets(171,5): error MSB3073: The command ""C:\Users\Scellow\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\1.0.0-a
lpha-26223-01\tools\ilc" @"obj\debug\netcoreapp2.0\win-x64\native\Realm.Server.ilc.rsp"" exited with code -1073741571. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Server\Realm.Server.csproj]
                   Done executing task "Exec" -- FAILED. (TaskId:172)
@Scellow
Copy link
Author

Scellow commented Feb 23, 2018

Using minimal code:

csproj:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <PlatformTarget>x64</PlatformTarget>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-*" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="Ultraviolet, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.dll</HintPath>
    </Reference>
    <Reference Include="Ultraviolet.BASS, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.BASS.dll</HintPath>
    </Reference>
    <Reference Include="Ultraviolet.Core, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.Core.dll</HintPath>
    </Reference>
    <Reference Include="Ultraviolet.Design, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.Design.dll</HintPath>
    </Reference>
    <Reference Include="Ultraviolet.OpenGL, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.OpenGL.dll</HintPath>
    </Reference>
    <Reference Include="Ultraviolet.OpenGL.Bindings, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.OpenGL.Bindings.dll</HintPath>
    </Reference>
    <Reference Include="Ultraviolet.SDL2, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.SDL2.dll</HintPath>
    </Reference>
    <Reference Include="Ultraviolet.Shims.NETCore, Version=2017.12.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\dep\uv_netcore\uv\Ultraviolet.Shims.NETCore.dll</HintPath>
    </Reference>
  </ItemGroup>
</Project>
using Ultraviolet;
using Ultraviolet.OpenGL;

namespace Realm.Server
{
    class Program
    {
        static void Main(string[] args)
        {
            using (var app = new App())
            {
                app.Run();
            }
        }
    }

    public class App : UltravioletApplication
    {
        public App() : base("Test", "Test")
        {
        }

        protected override UltravioletContext OnCreatingUltravioletContext()
        {
            var config = new OpenGLUltravioletConfiguration();

            PopulateConfiguration(config);

            return new OpenGLUltravioletContext(this, config);
        }

        protected override void OnDrawing(UltravioletTime time)
        {
            base.OnDrawing(time);
            Ultraviolet.GetGraphics().Clear(Color.Black);
        }
    }
}
C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Server>dotnet publish -r win-x64 -c debug
Microsoft (R) Build Engine version 15.5.180.51428 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restoring packages for C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Server\Realm.Server.csproj...
  Restore completed in 411.88 ms for C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Server\Realm.Server.csproj.
  Realm.Server -> C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Server\bin\debug\netcoreapp2.0\win-x64\Realm.Server.dll
  Generating native code
EXEC : warning : Method `[Ultraviolet.SDL2]Ultraviolet.SDL2.SDL2UltravioletContext..ctor(IUltravioletHost,UltravioletConfiguration)` will always throw because: [TEMPORARY EXCEPTION MESSAGE] MissingMethod: IntPtr System.Runtime.InteropServices.Marshal.GetFunctio
nPointerForDelegate(!!0) [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Server\Realm.Server.csproj]
  
  Process is terminating due to StackOverflowException.
C:\Users\Scellow\.nuget\packages\microsoft.dotnet.ilcompiler\1.0.0-alpha-26223-01\build\Microsoft.NETCore.Native.targets(171,5): error MSB3073: The command ""C:\Users\Scellow\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\1.0.0-alpha-26223-01\tools
\ilc" @"obj\debug\netcoreapp2.0\win-x64\native\Realm.Server.ilc.rsp"" exited with code -1073741571. [C:\Users\Scellow\dev\rpgpvp\RPGPVP\Realm.Server\Realm.Server.csproj]

log.txt

@jkotas
Copy link
Member

jkotas commented Feb 24, 2018

The StackOverflow exception should be fixed by #5440. The package with the fix should be available on myget in a few hours.

I was not able to reproduce the missing System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate method exception, and I am not sure what can be causing it.

@jkotas
Copy link
Member

jkotas commented Feb 24, 2018

When I have run the binary, here are the issues that it hit:

  • CoreRT does not do probing for different flavors of PInvoke entrypoints. Fixed by changing LoadLibrary to explicitly specify right entrypoint:
[DllImport("kernel32", SetLastError = true, EntryPoint = "LoadLibraryW", CharSet = CharSet.Unicode)]
public static extern IntPtr LoadLibrary(String fileName);
  • The assemblies in single file binaries do not have location. Fixed it by using AppDomain.BaseDirectory instead:
Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
  • Then it started hitting types loaded via reflection. Added rdxml file with list of types activated via reflection, but then got stuck because of it was not clear what is actually missing.

@jkotas
Copy link
Member

jkotas commented Feb 24, 2018

Let us know if you are able to compile Ultraviolet games using CoreRT successfully! Thank for giving it a try.

@jkotas
Copy link
Member

jkotas commented Feb 24, 2018

The stackoverflow that this issue is about should be fixed now.

@jkotas jkotas closed this as completed Feb 24, 2018
@Scellow
Copy link
Author

Scellow commented Feb 28, 2018

Thanks a lot :D

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

No branches or pull requests

2 participants