bugDotGNU Portable.NET - Bugs: bug #9393, Calling managed method from...

 
 

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

bug #9393: Calling managed method from unmanaged code fails

Submitter:  Marcus Urban <mathpup>
Submitted:  Sun 20 Jun 2004 03:27:35 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Confirmed
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Tue 19 Jul 2005 10:50:14 AM UTC, comment #1: 

Removed first .class declaration in .il file, compiled with -e option to ilasm.  Retested, core dumped first run.  GDB back trace follows:

#0  0xb7d7b2d0 in ?? ()
#1  0xb7d91548 in DoIndirectCall () from /home/newlook/dotnet/libvt.so
#2  0x080e59cf in ffi_call_SYSV () at src/x86/sysv.S:59
#3  0x080e59b3 in ffi_raw_call (cif=0x8203778, fn=0xb7d91535 <DoIndirectCall>,
    rvalue=0x0, fake_avalue=0x8167004) at src/x86/ffi.c:515
#4  0x0809e002 in _ILCVMInterpreter (thread=0x8166f50) at cvm_call.c:936
#5  0x0804c4dd in _ILCallMethod (thread=0x8166f50, method=0xb7d7b304,
    unpack=0x804c350 <_ILCallUnpackVResult>, result=0xbffff460, isCtor=0,
    _this=0x0, pack=0x804c080 <_ILCallPackVParams>, userData=0xbffff470)
    at call.c:706
#6  0x0804c818 in ILExecThreadCallV (thread=0x8166f50, method=0xb7d7b304,
    result=0xbffff460, args=0xbffff470) at call.c:928
#7  0x0804bd4c in main (argc=2, argv=0xbffff514) at ilrun.c:526

Deryk Robosson <drobosson>
Group Member
Sun 20 Jun 2004 03:27:35 AM UTC, original submission:  

The ldftn instruction should return a function pointer that can be passed to unmanaged code. The function pointer either points to native (JITted code) or a method thunk.

This does not appear to work correctly with Pnet. The attached code produces a segfault (but works correctly with Rotor and Mono). To run the test program, compile vt.c using 'gcc -shared -o libvt.so vt.c' and then compile vt.il using 'ilasm vt.il'.

Marcus Urban <mathpup>

 

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

Attached Files
file #1428:  vt.il added by mathpup (3KiB - text/x-c++src - CIL portion of case test)
file #1427:  vt.c added by mathpup (189B - text/x-csrc - C portion of 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 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-07-19 drobosson StatusNone Confirmed
2004-06-20 mathpup Attached File- Added vt.il, #1419
2004-06-20 mathpup Attached File- Added vt.c, #1418

Back to the top

Powered by Savane 3.13-b921.
Corresponding source code