[Mono-bugs] [Bug 560388] New: Crash in Environment.UserName if USER not set

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Dec 3 10:56:30 EST 2009



           Summary: Crash in Environment.UserName if USER not set
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: tedu at fogcreek.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:
Gecko/20080207 Ubuntu/7.10 (gutsy) Firefox/

During startup, USER is not set.  get_UserName then crashes trying to make a
mono string out of a NULL string.  We're using eglib, where g_get_user_name is
implemented as simply getenv("USER").  I don't know what the implementation is
like in the real glib.

So, I guess the possible bugs would be:
1.  eglib g_get_user_name is too simple
2.  get_UserName has no recourse for handling null names
3.  What happens to CreateApplicationHost if it gets an empty name?


  at (wrapper managed-to-native) System.Environment.get_UserName () <0x00004>
  at (wrapper managed-to-native) System.Environment.get_UserName ()
  at System.Web.Hosting.ApplicationHost.CreateApplicationHost
(System.Type,string,string) <0x00238>
  at Mono.WebServer.VPathToHost.CreateHost
(Mono.WebServer.ApplicationServer,Mono.WebServer.WebSource) <0x00078>
  at Mono.WebServer.ApplicationServer.GetApplicationForPath
(string,int,string,bool) <0x000e0>
  at (wrapper remoting-invoke-with-check)
Mono.WebServer.ApplicationServer.GetApplicationForPath (string,int,string,bool)

Reproducible: Always

Steps to Reproduce:

Configure bugmail: http://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