In dev environment, stash bundle auto activates cache query tracking.
Cache tracking logs the contents of the cache, serializing it using print_r (see https://github.com/tedious/TedivmStashBundle/blob/master/Service/CacheTracker.php#L92)
The bug arises when a content type holding a XMLText field definition with a default value is loaded from cache. The default value contains a DOMDocument which is the root of the errror :
print_r issues a warning when trying to process the DOMDocument (Warning: print_r(): Invalid State Error)
The warning is handled by Symfony's Debug Component which throws a ContextErrorException
NB : the content type and its field definitions have been created using the public API