In driver, we are marking IRP as pending and on user side waiting for event to get IRP completed. In case user mode crashes, the thread where we are waiting for IRP to be complete is not getting closed. How can we know in the driver when the user mode crashes, so that we can release the pended IRPs?
You'll get IRP_MJ_CLEANUP and IRP_MJ_CLOSE for that file handle, just as if the process closed normally. That's where you're supposed to clean up any dangling requests.