[Mono-bugs] [Bug 573682] New: segtaults when encoding/decoding non-UTF8 strings

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jan 25 15:54:46 EST 2010


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

http://bugzilla.novell.com/show_bug.cgi?id=573682#c0


           Summary: segtaults when encoding/decoding non-UTF8 strings
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: tedu at fogcreek.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=338709)
 --> (http://bugzilla.novell.com/attachment.cgi?id=338709)
test program

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12)
Gecko/20080207 Ubuntu/7.10 (gutsy) Firefox/2.0.0.12

The attached program reads 2 lines from a UTF8 file called "input.txt."  It
then attempts to convert them to and from strings and bytes in particular
encodings (1250 and 1252).  At some point in this process, mono crashes.

This is extracted from a larger program which attempts to identify which
encodings can be used for a particular string.  On Windows, this is detected by
comparing the string before and after a roundtrip through the encoding.  On
mono, it crashes.

By convention, the input file contains one line of text representable in the
1250 encoding and a second line representable in 1252.  The bug manifests in
both encodings.

Reproducible: Always

Steps to Reproduce:
I will attach both encodingtest.cs and input.txt.  Compile and run.
Actual Results:  
at (wrapper managed-to-native) object.__icall_wrapper_mono_array_new_specific
(intptr,int) <0x00004>
  at (wrapper managed-to-native) object.__icall_wrapper_mono_array_new_specific
(intptr,int) <0xffffffff>
  at I18N.Common.MonoEncoding.HandleFallback
(System.Text.EncoderFallbackBuffer&,char*,int&,int&,byte*,int&,int&) <0x00128>
  at I18N.West.CP1250.ToBytes (char*,int,byte*,int) <0x0048c>
  at I18N.Common.ByteEncoding.GetBytesImpl (char*,int,byte*,int) <0x00025>
  at I18N.Common.MonoEncoding.GetBytes (char*,int,byte*,int) <0x00025>
  at System.Text.Encoding.GetBytes (string) <0x000cf>
  at BadMsg.TestEncoding (string,System.Text.Encoding) <0x00024>
  at BadMsg.TestEncoding (int,string,string) <0x000a3>
  at BadMsg.Main () <0x00073>

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