Bug 1080430

Summary: Mono console applications don't work with the update to terminfo 6.1
Product: [openSUSE] openSUSE Tumbleweed Reporter: Andreas Schneider <asn>
Component: MonoAssignee: E-mail List <bnc-team-mono>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Andreas Schneider 2018-02-10 09:38:02 UTC
Since the update of terminfo to 6.1, running console applications with mono doens't work anymore:

-----------------------------------------------------
mono UnSIN.exe 

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) [0x00028] in <8f8a76535f644930b25f735cdc17065c>:0 
  at System.TermInfoReader..ctor (System.String term, System.String filename) [0x0005f] in <8f8a76535f644930b25f735cdc17065c>:0 
  at System.TermInfoDriver..ctor (System.String term) [0x00055] in <8f8a76535f644930b25f735cdc17065c>:0 
  at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <8f8a76535f644930b25f735cdc17065c>:0 
  at System.ConsoleDriver..cctor () [0x0004d] in <8f8a76535f644930b25f735cdc17065c>:0 
   --- End of inner exception stack trace ---
  at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x00007] in <8f8a76535f644930b25f735cdc17065c>:0 
  at System.Console..cctor () [0x0008e] in <8f8a76535f644930b25f735cdc17065c>:0 
   --- End of inner exception stack trace ---
  at UnSIN.Program.Main (System.String[] args) [0x00006] in <7c4247c4deca4ba5a7657dbbe6ac76e0>: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) [0x00028] in <8f8a76535f644930b25f735cdc17065c>:0 
  at System.TermInfoReader..ctor (System.String term, System.String filename) [0x0005f] in <8f8a76535f644930b25f735cdc17065c>:0 
  at System.TermInfoDriver..ctor (System.String term) [0x00055] in <8f8a76535f644930b25f735cdc17065c>:0 
  at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <8f8a76535f644930b25f735cdc17065c>:0 
  at System.ConsoleDriver..cctor () [0x0004d] in <8f8a76535f644930b25f735cdc17065c>:0 
   --- End of inner exception stack trace ---
  at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x00007] in <8f8a76535f644930b25f735cdc17065c>:0 
  at System.Console..cctor () [0x0008e] in <8f8a76535f644930b25f735cdc17065c>:0 
   --- End of inner exception stack trace ---
  at UnSIN.Program.Main (System.String[] args) [0x00006] in <7c4247c4deca4ba5a7657dbbe6ac76e0>:0
-----------------------------------------------------

My TERM is set to screen-256color, changing it to xterm fixed it.

-----------------------------------------------------
TERM=xterm mono UnSIN.exe 
ERROR: Invalid parameters!
-----------------------------------------------------

libslang2 seems to have had a similar issue see:

https://build.opensuse.org/request/show/574532
Comment 1 Andreas Schneider 2020-08-25 09:30:22 UTC
Seems to be working again ...