Have you verified that expr.length() != 0 ? Otherwise lines 8 and 9 would cause the sudden exit.
Perhaps provideHelpIfNecessary(); left a '\n' in the input stream?
1) I tried changing getline(cin, expr); to cin >> expr; just to see if that would change anything. And the program worked, but of course it didn't work correctly since there might be spaces in an input.
2) I took out lines 8 & 9. And after "Expression?" it gave me a segmentation fault.