[Mono-dev] Process.GetCurrentProcess().MainModule.FileName broken on 2.6.1 on FreeBSD

psantosl at codicesoftware.com psantosl at codicesoftware.com
Wed Feb 10 15:05:46 EST 2010

Hi there,

[tester at freebox ~/test]$ uname -a
FreeBSD freebox.codicesoftware.com 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2
#0: Tue Jan  5 16:02:27 UTC 2010
root at i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386

[tester at freebox ~/test]$ ../mono/bin/mono --version
Mono JIT compiler version 2.6.1 (tarball Wed Feb 10 00:44:40 CET 2010)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
        TLS:           normal
        GC:            Included Boehm (with typed GC and Parallel Mark)
        SIGSEGV:       normal
        Notification:  Thread + polling
        Architecture:  x86
        Disabled:      none

[tester at freebox ~/test]$ cat main.cs
using System;
using System.Diagnostics;

namespace getmainmodule
    class Program
        static void Main(string[] args)


[tester at freebox ~/test]$ ../mono/bin/mono main.exe

Unhandled Exception: System.ArgumentOutOfRangeException: Index is less
than 0 or more than or equal to the list count.
Parameter name: index
  at System.Collections.ArrayList.ThrowNewArgumentOutOfRangeException
(System.String name, System.Object actual, System.String message)
[0x00000] in <filename unknown>:0
  at System.Collections.ArrayList.get_Item (Int32 index) [0x00000] in
<filename unknown>:0
  at System.Diagnostics.ProcessModuleCollection.get_Item (Int32 index)
[0x00000] in <filename unknown>:0
  at System.Diagnostics.Process.get_MainModule () [0x00000] in <filename
  at (wrapper remoting-invoke-with-check)
System.Diagnostics.Process:get_MainModule ()
  at getmainmodule.Program.Main (System.String[] args) [0x00000] in
<filename unknown>:0


More information about the Mono-devel-list mailing list