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

Submitter:  Marcus Urban <mathpup>
Submitted:  Sun 18 May 2003 05:57:30 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

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>
Group administrator
Sat 21 Jun 2003 05:49:47 AM UTC, comment #5: 

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

Rhys Weatherley <rweather>
Group 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>
Group 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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2003-07-03 rweather Open/ClosedOpen None
2003-06-02 rweather Open/ClosedClosed None
2003-06-01 t3rmin4t0r StatusNone None
    Open/ClosedOpen None

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code