Circular language fallback might cause application crash due to StackOverflowException


Description

The application might crash during Dictionary Translation. The symptom of the issue is an entry in the Windows Application Event Log similar to the following:

Faulting application name: w3wp.exe, version: X.X.XXXX.XXXX, time stamp: 0x23456789
Faulting module name: clr.dll, version: X.X.XXXX.X, time stamp: 0x12345678
Exception code: 0xc00000fd

The issue occurs with the enabled Language Fallback feature when two or more languages form a circular language fallback dependency. For example, English is a Fallback Language for Danish, and Danish is a Fallback Language for English.

To confirm that the solution is affected by this particular issue:

  1. Collect a memory dump file based on StackOverflowException (0xc00000fd). See KB0253710, paragraph 2 "Collect a memory dump file based on a specific first chance managed exception."
  2. Examine the stack trace of the affected thread. It will include multiple consecutive frames calling the method Sitecore.Globalization.DefaultTranslate.TryTranslateTextByLanguage(string key, DictionaryDomain domain, Language language, out string phrase, params object[] parameters).

Solution

To resolve the issue:

To mitigate the issue, break circular language fallback dependencies manually. You have to review the value of the Fallback Language field of each language under the /sitecore/system/Languages/ item to identify languages that cause a circular dependency, and then change the value of the Fallback Language field for one or more languages.