Created attachment 18115 [details]
SGen systematically crashes when unloading a child domain that has been created in a separate thread. The error message is:
"* Assertion: should not be reached at c:\j\workspace\v\repos\mono\mono\sgen\sgen-scan-object.h:90"
I have attached a simple test case which can be used to reproduce the error.
Created attachment 18116 [details]
Simple C# program
Created attachment 18117 [details]
The crash can still be reproduced if we attach the child domain to the main thread instead of creating a new one.
Unfortunately the appdomain support in our embedding api is kinda flaky/confusing so these issues can happen.