dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] Fwd: [Bug #3669] Custom marshalers do not work properl


From: Marcus
Subject: [Pnet-developers] Fwd: [Bug #3669] Custom marshalers do not work properly
Date: Mon, 2 Jun 2003 01:38:31 -0500
User-agent: KMail/1.5.9

Apparently, ilrun's ability to handle custom marshalers is sensitive to the 
optimization flags used. The preferred optimization flags for an Athlon 
T-Bird seem to be: -O3 -fomit-frame-pointer -march=athlon-tbird 
-mpreferred-stack-boundary=2

The -mpreferred-stack-boundary flags doesn't seem to affect things, but if I 
include -march=athlon-tbird as the only flag, GCC has a register spill 
problem. Adding -fomit-frame-pointer to -march=athlon-tbird fixes that 
problem, but then custom marshallers fail.

:-(


----------  Forwarded Message  ----------

Subject: [Bug #3669] Custom marshalers do not work properly
Date: Sunday 01 June 2003 6:56 pm
From: address@hidden
To: address@hidden, address@hidden, 
address@hidden, address@hidden

=================== BUG #3669: LATEST MODIFICATIONS ==================
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=3669&group_id=353

Changes by: Marcus Urban <address@hidden>
Date: Sun 06/01/2003 at 23:56 (GMT)

------------------ Additional Follow-up Comments ----------------------------
I forgot to add the C++ shared library component. The bug is definitely not
 fixed.




=================== BUG #3669: FULL BUG SNAPSHOT ===================


Submitted by: mathpup                 Project: DotGNU Portable.NET
Submitted on: Sun 05/18/2003 at 05:57
Category:  None                       Severity:  5 - Major
Bug Group:  None                      Resolution:  Fixed
Assigned to:  None                    Status:  Closed

Summary:  Custom marshalers do not work properly

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
    address@hidden"

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


Follow-up Comments
*******************

-------------------------------------------------------
Date: Sun 06/01/2003 at 23:56       By: mathpup
I forgot to add the C++ shared library component. The bug is definitely not
 fixed.


-------------------------------------------------------
Date: Sun 06/01/2003 at 19:47       By: t3rmin4t0r
It's working now or has been for a few days or so

-------------------------------------------------------
Date: Sun 05/18/2003 at 06:01       By: mathpup
Adding  Console.WriteLine( pNativeData ); to
MarshalNativeToManaged shows that with ilrun the address is -1073747212,
 which looks very suspicious.



CC list is empty


File Attachments
****************

-------------------------------------------------------
Date: Sun 06/01/2003 at 23:53  Name: MyMarshal.cpp  Size: 0KB   By: mathpup
C++ component of test case
http://savannah.gnu.org/bugs/download.php?group_id=353&amp;bug_id=3669&amp;bu
g_file_id=477

-------------------------------------------------------
Date: Sun 05/18/2003 at 05:57  Name: MyMarshal.cs  Size: 1KB   By: mathpup
Test case
http://savannah.gnu.org/bugs/download.php?group_id=353&amp;bug_id=3669&amp;bu
g_file_id=459


For detailed info, follow this link:
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=3669&group_id=353

-------------------------------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]