You can do this by pressing the XF86LogGrabInfo key, introduced in this commit.
By default, this keysym is not bound to any physical key or key combination. But you can still activate it using
xdotool key "XF86LogGrabInfo"
After executing that command, a list of active grabs will be logged to the X log. On Ubuntu at least, this is
/var/log/Xorg.0.log. It will be somewhere near the end of the log file, but there may be several irrelevant log messages below it. If there are no grabs, it writes:
[1199271.146] (II) Printing all currently active device grabs:
[1199271.146] (II) End list of active device grabs
If there are grabs (here, I opened a menu in Firefox), it logs something like:
[1199428.782] (II) Printing all currently active device grabs:
[1199428.782] Active grab 0x4c00000 (core) on device 'Virtual core pointer' (2):
[1199428.782] client pid 15620 /usr/lib/firefox/firefox
[1199428.782] at 1199423728 (from active grab) (device thawed, state 1)
[1199428.782] core event mask 0x7c
[1199428.782] owner-events true, kb 1 ptr 1, confine 0, cursor 0x0
[1199428.782] (II) End list of active device grabs