[Mono-bugs] [Bug 649543] New: ConsoleDriver.TtySetup() fails if mono is started from Process.Start()

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Oct 27 08:13:53 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=649543

https://bugzilla.novell.com/show_bug.cgi?id=649543#c0


           Summary: ConsoleDriver.TtySetup() fails if mono is started from
                    Process.Start()
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.8.x
          Platform: x86
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: fragmer at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.11)
Gecko/20101012 Firefox/3.6.11

ConsoleDriver.TtySetup(), called from TermInfoDriver.Init(), fails if mono was
started with Process.Start(). This method is invoked by many of Console's
properties, such as BackgroundColor, ForegroundColor, and Title.

The attached test case simply sets Console.Title and Console.BackgroundColor,
then prints a line of text. It runs normally when started directly. However, it
fails (at ConsoleDriver.TtySetup()) if Mono was started with Process.Start()
from another assembly. This is reproducible regardless of UseShellExecute
parameter.

Similar test case for .NET (with FileName="mono" replaced with executable's
actual name) produces expected behavior.

Reproducible: Always

Steps to Reproduce:
root at li222-193:~# cat ConsoleTest.cs
using System;
class Program {
    static void Main( string[] args ) {
        Console.Title = "Foo";
        Console.BackgroundColor = ConsoleColor.Red;
        Console.WriteLine( "ConsoleTest" );
    }
}

root at li222-193:~# gmcs ConsoleTest.cs
root at li222-193:~# mono ConsoleTest.exe
ConsoleTest
root at li222-193:~# cat ConsoleTestLauncher.cs
using System;
using System.Diagnostics;
class Program {
    static void Main( string[] args ) {
        Process.Start( new ProcessStartInfo {
            FileName = "mono",
            Arguments = "ConsoleTest.exe",
            UseShellExecute = false
        } );
    }
}

root at li222-193:~# gmcs ConsoleTestLauncher.cs
root at li222-193:~# mono ConsoleTestLauncher.exe
root at li222-193:~#
Unhandled Exception: System.IO.IOException: Error initializing terminal.
  at System.TermInfoDriver.Init () [0x00000] in <filename unknown>:0
  at System.TermInfoDriver.set_Title (System.String value) [0x00000] in
<filename unknown>:0
  at System.ConsoleDriver.set_Title (System.String value) [0x00000] in
<filename unknown>:0
  at System.Console.set_Title (System.String value) [0x00000] in <filename
unknown>:0
  at Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

root at li222-193:~# cat ConsoleTestLauncherShell.cs
using System;
using System.Diagnostics;
class Program {
    static void Main( string[] args ) {
        Process.Start( new ProcessStartInfo {
            FileName = "mono",
            Arguments = "ConsoleTest.exe",
            UseShellExecute = true
        } );
    }
}

root at li222-193:~# gmcs ConsoleTestLauncherShell.cs
root at li222-193:~# mono ConsoleTestLauncherShell.exe
root at li222-193:~#
Unhandled Exception: System.IO.IOException: Error initializing terminal.
  at System.TermInfoDriver.Init () [0x00000] in <filename unknown>:0
  at System.TermInfoDriver.set_Title (System.String value) [0x00000] in
<filename unknown>:0
  at System.ConsoleDriver.set_Title (System.String value) [0x00000] in
<filename unknown>:0
  at System.Console.set_Title (System.String value) [0x00000] in <filename
unknown>:0
  at Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

Actual Results:  
Console's properties are unusable.

Expected Results:  
Console's properties work normally.

Using mono 2.8 (compiled from source), fresh Ubuntu 10.04.1 LTS, bash shell,
running as root. Detailed mono information below:

Mono JIT compiler version 2.8 (tarball Wed Oct 27 09:22:27 UTC 2010)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  x86
        Disabled:      none
        Misc:          debugger softdebug
        LLVM:          supported, not enabled.
        GC:            Included Boehm (with typed GC and Parallel Mark)

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list