Bug 15064 - AppDomains: crashdump on System.AppDomain.ProcessMessageInDomain
Summary: AppDomains: crashdump on System.AppDomain.ProcessMessageInDomain
Alias: None
Product: Runtime
Classification: Mono
Component: io-layer (show other bugs)
Version: 3.2.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
: 16493 (view as bug list)
Depends on:
Reported: 2013-09-30 05:12 UTC by ilya.cherkasov
Modified: 2018-01-24 18:01 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

test utility sources (259.99 KB, application/zip)
2013-09-30 05:12 UTC, ilya.cherkasov

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description ilya.cherkasov 2013-09-30 05:12:43 UTC
Created attachment 5018 [details]
test utility sources

Hello, we are trying to evaluate mono to check whether it can be run successfully in high-load production environments.

So, we're created small program to simulate some work.

Sources are located here : https://github.com/head-thrash/stress_test_mono

What the program basically does -- it creates an AppDomain and runs thread pool worker with some CPU-bound job. I attached sources in this issue. (run with make run sgen)

So, the bug - mono --gc=sgen failed after 20 minutes of execution with following error:

Done game RegexDna. Elapsed = 0.5779921 s.
Enqueing type RegexDna
Waiting for KNucleotide to complete
Enqueing type SpectralNorm
Waiting for SpectralNorm to complete
Assertion at mini.c:4008, condition `code' not met
at <unknown> <0xffffffff>
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject (System.IO.BinaryReader) [0x0000f] in /home/bkmz/my/mono/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:141
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (System.Runtime.Serialization.Formatters.Binary.BinaryElement,System.IO.BinaryReader,bool,object&,System.Runtime.Remoting.Messaging.Header[]&) [0x0004d] in /home/bkmz/my/mono/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:107
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize (System.IO.Stream,System.Runtime.Remoting.Messaging.HeaderHandler) [0x0007a] in /home/bkmz/my/mono/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:177
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream) [0x00000] in /home/bkmz/my/mono/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:134
at System.Runtime.Remoting.Channels.CADSerializer.DeserializeObject (System.IO.MemoryStream) [0x00015] in /home/bkmz/my/mono/mcs/class/corlib/System.Runtime.Remoting.Channels/CrossAppDomainChannel.cs:337
at System.Runtime.Remoting.Messaging.CADMethodCallMessage.GetArguments () [0x0000d] in /home/bkmz/my/mono/mcs/class/corlib/System.Runtime.Remoting.Messaging/CADMessages.cs:327
at System.Runtime.Remoting.Messaging.MethodCall..ctor (System.Runtime.Remoting.Messaging.CADMethodCallMessage) [0x00017] in /home/bkmz/my/mono/mcs/class/corlib/System.Runtime.Remoting.Messaging/MethodCall.cs:83
at System.AppDomain.ProcessMessageInDomain (byte[],System.Runtime.Remoting.Messaging.CADMethodCallMessage,byte[]&,System.Runtime.Remoting.Messaging.CADMethodReturnMessage&) [0x00018] in /home/bkmz/my/mono/mcs/class/corlib/System/AppDomain.cs:1371
at (wrapper remoting-invoke-with-check) System.AppDomain.ProcessMessageInDomain (byte[],System.Runtime.Remoting.Messaging.CADMethodCallMessage,byte[]&,System.Runtime.Remoting.Messaging.CADMethodReturnMessage&) <IL 0x0003d, 0xffffffff>
at System.Runtime.Remoting.Channels.CrossAppDomainSink.ProcessMessageInDomain (byte[],System.Runtime.Remoting.Messaging.CADMethodCallMessage) [0x00008] in /home/bkmz/my/mono/mcs/class/corlib/System.Runtime.Remoting.Channels/CrossAppDomainChannel.cs:199
at (wrapper runtime-invoke) <Module>.runtime_invoke_CrossAppDomainSink/ProcessMessageRes_object_object (object,intptr,intptr,intptr) <IL 0x00066, 0xffffffff>
at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <0xffffffff>
at System.AppDomain.InvokeInDomainByID (int,System.Reflection.MethodInfo,object,object[]) <0x0009c>
at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage (System.Runtime.Remoting.Messaging.IMessage) <0x00109>
at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke (System.Runtime.Remoting.Messaging.IMessage) <0x00342>
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (System.Runtime.Remoting.Proxies.RealProxy,System.Runtime.Remoting.Messaging.IMessage,System.Exception&,object[]&) <0x0042d>
at (wrapper runtime-invoke) <Module>.runtime_invoke_object_object_object_intptr&_intptr& (object,intptr,intptr,intptr) <0xffffffff>
at <unknown> <0xffffffff>
at (wrapper managed-to-native) object.__icall_wrapper_mono_store_remote_field_new (object,intptr,intptr,object) <0xffffffff>
at (wrapper stfld-remote) object.__mono_store_remote_field_new_wrapper (object,intptr,intptr,object) <0xffffffff>
at System.AppDomain.CreateDomain (string,System.Security.Policy.Evidence,System.AppDomainSetup) <0x00367>
at System.AppDomain.CreateDomain (string) <0x00010>
at test_mono.MainClass.RunThreadPoolTask (test_mono.GameType) <0x000c0>
at test_mono.MainClass.RunGame (test_mono.GameType) <0x0001f>
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_this__int (object,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
mono() [0x4abf6d]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x2affb8817cb0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x2affb8a5b425]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x17b) [0x2affb8a5eb8b]
mono() [0x62cb2d]
mono() [0x62cc66]
mono() [0x421bf9]
mono() [0x4225a0]
mono() [0x423f00]
mono() [0x424a5d]
mono() [0x4adf21]
Debug info from gdb:
Assertion at mini.c:4008, condition `code' not met
Could not attach to process. If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
No threads.
Aborted (core dumped)
make: *** [run-sgen] Error 134

Can you make that fixed?

Mono is build from sources `3912066fe1134ba665770723a24c8ea9b4f1aea3` on master
Comment 1 ilya.cherkasov 2013-09-30 05:16:44 UTC
I can give link to coredump file if needed (it's large, 22mb though). Just ask.
Comment 2 ilya.cherkasov 2013-10-01 02:01:13 UTC
same error did happen with `mono --gc=boehm`, but process lived longer - almost 4 hours.
Comment 3 ilya.cherkasov 2013-10-25 03:23:06 UTC
Anyone, please? :-(
Comment 4 ilya.cherkasov 2013-11-18 05:04:13 UTC
Version 5106e3a56d728a517b873f33bd6ce92df7f2011f still fails with same exception. Why can't you fix that? :-(
Comment 5 Zoltan Varga 2013-11-28 18:59:35 UTC
*** Bug 16493 has been marked as a duplicate of this bug. ***
Comment 6 ilya.cherkasov 2013-11-29 01:08:10 UTC
Zoltan, seems that #16493 has a lot simpler program to repro the bug.
Comment 7 Rodrigo Kumpera 2017-10-14 00:12:06 UTC
Thank you for your report!

It appears you are running a very old version of Mono. Could you please try to update to any recent version and try to reproduce the issue again.

If the issue still persists please include the version information and change the bug status to NEW.
Comment 8 Ludovic Henry 2018-01-24 18:01:55 UTC
Please provide information requested in previous comment to reopen. Thank you.