Mono 1.2.6 Runtime has a bug in System.Text.Encoding Assembly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mono (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: mono-runtime
Release: Ubuntu 8.04 Hardy Heron
Package: mono-runtime installed version: 1.2.6+dfsg-6ununtu3
My Code:
using System;
using System.Text;
using System.
using System.IO;
public class SamplesEncoding {
public static void Main() {
Encoding _encoding = null;
Console.
try{
_encoding = Encoding.
}catch(
Console.
Console.
Environme
}
Console.
}
}
Code Built via command:
gmcs /out:encoding_
Command used to execute code:
mono encoding_test.exe
Results:
aha@stanwyk:
The OEM Code Page Identifier is 437
You are toast got exception
System.
at System.
at SamplesEncoding
Expected results:
aha@stanwyk:
The OEM Code Page Identifier is 437
Exiting Normally, Goodbye
Methodology used to identify bug:
1. I compiled Mono 1.2.6 from the source at Novell using:
./configure --prefix=
make
make install
2. I then compiled the source listed above using the mono distributed with Hardy Heron
3. I attempted to run the Assembly encoding_test.exe using the mono runtime distributed with Hardy Heron
and received an exception
4. I ran the same code using the mono runtime that I compiled from scratch and the code ran as expected.
This is fixed in 1.9.1, which is part of Ubuntu Intrepid (8.10):
directhex@ mortos: /tmp$ gmcs encodeytest.cs cs(9,14) : warning CS0219: The variable `_encoding' is assigned but its value is never used mortos: /tmp$ mono encodeytest.exe
encodeytest.
Compilation succeeded - 1 warning(s)
directhex@
The OEM Code Page Identifier is 850
Exiting Normally, Goodbye