I think it's safe to explore your feelings here. People understand here.
If I saw someone wailing their guts out I would really want to give them a hug but, probably would be too inhibited so instead I would just go up to them and ask if they were okay and try to engage in conversation with them.