Bug 318701 (MONO75769) - [REGRESSION] PInvoking with CharSet.Auto causes assertion failure in runtime
Summary: [REGRESSION] PInvoking with CharSet.Auto causes assertion failure in runtime
Status: RESOLVED FIXED
Alias: MONO75769
Product: Mono: Runtime
Classification: Mono
Component: interop (show other bugs)
Version: 1.0
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-10 17:20 UTC by Kamil Skalski
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:27:08 UTC


---- Reported by nazgul@omega.pl 2005-08-10 10:20:57 MST ----

Please fill in this template when reporting a bug, unless you know what you
are doing.
Description of Problem:
PInvoking with CharSet.Auto causes assertion failure in runtime
(though I'm not an expert of PInvoke and it is possible that Auto is just
invalid here)

Steps to reproduce the problem:
1. Compile and run following program with mono svn

using System;
using System.Runtime.InteropServices;

class NativeReadLine
{
  [DllImport ("readline", CharSet = CharSet.Auto)]
  static extern string readline (string x);

  public string ReadLine (string prompt) {
    Console.WriteLine ("read line");
    return readline (prompt);
  }
}

class HacksFramework
{
  public static void Main () {
    // libreadline is broken on my machine, we need to call something
    // in libtermcap.so to initialize it properly
    try { tgetnum (""); } catch {  }

    NativeReadLine rl = new NativeReadLine ();
    System.Console.WriteLine (rl.ReadLine ("bla"));
  }
  
  // helper call for making system load needed libs
  [DllImport ("termcap", CharSet = CharSet.Auto)]
  static extern int tgetnum (string x);
}


Actual Results:
** ERROR **: file marshal.c: line 1143 (conv_to_icall): should not be reached
aborting...


Expected Results:
bla

How often does this happen? 
With mono svn always. With mono 1.1.8 it works fine.

Additional Information:



---- Additional Comments From vargaz@gmail.com 2005-08-10 19:43:37 MST ----

Fixed in SVN.



Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>mono svn</cf_op_sys_details>
Unknown operating system unknown. Setting to default OS "Other".