Bugzilla – Bug 323306
[PATCH] Segfault calling MethodInfo.Invoke from a second AppDomain.
Last modified: 2007-09-15 21:24:46 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".