[Using classpath bundled with gcc 4.8.2]
If LC_MESSAGES locale is unsupported, non-existant or does not match the expected pattern AA[_bb] where AA=language (2 bytes) and bb=region (2 bytes), the locale handler goes to infinite loop.
Simple test case:
This is two related problems:
1. The code involved is in classpath/java/text/DateFormat.java: getDateInstance() and getDateTimeInstance(). The exception handler calls recursively itself and causes infinite loop as the fallback locale cannot be instantiated (for some unknown reason).
2. The code in gnu/classpath/natSystemProperties.cc interprets C.UTF-8 as user.language='C.' and no user.region (since no underscore). This triggers the bug if system locale is not in the expected format.