Crushing a body

I'm working on a game and I'd like to be able to crush the player 🙂

For example, the ceiling for a level may gradually move down, closer and closer to the floor. If the player is in the middle of this ceiling on floor action when the ceiling gets to close to the floor for the player's body to fit I want the player to die. Something like this:

1. Player is okay
=========================

😀
=========================

2. Player is about to be crushed
=========================
😮
=========================

3. Crushed!
=========================
=========================

I'm wondering how would you go about this? Touching the floor or the ceiling it okay (there is nothing inherent about touching either body that should harm the player). One thought I've had is that touching the floor AND the ceiling at the same time would be one of the properties of a "crushed" state, but it's possible that you could erroneously achieve this state if you're narrowly escaping being crushed. Also I'd like this crushing system to be flexible, that is, if the player gets trapped between any two bodies he's be crushed.
The contact events tell you the force exerted by each contact. I think for crushed, you'd see two contacts, and non-negligable normal impulse for both.
Or you could look for deep penetrations, which are a sign that something has gone wrong, usually crushing.
Your player could have a sensor shape fixed to it to allow you to be alerted of something about to crush the player.

Original thread: https://box2d.org/forum/viewtopic.php?t=4439