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

 
 

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

bug #9393: Calling managed method from unmanaged code fails

Submitted by:  Marcus Urban <mathpup>
Submitted on:  Sun 20 Jun 2004 03:27:35 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Confirmed
Privacy: PublicAssigned 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>
Project 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>

 

Attached Files
file #1428:  vt.il added by mathpup (3kB - 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

 

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 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 19 Jul 2005 10:50:14 AM UTCdrobossonStatusNone=>Confirmed
Sun 20 Jun 2004 03:28:57 AM UTCmathpupAttached File-=>Added vt.il, #1419
Sun 20 Jun 2004 03:27:35 AM UTCmathpupAttached File-=>Added vt.c, #1418

Back to the top


Powered by Savane 3.1-cleanup