[Mono-bugs] [Bug 554715] New: Corrupt dll generates SIGABRT / System.BadImageFormat, suspected related to constructing a System.Threading.Timer in a lock

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Nov 11 16:43:26 EST 2009


http://bugzilla.novell.com/show_bug.cgi?id=554715


           Summary: Corrupt dll generates SIGABRT / System.BadImageFormat,
                    suspected related to constructing a
                    System.Threading.Timer in a lock
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.4.x
          Platform: x86
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: novel at andrewrondeau.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=326969)
 --> (http://bugzilla.novell.com/attachment.cgi?id=326969)
SIGABRT from Mono 2.4.2.3 on the official mono VM

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5

Some code that I'm working on compiles correctly.  When compiled with Visual
Studio 2005, it works correctly on Windows and Mono.  When compiled with Mono
2.4.2.3 (Monodevelop on the official Mono Linux VM) or Mono 2.4 (Monodevelop on
Mac), the code generates a SIGABRT on Mac/Linux, and a System.BadImageFormat on
Windows.

I've been able to deduce this bug to a specific block of code:

lock (PurgeOldCometSessionsKey)
   if (null == PurgeOldCometSessionsTimer)
      PurgeOldCometSessionsTimer = new Timer(
         CleanOldTransports,
         null,
         TimeSpan.FromMilliseconds(0),
TimeSpan.FromSeconds(FileHandlerFactoryLocator.WebServer.CheckDeadConnectionsFrequencySeconds));

If I change the above block of code to include a no-op prior to the "new
Timer(...", the compiled code works on Mono (Linux and Mac) but still causes a
System.BadImageFormat on Windows.

I attempted to reproduce the problem with a tiny program, but it seems to
require some unknown circumstances in my project in order to trigger the bug!

Reproducible: Always

Steps to Reproduce:
Note:  I will upload a .zip file containing this code once I get a bug ID#

1. Open ObjectCloud.sln in MonoDevelop

2. Build the ObjectCloud project in Debug mode

3. In a terminal, cd to Server/ObjectCloud/bin/Debug

4. "mono ObjectCloud.exe"

5. Observe the SIGABRT

6. Run ObjectCloud.exe on Windows and observe the System.BadImageFormat
exception

7. In the ObjectCloud.Interfaces project; in the WebServer folder, open
WebHandler.cs and un-comment out lines 584 and 596.  (These are the no-ops)

8. Build the ObjectCloud project

9. Run "mono ObjectCloud.exe"  You will eventually see a "Creating Root
Directory" and then "Server is waiting for a connection at http://<your
IP>:1080"  This means that it's working, and you can exit with Control-C

10. Run ObjectCloud.exe on Windows.  Observe that there's still a
System.BadImageFormat exception
Actual Results:  
SIGABRT or System.BadImageFormatException

Expected Results:  
Run without crashing

Will link to a .zip file with the needed source code shortly

-- 
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