In trouble; facing punishment for a misdeed.
In an urgent or difficult situation; when no other solution is available.