[Mono-bugs] [Bug 683757] New: (-1f).ToString() and (1f).ToString() causes memory corruption other float values are fine

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Mar 30 09:30:11 EDT 2011


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

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


           Summary: (-1f).ToString() and (1f).ToString() causes memory
                    corruption other float values are fine
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.10.x
          Platform: PowerPC-64
        OS/Version: Red Hat 9.0
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: kenneth at hexad.dk
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16

A simple test program is:

namespace test { class test {
  static void Main() {
    (5f).ToString(); //No issues
    Console.WriteLine("Invoking...");
    (-1f).ToString(); //Corrupts memory
    Console.WriteLine("Invoked");
  }
}}

It will output the "Invoked" string a number of times, possibly with the
character "U" in between. Occasionally other strings appear such as "IOCTL",
"Bad Address", "Argument list too long", and other seemingly random messages.
Usually machine memory has been corrupted so badly that other programs start to
throw random errors, and the machine stops responding.

It only happens with -1 and 1 when used as floats. I have tested it with 1.1f,
-1.1f, -2f, 2f, -5f, 5f and those cause no problems. Also tested with
int/long/double values and those have no issues. It also works fine on x86, so
I suspect some subtle endian order issue.

Reproducible: Always

Steps to Reproduce:
1. Compile example program from above
2. Run it
Actual Results:  
Example run (1):

Invoking...
InvokedUnknown errno: Argument list too long
InvokedUC-bash: [2020: 1] tcsetattr: Success
Aborted

-bash: echo: write error: Operation not permitted

Example run (2):
Invoking...
InvokedUnknown errno: Argument list too long
InvokedU
        -bash: echo: write error: Operation not permitted





Expected Results:  
Should not crash

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