SES-1902 : Add debugging
SES-1902 : Print the stack overflow trace as well
SES-1902 : Explicitly catch StackOverflowError to release lock