[Mono-bugs] [Bug 659016] New: Division by zero error when using /checked

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Dec 11 14:59:51 EST 2010



           Summary: Division by zero error when using /checked
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.8.x
          Platform: x86-64
        OS/Version: Windows 7
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: JIT
        AssignedTo: lupus at novell.com
        ReportedBy: gbarberi+nv at aotaonline.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development
           Blocker: ---

Description of Problem:
When using the "Check for arithmetic overflow/underflow" option and compiled
with VS2k10, the following piece of code throws a division by zero error when
running in Mono.

Steps to reproduce the problem:
1. Make sure "Check for arithmetic overflow/underflow" option is selected.
2. Create a new project and replace the main code with the following:

    public class Program

        private int RegionsCount { get; set; }
        private uint RegionSize { get; set; }

        private byte[] MapData { get; set; }

        public static void Main(string[] args)
            Program engine = new Program();
            engine.Load(true, 3400, 6200, 34, 62, 100, 100);

        public void Load(bool createRegionChanges, uint inWorldWidth, uint
inWorldHeight, uint regionWidth, uint regionHeight,
                        uint cityRegionWidth, uint cityRegionHeight)
            RegionSize = regionWidth * regionHeight;

            int column = (int)(inWorldWidth / regionWidth);
            int row = (int)(inWorldHeight / regionHeight);

            RegionsCount = column * row;

            MapData = new byte[RegionSize * 16 * RegionsCount];

Actual Results:
Division by Zero Exception is thrown

Expected Results:
Application should run without any exceptions.

How often does this happen? 
Every time with Mono, never with .NET framework.

Additional Information:

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

More information about the mono-bugs mailing list