Bug 323306 (MONO80618) - [PATCH] Segfault calling MethodInfo.Invoke from a second AppDomain.
Summary: [PATCH] Segfault calling MethodInfo.Invoke from a second AppDomain.
Status: RESOLVED FIXED
Alias: MONO80618
Product: Mono: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 1.2
Hardware: Other Other
: P3 - Medium : Major
Target Milestone: ---
Assignee: Paolo Molaro
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-25 19:52 UTC by William Holmes
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
PreProcess.cs -- Sample Code (193 bytes, text/plain)
2007-01-25 19:53 UTC, Thomas Wiest
Details
RunInOtherDomain.cs -- sample code (2.69 KB, text/plain)
2007-01-25 19:53 UTC, Thomas Wiest
Details
My output (6.13 KB, text/plain)
2007-01-25 19:54 UTC, Thomas Wiest
Details
marshal.diff (501 bytes, patch)
2007-01-28 16:57 UTC, Thomas Wiest
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:24:15 UTC


---- Reported by billholmes54@gmail.com 2007-01-25 12:52:18 MST ----

Sample attached and output attached.

Running:
mcs -target:library PreProcess.cs
mcs RunInOtherDomain.cs
mono RunInOtherDomain.exe

This does not always fail.  You may have to run the exe a few times.

Observations:
This was found on recent svn built versions of mono on Windows and SUSE
10.2.  A regression from 1.2.
Removing or changing the argument type of CreateAdditionalFiles will succeed.
Changing line 79 in RunInOtherDomain.cs to false causes the Invoke call to
be run in the current AppDomain and the error does not occur.
Compiling PreProcessor.CreateAdditionalFiles into the exe works fine. 
(uncomment ln 52 in RunInOtherDomain.cs  and run mcs RunInOtherDomain.cs
PreProcess.cs)



---- Additional Comments From billholmes54@gmail.com 2007-01-25 12:53:27 MST ----

Created an attachment (id=171342)
PreProcess.cs -- Sample Code




---- Additional Comments From billholmes54@gmail.com 2007-01-25 12:53:50 MST ----

Created an attachment (id=171343)
RunInOtherDomain.cs -- sample code




---- Additional Comments From billholmes54@gmail.com 2007-01-25 12:54:16 MST ----

Created an attachment (id=171344)
My output




---- Additional Comments From robertj@gmx.net 2007-01-28 09:56:28 MST ----

mono_marshal_get_runtime_invoke () is allocating the
signature from the method's class image.

Since this image is unloaded with the appdomain (the main assembly
has no reference to this image), corlib's runtime_invoke_cache
contains a method whose sig is now garbage.




---- Additional Comments From robertj@gmx.net 2007-01-28 09:57:05 MST ----

Created an attachment (id=171345)
marshal.diff




---- Additional Comments From lupus@ximian.com 2007-01-29 07:06:55 MST ----

Thanks for the patch. Fixed in svn.

Imported an attachment (id=171342)
Imported an attachment (id=171343)
Imported an attachment (id=171344)
Imported an attachment (id=171345)

Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>SUSE 10.2 and Windows XP SP2</cf_op_sys_details>
Unknown operating system other. Setting to default OS "Other".