On 2018-05-19 12:02 +0200, Boris Jakubith wrote: > Package: mono-mcs > Version: 4.6.2.7+dfsg-1 > Severity: normal > > bj@rhiplox:~/src/Mono$ echo $TERM > xterm-256color > bj@rhiplox:~/src/Mono$ mcs > > 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.Exception: Magic number is wrong: 542 > at System.TermInfoReader.ReadHeader (System.Byte[] buffer, System.Int32& > position) [0x0002b] in <8f2c484307284b51944a1a13a14c0266>:0 > at System.TermInfoReader..ctor (System.String term, System.String filename) > [0x00065] in <8f2c484307284b51944a1a13a14c0266>:0 > at System.TermInfoDriver..ctor (System.String term) [0x00058] in > <8f2c484307284b51944a1a13a14c0266>:0 > at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] > in <8f2c484307284b51944a1a13a14c0266>:0 > at System.ConsoleDriver..cctor () [0x00062] in > <8f2c484307284b51944a1a13a14c0266>:0 > --- End of inner exception stack trace --- > at System.Console.SetupStreams (System.Text.Encoding inputEncoding, > System.Text.Encoding outputEncoding) [0x0000a] in > <8f2c484307284b51944a1a13a14c0266>:0 > at System.Console..cctor () [0x000a8] in > <8f2c484307284b51944a1a13a14c0266>:0 > --- End of inner exception stack trace --- > at Mono.CSharp.Driver.Main (System.String[] args) [0x00019] in > <9494102539fd45149c591ed0d231421b>: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.Exception: Magic > number is wrong: 542 > at System.TermInfoReader.ReadHeader (System.Byte[] buffer, System.Int32& > position) [0x0002b] in <8f2c484307284b51944a1a13a14c0266>:0 > at System.TermInfoReader..ctor (System.String term, System.String filename) > [0x00065] in <8f2c484307284b51944a1a13a14c0266>:0 > at System.TermInfoDriver..ctor (System.String term) [0x00058] in > <8f2c484307284b51944a1a13a14c0266>:0 > at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] > in <8f2c484307284b51944a1a13a14c0266>:0 > at System.ConsoleDriver..cctor () [0x00062] in > <8f2c484307284b51944a1a13a14c0266>:0 > --- End of inner exception stack trace --- > at System.Console.SetupStreams (System.Text.Encoding inputEncoding, > System.Text.Encoding outputEncoding) [0x0000a] in > <8f2c484307284b51944a1a13a14c0266>:0 > at System.Console..cctor () [0x000a8] in > <8f2c484307284b51944a1a13a14c0266>:0 > --- End of inner exception stack trace --- > at Mono.CSharp.Driver.Main (System.String[] args) [0x00019] in > <9494102539fd45149c591ed0d231421b>:0 > > Current (but ugly) solution: > > bj@rhiplox:~/src/Mono$ TERM=xterm mcs > error CS2008: No files to compile were specified > Compilation failed: 1 error(s), 0 warnings > > > The same applies to 'gacutil' (from the 'mono-gac' package) and other ones. I > couldn't identify the real culprit yet, but it seems it has to do with some of > the mono system/runtime libraries. > > Even a "hello world" program created with 'mcs' has the same problem. I think > this is not OK and a solution should be found on the long run.
It seems that System.TermInfoReader cannot handle the new terminfo format introduced in ncurses 6.1. Some links which might be useful: https://bugs.archlinux.org/task/57718 https://github.com/mono/mono/issues/6752 https://github.com/mono/mono/pull/6960 Disclaimer: I know zilch about Mono. Cheers, Sven

