When using a static instance of Json::Value, it may destruct after the DefaultValueAllocator does; therefore, when it calls valueAllocator()->releaseStringValue(), the valueAllocator() is already destructed and chaos ensues.
I have fixed it by representing the fact that a Value has an implicit dependency on a given instance of ValueAllocator by giving it a ValueAllocatorHandle which is just reference counted and takes care of deleting a heap allocated allocator when the last Value goes out of scope.
My patch to do this is attached.
patch to refcount ValueAllocator instances
Plan is to remove allocator completly. They introduce too many issue with little gain.
Fixed in trunk:
Removed experimental ValueAllocator, it caused static initialization/destruction order issues (bug #2934500). The DefaultValueAllocator has been inlined in code.