IronLanguages / ironpython2

Implementation of the Python programming language for .NET Framework; built on top of the Dynamic Language Runtime (DLR).
http://ironpython.net
Apache License 2.0
1.08k stars 229 forks source link

System.TypeInitializationException IronPython2 #829

Open Ranbir-Sinha opened 1 year ago

Ranbir-Sinha commented 1 year ago

Prerequisites

The issue tracker is used to report bugs and request new features, NOT to ask questions.

Questions should be posted to the users mailing list which can be accessed at https://ironpython.groups.io/g/users.

Description

$ mono IronPython.2.7.12/net45/ipy.exe

Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.Scripting.Hosting.Configuration.Section' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.ComponentModel.TypeDescriptor' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: System.Native assembly: type: member:(null) at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag() at Interop+Sys..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at Interop.GetRandomBytes (System.Byte buffer, System.Int32 length) [0x00000] in :0 at System.Guid.NewGuid () [0x00000] in :0 at System.ComponentModel.TypeDescriptor..cctor () [0x00034] in :0 --- End of inner exception stack trace --- at System.Configuration.ConfigurationProperty..ctor (System.String name, System.Type type, System.Object defaultValue) [0x00000] in <040d151eff354af185a19bdffe022106>:0 at Microsoft.Scripting.Hosting.Configuration.Section..cctor () [0x0000f] in <6c73c743798547f998a008888ceecf5e>:0 --- End of inner exception stack trace --- at Microsoft.Scripting.Hosting.ScriptRuntimeSetup.LoadRuntimeSetupImpl (Microsoft.Scripting.Hosting.ScriptRuntimeSetup setup, System.IO.Stream configFileStream) [0x00000] in <6c73c743798547f998a008888ceecf5e>:0 at Microsoft.Scripting.Hosting.ScriptRuntimeSetup.LoadRuntimeSetup (Microsoft.Scripting.Hosting.ScriptRuntimeSetup setup, System.IO.Stream configFileStream) [0x00000] in <6c73c743798547f998a008888ceecf5e>:0 at Microsoft.Scripting.Hosting.ScriptRuntimeSetup.ReadConfiguration () [0x00005] in <6c73c743798547f998a008888ceecf5e>:0 at Microsoft.Scripting.Hosting.Shell.ConsoleHost.CreateRuntimeSetup () [0x00006] in :0 at PythonConsoleHost.CreateRuntimeSetup () [0x00000] in <38d0e7657a834c008b1272953edeadc5>:0 at Microsoft.Scripting.Hosting.Shell.ConsoleHost.Run (System.String[] args) [0x00000] in :0 at PythonConsoleHost.Main (System.String[] args) [0x00020] in <38d0e7657a834c008b1272953edeadc5>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'Microsoft.Scripting.Hosting.Configuration.Section' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.ComponentModel.TypeDescriptor' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: System.Native assembly: type: member:(null) at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag() at Interop+Sys..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at Interop.GetRandomBytes (System.Byte buffer, System.Int32 length) [0x00000] in :0 at System.Guid.NewGuid () [0x00000] in :0 at System.ComponentModel.TypeDescriptor..cctor () [0x00034] in :0 --- End of inner exception stack trace --- at System.Configuration.ConfigurationProperty..ctor (System.String name, System.Type type, System.Object defaultValue) [0x00000] in <040d151eff354af185a19bdffe022106>:0 at Microsoft.Scripting.Hosting.Configuration.Section..cctor () [0x0000f] in <6c73c743798547f998a008888ceecf5e>:0 --- End of inner exception stack trace --- at Microsoft.Scripting.Hosting.ScriptRuntimeSetup.LoadRuntimeSetupImpl (Microsoft.Scripting.Hosting.ScriptRuntimeSetup setup, System.IO.Stream configFileStream) [0x00000] in <6c73c743798547f998a008888ceecf5e>:0 at Microsoft.Scripting.Hosting.ScriptRuntimeSetup.LoadRuntimeSetup (Microsoft.Scripting.Hosting.ScriptRuntimeSetup setup, System.IO.Stream configFileStream) [0x00000] in <6c73c743798547f998a008888ceecf5e>:0 at Microsoft.Scripting.Hosting.ScriptRuntimeSetup.ReadConfiguration () [0x00005] in <6c73c743798547f998a008888ceecf5e>:0 at Microsoft.Scripting.Hosting.Shell.ConsoleHost.CreateRuntimeSetup () [0x00006] in :0 at PythonConsoleHost.CreateRuntimeSetup () [0x00000] in <38d0e7657a834c008b1272953edeadc5>:0 at Microsoft.Scripting.Hosting.Shell.ConsoleHost.Run (System.String[] args) [0x00000] in :0 at PythonConsoleHost.Main (System.String[] args) [0x00020] in <38d0e7657a834c008b1272953edeadc5>:0

Steps to Reproduce

  1. Download and unzip IronPython2 on RHEL8 system
  2. Install mono and dotnet on RHEL8
  3. mono IronPython.2.7.12/net45/ipy.exe

Expected behavior: IronPython Console shows up

Actual behavior: Crash observed

Versions

2.7.12

You can get this information from executing ipy -V.

slozier commented 1 year ago

What version of Mono are you using?