Signal handlers were enabled during the execution of malloc() in the implementation of lexsave().
If a signal was received during the execution of malloc() and its handler attempted to allocate or free memory, the zsh process ended up in a deadlock and became unresponsive.
Signal handlers are no longer enabled during the execution of malloc(). Instead of that, signals are queued for processing upon the return from malloc().
The deadlock no longer occurs.