mscorlib recurseive resource lookup bug

3,878 views
Skip to first unread message

Gareth Thackeray

unread,
Feb 16, 2016, 10:04:49 AM2/16/16
to RavenDB - 2nd generation document database
I'm seeing this on startup of a console app.  I don't know what's changed to start causing it I don't believe I've made any changes in the app code or the Raven version since it last worked OK.  It seems to be a recurrence of http://issues.hibernatingrhinos.com/issue/RavenDB-3278

I'm using client build 3800.

Any help appreciated.

Gareth

Gareth Thackeray

unread,
Feb 16, 2016, 10:06:33 AM2/16/16
to RavenDB - 2nd generation document database
Here's the stack trace:

[Window Title]
Marketplace.Services.exe - Assert Failure

[Main Instruction]
Marketplace.Services.exe - Assert Failure

[Content]
Expression: [mscorlib recursive resource lookup bug]
Description: Infinite recursion during resource lookup within mscorlib.  This may be a bug in mscorlib, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names.  Resource name: Security_Generic

[Expanded Information]
Stack Trace:
   at System.Environment.ResourceHelper.GetResourceStringCode(Object userDataIn)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Environment.ResourceHelper.GetResourceString(String key, CultureInfo culture)
   at System.Environment.GetResourceFromDefault(String key)
   at System.Security.FrameSecurityDescriptor.CheckDemand2(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh, Boolean fDeclarative)
   at System.Security.SecurityRuntime.FrameDescHelper(FrameSecurityDescriptor secDesc, IPermission demandIn, PermissionToken permToken, RuntimeMethodHandleInternal rmh)
   at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
   at System.Security.CodeAccessPermission.Demand()
   at System.Reflection.RuntimeAssembly.VerifyCodeBaseDiscovery(String codeBase)
   at System.Reflection.RuntimeAssembly.GetName(Boolean copiedName)
   at Costura.AssemblyLoader.ReadExistingAssembly(AssemblyName name) in C:\Builds\RavenDB-Stable-3.0\Bundles\Raven.Client.UniqueConstraints\obj\Release\Common.cs:line 85
   at Costura.AssemblyLoader.ResolveAssembly(String assemblyName) in C:\Builds\RavenDB-Stable-3.0\Bundles\Raven.Client.UniqueConstraints\obj\Release\ILTemplate.cs:line 64
   at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
   at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
   at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
   at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
   at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
   at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
   at System.Environment.ResourceHelper.GetResourceStringCode(Object userDataIn)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Environment.ResourceHelper.GetResourceString(String key, CultureInfo culture)
   at System.Environment.GetResourceFromDefault(String key)
   at System.Security.FrameSecurityDescriptor.CheckDemand2(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh, Boolean fDeclarative)
   at System.Security.SecurityRuntime.FrameDescHelper(FrameSecurityDescriptor secDesc, IPermission demandIn, PermissionToken permToken, RuntimeMethodHandleInternal rmh)
   at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
   at System.Security.CodeAccessPermission.Demand()
   at System.Reflection.RuntimeAssembly.VerifyCodeBaseDiscovery(String codeBase)

Gareth Thackeray

unread,
Feb 16, 2016, 10:50:09 AM2/16/16
to RavenDB - 2nd generation document database
I can work around this by putting

CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

which is not ideal.  My culture otherwise is en-GB.

I'm on Windows 10 btw.  Not sure what has suddenly caused this but I suspect Windows updates.

Oren Eini (Ayende Rahien)

unread,
Feb 16, 2016, 3:58:26 PM2/16/16
to ravendb
How do you repro this?

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gareth Thackeray

unread,
Feb 16, 2016, 4:00:01 PM2/16/16
to ravendb
The code from the bug report does it:

public static void Main(string[] args)
        {
            using (var store = new DocumentStore())
            {
                var fileName = new string('a', 2000);

                CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("pl-PL");
                CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("pl-PL");
                Thread.CurrentThread.CurrentCulture = new CultureInfo("pl-PL");
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("pl-PL");

                IsolatedStorageFile isoStore = IsolatedStorageFile.GetMachineStoreForDomain();

                isoStore.FileExists(fileName);
            }
        }


--
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/u71sHJShoPU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

cid:995505DB-77EC-41A1-989A-A3B4F8C53C25@clubworkspace

 

Gareth Thackeray
CTO

www: vidados.com
M: +44 (0) 7748 300359

skype: gareththackeray

This e-mail message is confidential and may contain privileged information. If you are not the above named addressee, it may be unlawful for you to read, copy, distribute, disclose or otherwise use the information in this e-mail message. If you are not the intended recipient of this e-mail message, please delete this message.

Oren Eini (Ayende Rahien)

unread,
Feb 16, 2016, 4:09:40 PM2/16/16
to ravendb, Paweł Pekról
Hm, I think we might need to set the thread culture when loading assemblies, then restore it.
Reply all
Reply to author
Forward
0 new messages