-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Description
Steps to Reproduce
- Compile a C# project (in Visual Studio 2019) as Release on Windows using the following code:
using System;
using System.Threading;
class Program {
public static void Main() {
while(true) {
Console.WriteLine(0);
Thread.Sleep(1000);
}
}
}
- Use the command
mkbundle --simple test.exe -o test --cross mono-6.0.0-debian-9-x64in order to make the binary (I ran it on a Linux, Debian-based VM, wheretestworked) - Move the file to another
Debian 9 (x86_64)machine,chmod 777 testand./test
Current Behavior
As the title says, instantly System.Console exception.
Expected Behavior
Every second print 0, which is tested on both main machine (not bundled) and VM (bundled).
On which platforms did you notice this
[ ] macOS
[x] Linux
[ ] Windows
Version Used: 6.0.0.334
Stacktrace
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'System.Console' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.ConsoleDriver' threw an exception. ---> System.DllNotFoundException: /libmono-native.so
at (wrapper managed-to-native) Interop+Sys.Stat(byte&,Interop/Sys/FileStatus&)
at Interop+Sys.Stat (System.ReadOnlySpan`1[T] path, Interop+Sys+FileStatus& output) [0x00028] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath, Interop+ErrorInfo& errorInfo) [0x00000] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath) [0x00000] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.IO.Directory.Exists (System.String path) [0x0001e] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.TermInfoDriver.SearchTerminfo (System.String term) [0x00044] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.TermInfoDriver..ctor (System.String term) [0x0004b] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.ConsoleDriver..cctor () [0x0004d] in <81342d83acda4c5590ec19c7afdf26b9>:0
--- End of inner exception stack trace ---
at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x00007] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.Console..cctor () [0x0007d] in <81342d83acda4c5590ec19c7afdf26b9>:0
--- End of inner exception stack trace ---
at Program.Main () [0x00000] in <5445dbd54caf4275a77f456cef83295a>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'System.Console' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.ConsoleDriver' threw an exception. ---> System.DllNotFoundException: /libmono-native.so
at (wrapper managed-to-native) Interop+Sys.Stat(byte&,Interop/Sys/FileStatus&)
at Interop+Sys.Stat (System.ReadOnlySpan`1[T] path, Interop+Sys+FileStatus& output) [0x00028] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath, Interop+ErrorInfo& errorInfo) [0x00000] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath) [0x00000] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.IO.Directory.Exists (System.String path) [0x0001e] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.TermInfoDriver.SearchTerminfo (System.String term) [0x00044] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.TermInfoDriver..ctor (System.String term) [0x0004b] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.ConsoleDriver..cctor () [0x0004d] in <81342d83acda4c5590ec19c7afdf26b9>:0
--- End of inner exception stack trace ---
at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x00007] in <81342d83acda4c5590ec19c7afdf26b9>:0
at System.Console..cctor () [0x0007d] in <81342d83acda4c5590ec19c7afdf26b9>:0
--- End of inner exception stack trace ---
at Program.Main () [0x00000] in <5445dbd54caf4275a77f456cef83295a>:0
Additional
The machine where it shall work is a fresh-installed one, and I prefer to not download additional files in order to run the executable (isn't this the purpose of Mono?, cross-platform). I checked related issues, and I can assure that echo $TERM prints xterm. I'm beginner to Mono, this is my first time using it.
DeafMan1983 and nreinhardt