bugDotGNU Portable.NET - Bugs: bug #3669, Custom marshalers do not work...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #3669: Custom marshalers do not work properly

Submitted by:  Marcus Urban <mathpup>
Submitted on:  Sun 18 May 2003 05:57:30 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Thu 03 Jul 2003 10:35:32 AM UTC, comment #6:

Closed - I'm going to assume that this is no longer
an issue.

Rhys Weatherley <rweather>
Project Administrator
Sat 21 Jun 2003 05:49:47 AM UTC, comment #5:

Is this still an issue since changing to CFLAGS=""?

Rhys Weatherley <rweather>
Project Administrator
Mon 02 Jun 2003 07:09:01 AM UTC, comment #4:

Re-opened so I can have another look at it - seems to be affected by Athlon optimisation flags.

Rhys Weatherley <rweather>
Project Administrator
Sun 01 Jun 2003 11:56:07 PM UTC, comment #3:

I forgot to add the C++ shared library component. The bug is definitely not fixed.

Marcus Urban <mathpup>
Sun 01 Jun 2003 07:47:08 PM UTC, comment #2:

It's working now or has been for a few days or so

Gopal.V <t3rmin4t0r>
Project Administrator
Sun 18 May 2003 06:01:05 AM UTC, comment #1:

Adding Console.WriteLine( pNativeData ); to
MarshalNativeToManaged shows that with ilrun the address is -1073747212, which looks very suspicious.

Marcus Urban <mathpup>
Sun 18 May 2003 05:57:30 AM UTC, original submission:

The bug report has more information than I would usually give because the topic is less likely to be familiar.

The documentation on implementing custom marshalers is quite vague, and further information is very scarce. However, I able to put together a trivial example of a custom marshaler to see if I could get it working.

The sample marshaler takes an Ansi C-string from unmanaged code and turns it into a C# string, placing asterisks around the string to differentiate this from the default marshaling.

The program creates a C# delegate that is indirectly invoked from unmanaged code, to test the marshaling.

With Rotor, I get the output "s = ABC".
With ilrun, I get "s = *v
xRÈC@*"

This might be bug in Marshal.PtrToStringAnsi() or in custom marshaling component of the runtime.

I'm attaching a test case.

1. Build a shared lib of invoke.cpp: cpp -shared -o libtest.so invoke.cpp
2. Build the C# test: cscc -o MyMarshal.exe MyMarshal.cs
3. Run the program: ilrun MyMarshal.exe

Marcus Urban <mathpup>

 

Attached Files
file #474:  MyMarshal.cpp added by mathpup (330B - text/x-c++src - C++ component of test case)
file #456:  MyMarshal.cs added by mathpup (1KiB - text/x-csharp - Test case)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Thu 03 Jul 2003 10:35:31 AM UTCrweatherOpen/ClosedOpen=>(Error - Not Found)
Mon 02 Jun 2003 07:09:01 AM UTCrweatherOpen/ClosedClosed=>(Error - Not Found)
Sun 01 Jun 2003 07:47:08 PM UTCt3rmin4t0rStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1